| Platform SDK: Certificate Enrollment Control | 
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);
UseExistingKeySet affects the behavior of the following methods:
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" ); 
' 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
  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.