CRYPT_PKCS8_IMPORT_PARAMS structure (wincrypt.h)

[The CRYPT_PKCS8_IMPORT_PARAMS 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_PKCS8_IMPORT_PARAMS structure contains a PKCS #8 private key and pointers to callback functions. CRYPT_PKCS8_IMPORT_PARAMS is used by the CryptImportPKCS8 function. The first callback supplies the algorithm object identifier (OID) and key length needed to specify the cryptographic service provider (CSP) into which the key will be imported. If the private key in PKCS #8 is encrypted, the CRYPT_PKCS8_IMPORT_PARAMS structure contains the encrypted private key, and the second callback is used to decrypt this private key.

Syntax

typedef struct _CRYPT_PKCS8_IMPORT_PARAMS {
  CRYPT_DIGEST_BLOB               PrivateKey;
  PCRYPT_RESOLVE_HCRYPTPROV_FUNC  pResolvehCryptProvFunc;
  LPVOID                          pVoidResolveFunc;
  PCRYPT_DECRYPT_PRIVATE_KEY_FUNC pDecryptPrivateKeyFunc;
  LPVOID                          pVoidDecryptFunc;
} CRYPT_PKCS8_IMPORT_PARAMS, *PCRYPT_PKCS8_IMPORT_PARAMS, CRYPT_PRIVATE_KEY_BLOB_AND_PARAMS, *PCRYPT_PRIVATE_KEY_BLOB_AND_PARAMS;

Members

PrivateKey

A CRYPT_DIGEST_BLOB structure that contains the PKCS #8 data.

pResolvehCryptProvFunc

A PCRYPT_RESOLVE_HCRYPTPROV_FUNC pointer that points to data used by a user-defined function that retrieves a handle to a CSP.

pVoidResolveFunc

An LPVOID value that identifies the function used to retrieve the CSP provider handle.

pDecryptPrivateKeyFunc

A PCRYPT_DECRYPT_PRIVATE_KEY_FUNC pointer that points to a callback function used to decrypt the private key.

pVoidDecryptFunc

An LPVOID value that provides data used for encryption, such as key, initialization vector, and password.

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

CryptImportPKCS8

PCRYPT_DECRYPT_PRIVATE_KEY_FUNC

PCRYPT_RESOLVE_HCRYPTPROV_FUNC