ICEnroll4::GetAlgName method

[This method is no longer available for use as of Windows Server 2008 and Windows Vista.]

The GetAlgName method retrieves the name of a cryptographic algorithm given its ID. The values retrieved by this method depend on the current cryptographic service provider (CSP). This method was first defined in the ICEnroll3 interface.

Syntax


HRESULT GetAlgName(
  [in]  LONG algID,
  [out] BSTR *pbstr
);

Parameters

algID [in]

A value that represents a cryptographic algorithm, as defined in Wincrypt.h. For example, CALG_MD2 is a defined algorithm identifier. For this method to be successful, the current CSP must support the algID algorithm.

pbstr [out]

Upon success, a pointer to a BSTR that represents the name of the algorithm specified by algID. When you have finished using the BSTR, free it by calling the SysFreeString function.

Return value

C++

The return value is an HRESULT. A value of S_OK indicates success. If a CSP does not support this method or does not support the algID cryptographic algorithm, an error is returned.

VB

The return value is a string that represents the name of the algorithm specified by algID. If a CSP does not support this method, an error is returned.

Remarks

This method may be used to display the names of algorithms whose IDs are retrieved by calling EnumAlgs.

Constants for the cryptographic algorithms are defined in Wincrypt.h.

Examples


BSTR      bstrAlgName = NULL;

HRESULT   hr;

// Retrieve the algorithm name.
// dwAlgID is a DWORD variable for an algorithm ID.
hr = pEnroll->GetAlgName( dwAlgID, &bstrAlgName);
if (FAILED(hr))
    printf("Failed GetAlgName [%x]\n", hr);
else
    printf("AlgID: %d Name: %S\n", dwAlgID, bstrAlgName );

// Free BSTR resource.
if ( NULL != bstrAlgName )
{
    SysFreeString( bstrAlgName );
    bstrAlgName = NULL;
}

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003

Header

Xenroll.h

Library

Uuid.lib

DLL

Xenroll.dll

IID

IID_ICEnroll4 is defined as c1f1188a-2eb5-4a80-841b-7e729a356d90

See also

ICEnroll4
ICEnroll3
CEnroll
EnumAlgs

 

 

Show: