Platform SDK: Certificate Enrollment Control

ICEnroll::MyStoreName [C++]

CEnroll.MyStoreName [Visual Basic]

The MyStoreName property specifies where certificates with linked private keys are kept. The value of MyStoreName specifies the store in which to place the new certificate produced from acceptPKCS7 or acceptFilePKCS7. By default, this is set to the "MY" system store.

[Visual Basic]
objEnroll.MyStoreName [ = Name ]
[C++]
HRESULT put_MyStoreName(BSTR Name);
HRESULT get_MyStoreName(BSTR * pName);

Parameters

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

Remarks

MyStoreName 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_MyStoreName( &bstrStoreName );
if ( FAILED ( hr ) )
    printf("Failed getting MyStoreName - %x\n", hr );
else
    printf( "MyStoreName: %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_MyStoreName( bstrNewName );
if ( FAILED ( hr ) )
    printf("Failed setting MyStoreName - %x\n", hr );
else
    printf( "MyStoreName 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 MyStoreName
strStoreName = objXen.MyStoreName
MsgBox strStoreName, vbOKOnly, "MyStoreName"

' set the MyStoreName
' (strOtherStoreName previously set to a valid store name)
objXen.MyStoreName = 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.