IX509PrivateKey::ExportPolicy property

The ExportPolicy property specifies or retrieves export constraints for a private key. This property is web enabled for both input and output.

This property is read/write.

Syntax


HRESULT put_ExportPolicy(
  [in]  X509PrivateKeyExportFlags Value
);

HRESULT get_ExportPolicy(
  [out] X509PrivateKeyExportFlags *pValue
);

Property value

An X509PrivateKeyExportFlags enumeration value that specifies the export policy for a private key. The policy is enforced by the provider and can be a bitwise OR of the following flags.

ValueMeaning
XCN_NCRYPT_ALLOW_EXPORT_NONE
0x00000000

Export is not allowed.

XCN_NCRYPT_ALLOW_EXPORT_FLAG
0x00000001

The private key can be exported.

XCN_NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG
0x00000002

The private key can be exported in plaintext form.

XCN_NCRYPT_ALLOW_ARCHIVING_FLAG
0x00000004

The private key can be exported once for archiving.

XCN_NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG
0x00000008

The private key can be exported once in plaintext form for archiving.

 

Error codes

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.

NameMeaning
HRESULT_FROM_WIN32(ERROR_FILE_READ_ONLY)

The key is open and the property value cannot be set.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

CertEnroll.h

DLL

CertEnroll.dll

See also

IX509PrivateKey

 

 

Community Additions

ADD
Show: