Platform SDK: Certificate Enrollment Control |
The KeySpec property is used to specify the key type to be generated. For the Microsoft Base Cryptographic Provider, this will have a value of AT_KEYEXCHANGE for exchange keys, or AT_SIGNATURE for signature keys. However, this parameter is specific to the provider used and may be any value that makes sense to the provider. The default for Microsoft Base Cryptographic Provider is AT_SIGNATURE. For information on the other Microsoft Cryptographic Service Providers, see Cryptographic Service Providers in the CryptoAPI 2.0 documentation.
[Visual Basic] objEnroll.KeySpec [ = Spec ] [C++] HRESULT put_KeySpec(DWORD Spec); HRESULT get_KeySpec(DWORD * pSpec);
KeySpec affects the behavior of the following methods:
DWORD dwKeySpec; HRESULT hr; // pEnroll is previously instantiated ICEnroll interface pointer // get the KeySpec value hr = pEnroll->get_KeySpec( &dwKeySpec ); if (FAILED( hr )) printf("Failed get_KeySpec - %x\n", hr ); else printf( "KeySpec: %d\n", dwKeySpec ); // set the KeySpec value hr = pEnroll->put_KeySpec( AT_KEYEXCHANGE ); if (FAILED( hr )) printf("Failed put_KeySpec - %x\n", hr ); else printf( "KeySpec set to %d\n", AT_KEYEXCHANGE );
Const AT_KEYEXCHANGE As Long = 1 ' declare Certificate Enrollment Control object Dim objXen As Object Dim nKeySpec As Long ' instantiate the object Set objXen = CreateObject("CEnroll.CEnroll.1") ' retrieve and display the KeySpec nKeySpec = objXen.KeySpec MsgBox nKeySpec, vbOKOnly, "KeySpec" ' set the KeySpec objXen.KeySpec = AT_KEYEXCHANGE
Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with the Windows NT 4.0 Option Pack).
Header: Declared in Xenroll.h.
Library: Use Uuid.lib.