Platform SDK: Certificate Enrollment Control

ICEnroll::ProviderType [C++]

CEnroll.ProviderType [Visual Basic]

The ProviderType property is dependent on the provider in use. The value for ProviderType is passed directly through to calls to CryptAcquireContext. It has a default value of one, as set in the registry. This means that PROV_RSA_FULL for the default Microsoft Base Cryptographic Provider is used.

[Visual Basic]
objEnroll.ProviderType [ = Type ]
[C++]
HRESULT put_ProviderType(BSTR Type);
HRESULT get_ProviderType(BSTR * pType);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] Type
The string value assigned to the ProviderType property. For defined values, see the documentation for your cryptographic service provider.
[C++] pType
Pointer to retrieved property value.

Remarks

ProviderType affects the behavior of the following methods:

Example Code [C++]

DWORD    dwProvType;
HRESULT  hr;

// get the ProviderType value
// pEnroll is previously instantiated ICEnroll interface pointer
hr = pEnroll->get_ProviderType( &dwProvType );
if (FAILED( hr ))
    printf("Failed get_ProviderType - %x\n", hr );
else
    printf( "ProviderType: %d\n", dwProvType );

// set the ProviderType value
hr = pEnroll->put_ProviderType( PROV_MS_EXCHANGE );
if (FAILED( hr ))
    printf("Failed put_ProviderType - %x\n", hr );
else
    printf( "ProviderType set to %d\n", PROV_MS_EXCHANGE  ); 

Example Code [Visual Basic]

Const PROV_MS_EXCHANGE As Long = 5

' declare Certificate Enrollment Control object
Dim objXen As Object

Dim ProvType As Long

' instantiate the object
Set objXen = CreateObject("CEnroll.CEnroll.1")

' retrieve and display the ProviderType
ProvType = objXen.ProviderType
MsgBox ProvType, vbOKOnly, "ProviderType"

' set the ProviderType
objXen.ProviderType = PROV_MS_EXCHANGE

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.