IX509Enrollment::InitializeFromTemplateName method (certenroll.h)
The InitializeFromTemplateName method initializes the enrollment object from a template common name (CN).
Syntax
HRESULT InitializeFromTemplateName(
[in] X509CertificateEnrollmentContext Context,
[in] BSTR strTemplateName
);
Parameters
[in] Context
An X509CertificateEnrollmentContext enumeration value that indicates whether the requested enrollment is for a user, a computer, or an administrator acting on behalf of a computer.
[in] strTemplateName
A BSTR variable that contains the Common Name (CN) of the template as it appears in Active Directory or the dotted decimal object identifier.
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 |
---|---|
|
The enrollment object has already been initialized. |
Remarks
The InitializeFromTemplateName method:
- Examines the template to determine the type of request needed.
- Creates the appropriate type of request object (PKCS #10, PKCS #7, or CMC).
- Sets the following properties on the request if values currently exist:
- Initializes the request object by using the template.
- Retrieves the signature count, issuance policies, and application policies from the template.
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 |