Platform SDK: Certificate Enrollment Control

ICEnroll::ProviderName [C++]

CEnroll.ProviderName [Visual Basic]

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);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] Name
The string value assigned to the ProviderName property. Is any valid provider name.
[C++] pName
Pointer to retrieved property value.

Remarks

ProviderName affects the behavior of the following methods:

Example Code [C++]

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 );

Example Code [Visual Basic]

' 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"

Requirements

  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.