ICertPropertyEnrollment::Initialize method (certenroll.h)

The Initialize method initializes the property from the certificate request ID, the certification authority (CA) configuration string, and an optional certificate display name.

Syntax

HRESULT Initialize(
  [in]           LONG RequestId,
  [in]           BSTR strCADnsName,
  [in]           BSTR strCAName,
  [in, optional] BSTR strFriendlyName
);

Parameters

[in] RequestId

A LONG variable that contains the certificate request ID. A request ID is created by the enrollment process. You can retrieve this value by calling the RequestId property on the IX509Enrollment interface.

[in] strCADnsName

A BSTR variable that contains the Domain Name System (DNS) name of the CA. This is the first name in the CADnsName\CAName CA configuration string. The configuration string is typically set during the enrollment process. The DNS name can be retrieved by calling the CAConfigString property and separating the string into its constituent parts.

[in] strCAName

A BSTR variable that contains the subject common name (CN) of the CA. This is the second name in the CADnsName\CAName CA configuration string. The configuration string is typically set during the enrollment process. The CN name can be retrieved by calling the CAConfigString property and separating the string into its constituent parts.

[in, optional] strFriendlyName

A BSTR variable that contains an optional display name for the certificate. The default value is NULL. This value is typically set during the enrollment process. You can retrieve it by calling the CertificateFriendlyName property.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. Possible values include, but are not limited to, those in the following table. For a list of common error codes, see Common HRESULT Values.

Return code/value Description
HRESULT_FROM_WIN32(ERROR_ALREADY_INITIALIZED)
The object is already initialized.

Remarks

The values that you can use to initialize the ICertPropertyEnrollment object are set during the certificate enrollment process when the client calls the Enroll method on the IX509Enrollment object. That is, to retrieve a request ID, call the RequestId property on the IX509Enrollment object. To retrieve a certificate display name, call the CertificateFriendlyName property. To retrieve a distinguished name and common name, call the CAConfigString property and separate the configuration string into its constituent parts.

Call the SetValueOnCertificate method to associate the property with a certificate. You can also call the following properties to retrieve the values specified during initialization:

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header certenroll.h
DLL CertEnroll.dll

See also

ICertProperty

ICertPropertyEnrollment