IX509AttributeArchiveKeyHash::InitializeEncodeFromEncryptedKeyBlob method (certenroll.h)

The InitializeEncodeFromEncryptedKeyBlob method initializes the attribute from an encrypted private key. The method computes a SHA-1 hash of the private key.

Syntax

HRESULT InitializeEncodeFromEncryptedKeyBlob(
  [in] EncodingType Encoding,
  [in] BSTR         strEncryptedKeyBlob
);

Parameters

[in] Encoding

An EncodingType enumeration value that specifies the type of Unicode encoding applied to the input string that contains the key.

[in] strEncryptedKeyBlob

A BSTR variable that contains the encrypted key.

Return value

If the function succeeds, the function returns S_OK.

If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

The object identifier (OID) for this attribute is XCN_OID_ENCRYPTED_KEY_HASH (1.3.6.1.4.1.311.21.21). For more information, see CERTENROLL_OBJECTID.

You must call either InitializeEncodeFromEncryptedKeyBlob or InitializeDecode before you can use an IX509AttributeArchiveKeyHash object. The two methods complement each other. The InitializeEncodeFromEncryptedKeyBlob method enables you to construct an encoded Abstract Syntax Notation One (ASN.1) structure from raw data, and the InitializeDecode method enables you to initialize raw data from an encoded ASN.1 structure. You can call the EncryptedKeyHashBlob property to retrieve the raw data.

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

IX509AttributeArchiveKeyHash