IMetabaseUser.InitCertificate

Syntax

InitCertificate(StorageType: CertificateStorageType);

Description

The InitCertificate method gets a certificate from the warehouse, copies it and assigns the obtained value to IMetabaseUser.Certificate.

Example

To execute the example, add a link to the Metabase system assembly.

Sub UserProc;
Var
    MB: IMetabase;
    MS: IMetabaseSecurity;
    User: IMetabaseUser;
    Lic: Object;
Begin
    MB := MetabaseClass.Active;
    
// Check out license to work with security manager
    Lic := MB.RequestLicense(UiLicenseFeatureType.Adm);
    MS := MB.Security;
    
// Add certificate from file and assign certificate copy to the ADMIN user
    User := MS.ResolveName("ADMIN"As IMetabaseUser;
    User.InitCertificate(CertificateStorageType.File);
    
// Save changes
    MS.Apply;
    
// Check in license
    Lic := Null;
End Sub UserProc;

After executing the example the certificate copy from the selected file is assigned to the ADMIN user.

See also:

IMetabaseUser