ICertProvider.OpenSigner

Syntax

OpenSigner(Name: String; Data: IIOStream): ICertSigner;

Parameters

Name. Signer name.

Data. Stream linked to private certificate key.

Description

The OpenSigner method returns signer for the certificate which private key is sent in the specified stream.

Example

Function SampleSigner(Code: String; PathKey: String): String;
Var
    Package: ISecurityPackage;
    Provider: ICertProvider;
    FStream: IFileStream;
    Signer: ICertSigner;
    Signature: String;
Begin
    Package := New StandardSecurityPackage.Create;
    Provider := Package.CertProvider;
    //Comparison of random value and block of data
    Provider.Code(Math.RandBetweenI(Integer.MinValue, Integer.MaxValue).ToString) := Code;
    FStream := New FileStream.Create(PathKey, FileOpenMode.Read, FileShare.DenyNone);
    //Get signer
    Signer := Provider.OpenSigner("sp", FStream);
    //Digital signature
    Signature := Signer.Sign(Code);
    Dispose FStream;
    Return Signature;
End Function SampleSigner;

The specified function is used to sign block of data with digital signature. Block of data and patch to the file with private key are sent as input parameters. On the output function returns block of data signed with digital signature.

See also:

ICertProvider