CryptFindCertificateKeyProvInfo

This function enumerates the cryptographic providers and their containers to find the private key corresponding to the certificate's public key.

BOOL WINAPI CryptFindCertificateKeyProvInfo(
PCCERT_CONTEXT pCert,
DWORD dwFlags,
void *pvReserved
);

Parameters

  • pCert
    [in] Pointer to the CERT_CONTEXT structure of the certificate to use when exporting public key information.

  • dwFlags
    [in] The following flag values are defined.

    Value Description
    CRYPT_FIND_USER_KEYSET_FLAG Restricts the search to the user container.
    CRYPT_FIND_MACHINE_KEYSET_FLAG Restricts the search to the machine container.

    If no flag value is specified, both the user and the machine containers are searched.

  • pvReserved
    [in] Reserved for future use and must be NULL.

    Note This function enumerates the cryptographic providers and their containers to find the private key corresponding to the certificate's public key. For a match, the function updates the certificate's CERT_KEY_PROV_INFO_PROP_ID property. If the CERT_KEY_PROV_INFO_PROP_ID is already set, it is checked to see if it matches the provider's public key. For a match, the function skips the previously mentioned enumeration.

Return Values

Returns TRUE if the function finds a private key corresponding to the certificate's public key within a searched container.

Returns FALSE if the function fails to find a container or a private key within a container.

The GetLastError function returns the following error.

Error code Description
NTE_NO_KEY No container found.

Requirements

Runs on Versions Defined in Include Link to
Windows CE OS 3.0 or later Wincrypt.h   Crypt32.lib

Note   This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.

See Also

CERT_CONTEXT

 Last updated on Tuesday, July 13, 2004

© 1992-2000 Microsoft Corporation. All rights reserved.