Platform SDK: Certificate Enrollment Control

ICEnroll::ProviderFlags [C++]

CEnroll.ProviderFlags [Visual Basic]

The ProviderFlags property is dependent on the provider in use. The value for ProviderFlags is passed directly through to calls to CryptAcquireContext. By default, this value is set to 0.

[Visual Basic]
objEnroll.ProviderFlags [ = Flags ]
[C++]
HRESULT put_ProviderFlags(DWORD Flags);
HRESULT get_ProviderFlags(DWORD * pFlags);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] Flags
Value assigned to the ProviderFlags property. The datatype is a DWORD in C++, and a Long in Visual Basic. The value of this property depends on the provider. For the default provider, Microsoft Base Cryptographic Provider, see CryptAcquireContext for details on the flags. For other providers, see your cryptographic service provider (CSP) for details.
[C++] pFlags
Pointer to retrieved property value.

Remarks

ProviderFlags affects the behavior of the following methods:

Example Code [C++]

DWORD    dwProvFlags;
HRESULT  hr;

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

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

Example Code [Visual Basic]

Const CRYPT_MACHINE_KEYSET As Long = &H20

' declare Certificate Enrollment Control object
Dim objXen As Object

Dim ProvFlags As Long

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

' retrieve and display the ProviderFlags
ProvFlags = objXen.ProviderFlags
MsgBox ProvFlags, vbOKOnly, "ProviderFlags"

' set the ProviderFlags
objXen.ProviderFlags = CRYPT_MACHINE_KEYSET

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.