ICEnroll4::ContainerName property

[This property is no longer available for use as of Windows Server 2008 and Windows Vista.]

The ContainerName property sets or retrieves the name of the key container to use.

This property was first defined in the ICEnroll interface.

This property is read/write.

Syntax


HRESULT put_ContainerName(
  [in]  BSTR Name
);

HRESULT get_ContainerName(
  [out] BSTR *pName
);

Property value

The string that contains the name of the key container to use.

Error codes

If the property access methods put_ContainerName and get_ContainerName succeed, they return S_OK.

Any other HRESULT value indicates that the call failed.

Remarks

The container specified may be an existing container or a new one. It may only be an existing container if the UseExistingKeySet property is set, as long as the key set has not been generated yet. For example, if only an exchange key set has been generated for a container, it is still possible to perform a certificate enrollment using the signature key set without setting UseExistingKeySet. The exchange key set could be used if UseExistingKeySet is set beforehand.

By default, a new container is selected each time the ICEnroll control is run. This ensures that a new key set is generated. If this property is not explicitly set, a generated GUID is used as the container name.

The ContainerName property affects the behavior of the following methods:

Examples


BSTR     bstrContainerName = NULL;
HRESULT  hr;

// pEnroll is previously instantiated ICEnroll interface pointer

// get the container name
hr = pEnroll->get_ContainerName( &bstrContainerName );
if ( FAILED ( hr ) )
    printf("Failed getting ContainerName - %x\n", hr );
else
    printf( "ContainerName: %ws\n", bstrContainerName );
// free BSTR when done
if ( NULL != bstrContainerName )
    SysFreeString( bstrContainerName );

// set the container name
// bstrMyName previously set to a valid name
hr = pEnroll->put_ContainerName( bstrMyName );
if ( FAILED ( hr ) )
    printf("Failed setting ContainerName - %x\n", hr );
else
    printf( "ContainerName was set to %ws\n", bstrMyName );

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

End of client support

Windows XP

End of server support

Windows Server 2003

Header

Xenroll.h

Library

Uuid.lib

DLL

Xenroll.dll

IID

IID_ICEnroll4 is defined as c1f1188a-2eb5-4a80-841b-7e729a356d90

 

 

Show: