CertAlgIdToOID

The CertAlgIdToOID function converts the Microsoft® CryptoAPI algorithm identifier (ALG_ID) to the ASN.1 Object Identifier string.

#include <wincrypt.h>
LPCSTR WINAPI CertAlgIdToOID(
  DWORD dwAlgId            // in
);
 

Parameters

dwAlgId
The dwAlgId to be converted to an OID.

Return Values

Returns NULL if there isn't an Object Identifier string corresponding to the algorithm identifier.

Example

// EXAMPLE CODE FOR USING CertAlgIdToOID() to 
// convert the CALG_SHA algorithm identifier to an 
// Object Identifier string.

// Set up the variables.
LPCSTR pszObjID;

pszObjID= CertAlgIdToOID(CALG_SHA);

if (pszObjID == NULL) 
   printf("No object identifier string correlates to the ALG_ID. \n");
else
   // Print the object identifier returned.
   printf("%s", pszObjID );
 

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.