ICertProvider.OpenVerifierBase64

Syntax

OpenVerifierBase64(Name: String; Data: String): ICertVerifier;

Parameters

Name. Controller name.

Data. Certificate in the Base64 format.

Description

The OpenSignerBase64 method returns controller which verifies digital signature using passed certificate.

Example

Executing the example requires that repository base contains security certificate with the sp identifier.

Function SampleVerifier(Code: String; Signature: String): Boolean;
Var
    MB: IMetabase;
    Cert: ICertificate;
    Package: ISecurityPackage;
    Provider: ICertProvider;
    Verifier: ICertVerifier;
    Result: Boolean;
Begin
    MB := MetabaseClass.Active;
    //Get certificate
    Cert := MB.Security.Policy.Certificates.FindById("sp");
    //Get controller
    Package := New StandardSecurityPackage.Create;
    Provider := Package.CertProvider;
    Verifier := Provider.OpenVerifierBase64("sp", Cert.Data);
    //Check digital signature
    Result := Verifier.Verify(Code, Signature);
    Return Result;
End Function SampleVerifier;

The specified function is used to check digital signature of data block. Random block and block digitally signed are sent as initial parameters. Certificate for checking will be obtained from repository base and sent as string. Function result is a logical value indicating whether digital signature matches with sent random block of data.

See also:

ICertProvider