IPolicyQualifier::InitializeEncode method (certenroll.h)
The InitializeEncode method initializes the object from a string and a value that identifies the qualifier type.
Syntax
HRESULT InitializeEncode(
[in] BSTR strQualifier,
[in] PolicyQualifierType Type
);
Parameters
[in] strQualifier
A BSTR variable that contains the qualifier.
[in] Type
A PolicyQualifierType enumeration value that specifies the type of qualifier applied to a certificate policy. This can be one of the following values.
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 | Description |
---|---|
|
The object is already initialized. |
Remarks
If you specify PolicyQualifierTypeUrl in the Type parameter, this method associates the string entered in the strQualifier parameter with the XCN_OID_PKIX_POLICY_QUALIFIER_CPS (1.3.6.1.5.5.7.2.1) object identifier (OID) and encodes it by using Distinguished Encoding Rules (DER). The URL is encoded as an Abstract Syntax Notation One (ASN.1) IA5 string.
If you specify PolicyQualifierTypeUserNotice in the Type parameter, this method associates the string entered in the strQualifier parameter with the XCN_OID_PKIX_POLICY_QUALIFIER_USERNOTICE (1.3.6.1.5.5.7.2.2) OID and encodes it by using DER.
You can retrieve the following properties for this object:
- The ObjectId property retrieves an OID that identifies whether the qualifier is a CPS or a user notice.
- The Qualifier property retrieves the string specified for the strQualifier parameter of the InitializeEncode method.
- The RawData property retrieves the DER-encoded qualifier.
- The Type property retrieves a value of the PolicyQualifierType enumeration that specifies the qualifier type.
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 |