Platform SDK: Certificate Enrollment Control |
The GetAlgName method retrieves the name of a cryptographic algorithm given its ID. This is useful for displaying names of algorithms whose IDs are retrieved by calling ICEnroll3::EnumAlgs. The values retrieved by this method are dependent upon the current cryptographic service provider.
[Visual Basic] objEnroll.GetAlgName( _ algID As Long ) As String [C++] HRESULT GetAlgName( DWORD algID, BSTR* pbstr );
[Visual Basic] The return value is a string representing the name of the algorithm specified by algID. If a CSP doesn't support this method, an error is returned.
[C++] The return value is an HRESULT. A value of S_OK indicates success. If a CSP doesn't support this method, an error is returned.
Call this method to retrieve a string representing the name of a cryptographic algorithm, given its ID.
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; }
Dim strAlgName As String ' Retrieve the name. ' AlgID is a LONG value representing an algorithm ID. strAlgName = objXen.GetAlgName(AlgID) ' Display the name. MsgBox(strAlgName)
Windows NT/2000: Requires Windows 2000.
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.