For the CRYPT_HASH_ALG_OID_GROUP_ID, the following predefined entries exist. Note that the varying members of the CRYPT_OID_INFO structure for this group are shown in the table. These correspond to the find criteria that should be used for this group when making calls to CryptFindOIDInfo. The values for members that do not vary for entries in this group are typically set to zero, or NULL, except that cbSize which always is set to the size of CRYPT_OID_INFO, and the dwGroupId always is set to this group.
pszOID | pwszName | Algid |
---|---|---|
szOID_OIWSEC_sha1 | L"sha" | CALG_SHA1 |
szOID_OIWSEC_sha1 | L"sha1" | CALG_SHA1 |
szOID_OIWSEC_sha | L"sha" | CALG_SHA |
szOID_RSA_MD5 | L"md5" | CALG_MD5 |
szOID_RSA_MD4 | L"md4" | CALG_MD4 |
szOID_RSA_MD2 | L"md2" | CALG_MD2 |
The C code used to populate the table (an array of CCRYPT_OID_INFO structures) is shown below.
//+-------------------------------------------------------------------------
// Hash Algorithm Table
//--------------------------------------------------------------------------
#define HASH_ALG_ENTRY(pszOID, pwszName, Algid) \
OID_INFO_LEN, pszOID, pwszName, CRYPT_HASH_ALG_OID_GROUP_ID, Algid, 0, NULL
static CCRYPT_OID_INFO HashAlgTable[] = {
HASH_ALG_ENTRY(szOID_OIWSEC_sha1, L"sha", CALG_SHA1),
HASH_ALG_ENTRY(szOID_OIWSEC_sha1, L"sha1", CALG_SHA1),
HASH_ALG_ENTRY(szOID_OIWSEC_sha, L"sha", CALG_SHA),
HASH_ALG_ENTRY(szOID_RSA_MD5, L"md5", CALG_MD5),
HASH_ALG_ENTRY(szOID_RSA_MD4, L"md4", CALG_MD4),
HASH_ALG_ENTRY(szOID_RSA_MD2, L"md2", CALG_MD2)
};
#define HASH_ALG_CNT (sizeof(HashAlgTable) / sizeof(HashAlgTable[0]))