Platform SDK: Certificate Enrollment Control

ICEnroll::UseExistingKeySet [C++]

CEnroll.UseExistingKeySet [Visual Basic]

The UseExistingKeySet property must be set to TRUE if an existing key set is used instead of generating a new one. By default, this property value is FALSE.

[Visual Basic]
objEnroll.UseExistingKeySet [ = bValue ]
[C++]
HRESULT put_UseExistingKeySet(BOOL bValue);
HRESULT get_UseExistingKeySet(BOOL * pbValue);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] bValue
A boolean value assigned to the UseExistingKeySet property. It is one of the following values:
[C++] pbValue
Pointer to retrieved property value.

Remarks

UseExistingKeySet affects the behavior of the following methods:

Example Code [C++]

BOOL     bUEKS;
HRESULT  hr;

// pEnroll is previously instantiated ICEnroll interface pointer

// get the UseExistingKeySet value
hr = pEnroll->get_UseExistingKeySet( &bUEKS );
if (FAILED( hr ))
    printf("Failed get_UseExistingKeySet - %x\n", hr );
else
    printf( "UseExistingKeySet: %d\n", bUEKS );

// set the UseExistingKeySet value
hr = pEnroll->put_UseExistingKeySet( TRUE );
if (FAILED( hr ))
    printf("Failed put_UseExistingKeySet - %x\n", hr );
else
    printf( "UseExistingKeySet set to TRUE\n" ); 

Example Code [Visual Basic]

' declare Certificate Enrollment Control object
Dim objXen As Object

Dim bUseExistKS As Boolean

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

' retrieve and display the UseExistingKeySet value
bUseExistKS = objXen.UseExistingKeySet
MsgBox bUseExistKS, vbOKOnly, "UseExistingKeySet"

' set the UseExistingKeySet value
objXen.UseExistingKeySet = True

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.