ICEnroll3::GetSupportedKeySpec method (xenroll.h)

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

The GetSupportedKeySpec method retrieves information regarding the current cryptographic service provider (CSP) support for signature and/or exchange operations. This method was first defined in the ICEnroll3 interface.

The values retrieved by this method are dependent upon the current CSP.

Syntax

HRESULT GetSupportedKeySpec(
  [out] LONG *pdwKeySpec
);

Parameters

[out] pdwKeySpec

A pointer to a LONG that receives a bit flag that indicates whether the current CSP supports exchange and signature keys.

Return value

C++

If the method succeeds, the method returns S_OK.

If the method fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

VB

Returns a value that indicates whether the current CSP supports exchange and signature keys. If the CSP does not support this method, an error is returned.

Remarks

Call this method to determine whether the current CSP supports exchange keys, signature keys, or both. The pdwKeySpec parameter will contain one or more of the following constants (defined in Wincrypt.h):

  • AT_KEYEXCHANGE
  • AT_SIGNATURE

Examples

DWORD dwKeySpec;

// Determine the supported key specifications.
// hr is HRESULT variable.
hr = pEnroll->GetSupportedKeySpec( &dwKeySpec );
if ( FAILED( hr ) )    
    printf("Failed GetSupportedKeySpec [%x]\n", hr);
else
{
    printf("Exchange keys are %s. Signature keys are %s.\n",
           dwKeySpec & AT_KEYEXCHANGE ? "supported" : "not supported",
           dwKeySpec & AT_SIGNATURE ? "supported" : "not supported" );
}

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header xenroll.h
Library Uuid.lib
DLL Xenroll.dll

See also

CEnroll

ICEnroll3

ICEnroll4