Platform SDK: Certificate Enrollment Control

ICEnroll::RootStoreName [C++]

CEnroll.RootStoreName [Visual Basic]

The RootStoreName property specifies where all intrinsically trusted self-signed ROOT certificates are kept. By default, this is set to the "ROOT" system store. Because of the level of trust associated with the ROOT store, the user may be prompted (by means of a user interface) to accept the certificate. Although this property need not be changed for many applications, to avoid the user interface associated with trusting ROOT certificates, a possiblity is to set RootStoreName to "CA".

[Visual Basic]
objEnroll.RootStoreName [ = Name ]
[C++]
HRESULT put_RootStoreName(BSTR Name);
HRESULT get_RootStoreName(BSTR * pName);

Parameters

[Visual Basic] objEnroll
Object expression that resolves to a CEnroll object.
[Visual Basic,C++] Name
The string value assigned to the RootStoreName property. It can be any defined store name, such as the following:
[C++] pName
Pointer to retrieved property value.

Remarks

RootStoreName affects the behavior of the following methods:

Example Code [C++]

BSTR     bstrStoreName = NULL;
HRESULT  hr;

// pEnroll is previously instantiated ICEnroll interface pointer

// get the storename
hr = pEnroll->get_RootStoreName( &bstrStoreName );
if ( FAILED ( hr ) )
    printf("Failed getting RootStoreName - %x\n", hr );
else
    printf( "RootStoreName: %ws\n", bstrStoreName );
// free BSTR when done
if ( NULL != bstrStoreName )
    SysFreeString( bstrStoreName );

// set the storename
// bstrNewName previously set to a valid store name
hr = pEnroll->put_RootStoreName( bstrNewName );
if ( FAILED ( hr ) )
    printf("Failed setting RootStoreName - %x\n", hr );
else
    printf( "RootStoreName was set to : %ws\n", bstrNewName );

Example Code [Visual Basic]

' declare Certificate Enrollment Control object
Dim objXen As Object

Dim strStoreName As String

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

' retrieve and display the RootStoreName
strStoreName = objXen.RootStoreName
MsgBox strStoreName, vbOKOnly, "RootStoreName"

' set the RootStoreName
' (strOtherStoreName previously set to a valid store name)
objXen.RootStoreName = strOtherStoreName

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.