| Platform SDK: Certificate Enrollment Control |
The ProviderName property specifies the cryptographic service provider (CSP) to use. If one has not been specified, the default provider is Microsoft Base Cryptographic Provider, and the ProviderName will be an empty string.
[Visual Basic] objEnroll.ProviderName [ = Name ] [C++] HRESULT put_ProviderName(BSTR Name); HRESULT get_ProviderName(BSTR * pName);
ProviderName affects the behavior of the following methods:
BSTR bstrProvName = NULL;
BSTR bstrMyProvName = NULL;
HRESULT hr;
// pEnroll is previously instantiated ICEnroll interface pointer
// get the ProviderName
hr = pEnroll->get_ProviderName( &bstrProvName );
if (FAILED( hr ))
printf("Failed get_ProviderName - %x\n", hr );
else
printf( "ProviderName: %ws\n", bstrProvName );
// free BSTR when done
if ( NULL != bstrProvName )
SysFreeString( bstrProvName );
// set the ProviderName value
bstrMyProvName = SysAllocString(TEXT("Microsoft Base DSS")
TEXT(" Cryptographic Provider"));
hr = pEnroll->put_ProviderName( bstrMyProvName );
if (FAILED( hr ))
printf("Failed put_ProviderName - %x\n", hr );
else
printf( "ProviderName set to %ws\n", bstrMyProvName );
// free BSTR when done
if ( NULL != bstrMyProvName )
SysFreeString( bstrMyProvName );
' declare Certificate Enrollment Control object
Dim objXen As Object
Dim strProvName As String
' instantiate the object
Set objXen = CreateObject("CEnroll.CEnroll.1")
' retrieve and display the ProviderName
strProvName = objXen.ProviderName
MsgBox strProvName, vbOKOnly, "ProviderName"
' set the ProviderName
objXen.ProviderName = "Microsoft Base DSS" _
& " and Diffie-Hellman" _
& " Cryptographic Provider"
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.