IMetabaseUser.InitCertificate

Fore Syntax

InitCertificate(StorageType: CertificateStorageType);

Fore.NET Syntax

InitCertificate(StorageType: Prognoz.Platform.Interop.Metabase.CertificateStorageType);

Description

The Certificate Method returns the certificate selected by certificate storage and assigns the obtained value to IMetabaseUser.Certificate.

Fore Example

Executing the example requires a form containing the Button component with the Button1 identifier.

Add a link to the Metabase system assembly.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    User: IMetabaseUser;
    Security: IMetabaseSecurity;
Begin
    Security := MetabaseClass.Active.Security;
    User := Security.ResolveName(
"ADMIN"As IMetabaseUser;
    User.InitCertificate(CertificateStorageType.File);
    Security.Apply;
End Sub Button1OnClick;

After executing the example clicking the button assigns the valid certificate from selected file to the ADMIN user.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Imports Prognoz.Platform.Interop.Metabase;
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
    
Var
    User: IMetabaseUser;
    Security: IMetabaseSecurity;
Begin
    Security := Self.Metabase.Security;
    User := Security.ResolveName(
"ADMIN"As IMetabaseUser;
    User.InitCertificate(CertificateStorageType.cstFile);
    Security.Apply();
End Sub;

See also:

IMetabaseUser