IX509PrivateKey::ExportPublicKey method (certenroll.h)

The ExportPublicKey method exports the public key portion of the asymmetric key pair.

Syntax

HRESULT ExportPublicKey(
  [out] IX509PublicKey **ppPublicKey
);

Parameters

[out] ppPublicKey

Address of a variable that receives a pointer to an IX509PublicKey interface that represents the 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

You must call Open or Create to open the private key before calling this method.

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