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