IX509PrivateKey::put_Certificate method (certenroll.h)

The Certificate property specifies or retrieves a byte array that contains the certificate associated with the private key. The byte array is represented by a Unicode-encoded string.

This property is read/write.

Syntax

HRESULT put_Certificate(
  EncodingType Encoding,
  BSTR         Value
);

Parameters

Encoding

Value

Return value

None

Remarks

If the key is not open when you specify a certificate, the certificate will be set when the key is opened. For more information, see the Open method.

The Certificate property compares the public key associated with the IX509PrivateKey object to the public key included in the certificate. The two keys must match.

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

IX509PrivateKey