CRYPT_PRIVATE_KEY_INFO structure (wincrypt.h)

[The CRYPT_PRIVATE_KEY_INFO structure is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

The CRYPT_PRIVATE_KEY_INFO structure contains a clear-text private key in the PrivateKey field (DER encoded). CRYPT_PRIVATE_KEY_INFO contains the information in a PKCS #8 PrivateKeyInfo ASN.1 type found in the PKCS #8 standard.

Syntax

typedef struct _CRYPT_PRIVATE_KEY_INFO {
  DWORD                      Version;
  CRYPT_ALGORITHM_IDENTIFIER Algorithm;
  CRYPT_DER_BLOB             PrivateKey;
  PCRYPT_ATTRIBUTES          pAttributes;
} CRYPT_PRIVATE_KEY_INFO, *PCRYPT_PRIVATE_KEY_INFO;

Members

Version

A DWORD value that identifies the PKCS #8 version.

Algorithm

A CRYPT_ALGORITHM_IDENTIFIER structure that indicates the algorithm in which the private key (RSA or DSA) is to be used.

PrivateKey

A CRYPT_DER_BLOB structure that contains the key data.

pAttributes

A CRYPT_ATTRIBUTES structure that identifies the PKCS #8 attributes.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header wincrypt.h

See also

CryptExportPKCS8Ex

PCRYPT_RESOLVE_HCRYPTPROV_FUNC