IX509EndorsementKey::AddCertificate method (certenroll.h)

Add an endorsement key certificate to the key storage provider (KSP) that supports endorsement keys. You can only call the AddCertificate method after the Open method has been successfully called.

Syntax

HRESULT AddCertificate(
  [in] EncodingType Encoding,
  [in] BSTR         strCertificate
);

Parameters

[in] Encoding

An EncodingType enumeration value that specifies the type of Unicode-encoding applied to the certificate. The default value is XCN_CRYPT_STRING_BASE64.

[in] strCertificate

The certificate to add to the store. The public key from this certificate must match the public key of the endorsement key.

Return value

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Only non-manufacturer certificates can be added to the key storage provider.

Requirements

Requirement Value
Target Platform Windows
Header certenroll.h
DLL Certenroll.dll

See also

IX509EndorsementKey