CryptFindOIDInfo

The CryptFindOIDInfo function uses the specified key and group to find OID information.

Default tables are supplied with predefined entries that cover commonly used key and group ID combinations. These tables can be expanded per user need by adding combinations with CryptRegisterOIDInfo. User added combinations can be removed from the tables using CryptUnregisterOIDInfo.

When expanding the tables using CryptRegisterOIDInfo, the new entries can be placed either before or after the predefined entries. It is controlled by CryptRegisterOIDInfo(dwFlags). The placement of registered OID information may affect the result of the find operation, since the tables are searched such that registered entries placed before the predefined entries are checked first for a match, then the predefined entries are checked, and finally, registered entries placed after the predefined entries are checked. The first match found is returned. So, if a registered entry placed before the predefined entries overrides one of the predefined entries, it will be returned from CryptFindOIDInfo when it matches the find criteria (the specified key and group).

#include <wincrypt.h>
PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(
  DWORD dwKeyType,    // in
  void *pvKey,        // in
  DWORD dwGroupId     // in
);
 

Parameters

dwKeyType
Specifies the key type to use when finding OID information.

Currently defined key types are shown in the following table:
Key type Meaning of pvKey
CRYPT_OID_INFO_OID_KEY pvKey points to a szOID
CRYPT_OID_INFO_NAME_KEY pvKey points to a wszName
CRYPT_OID_INFO_ALGID_KEY pvKey points to an ALG_ID
CRYPT_OID_INFO_SIGN_KEY pvKey points to an array of two ALG_IDs where:

ALG_ID[0] is the Hash AlgId

ALG_ID[1] is the PubKey AlgId


pvKey
Depends on the dwKeyType. See it for details.
dwGroupId
Specifies the group ID to use when finding OID information. Setting dwGroupId to zero searches all groups according to the dwKeyType. Otherwise, only the dwGroupId is searched.

See Default CRYPT_OID_INFO Tables by dwGroupId for information on the default tables and their predefined entries.

Return Values

Returns a pointer to a constant data structure of CRYPT_OID_INFO type. The returned pointer MUST NOT be freed. NULL is returned when unable to find any information for the specified key and group.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Requires Windows 98 (or Windows 95 with IE 3.02 or later).
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

ALG_ID, CRYPT_ALGORITHM_IDENTIFIER, CRYPT_OID_INFO, CryptRegisterOIDInfo, CryptUnregisterOIDInfo