OpenSignerBase64(Name: String; Data: String): ICertSigner;
Name. Signer name.
Data. Contents of the certificate private key in the Base64 format.
The OpenSignerBase64 method returns signer for certificate for which private key is sent.
Function SampleSigner(Code: String; PrivateKey: String): String;
Var
Package: ISecurityPackage;
Provider: ICertProvider;
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;
//Get signer
Signer := Provider.OpenSignerBase64("sp", PrivateKey);
//Sign with digital signature
Signature := Signer.Sign(Code);
Return Signature;
End Function SampleSigner;
The specified function is used to sign block of data with digital signature. Block of data and private key are sent as initial parameters. On the output function returns block of data signed with digital signature.
See also: