The CertOIDToAlgId function converts the ASN.1 Object Identifier string to the CryptoAPI algorithm identifier (ALG_ID).
#include <wincrypt.h>
DWORD WINAPI CertOIDToAlgId(
LPCSTR pszObjId // in
);
Returns zero if there isn't an algorithm identifier corresponding to the Object Identifier string.
// EXAMPLE CODE FOR USING CertOIDToAlgId() to
// convert the szOID_RSA_RC4 Object Identifier string to an
// algorithm identifier.
// Set up the variables.
LPCSTR pszObjID = szOID_RSA_RC4;
DWORD Alg_Id;
Alg_Id = CertOIDToAlgId(pszObjID);
if (Alg_Id == 0)
printf("No ALG_ID string correlates to the Object Identifier. \n");
else
// Print the Alg_Id returned in hex.
printf("%h", Alg_Id);
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.