ICEnroll3::put_ReuseHardwareKeyIfUnableToGenNew method (xenroll.h)

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

The ReuseHardwareKeyIfUnableToGenNew property sets or retrieves a Boolean value that determines the action taken by the certificate enrollment control object if an error is encountered when generating a new key.

This property was first defined in the ICEnroll3 interface.

This property is read/write.

Syntax

HRESULT put_ReuseHardwareKeyIfUnableToGenNew(
  BOOL fReuseHardwareKeyIfUnableToGenNew
);

Parameters

fReuseHardwareKeyIfUnableToGenNew

Return value

None

Remarks

This property is a Boolean value. This property affects only cryptographic service providers that return NTE_TOKEN_KEYSET_STORAGE_FULL. These CSPs are typically hardware-based; an example is a smart card. If this property is true and an error is encountered while generating a new key, the certificate enrollment control object will reuse the existing hardware key. If this property is false and an error is encountered while generating a new key, the certificate enrollment control object will not reuse the existing hardware key but will instead pass an error to the caller.

Examples

// Code to set the reuse H/W key status.
// hr is HRESULT variable.
hr = pEnroll->put_ReuseHardwareKeyIfUnableToGenNew( FALSE );
if ( FAILED( hr ) )    
    printf("Failed put_ReuseHardwareKeyIfUnableToGenNew [%x]\n", hr);


// Code to retrieve the reuse H/W key status.
BOOL bReuse;

hr = pEnroll->get_ReuseHardwareKeyIfUnableToGenNew( &bReuse );
if ( FAILED( hr ) )
    printf("Failed get_ReuseHardwareKeyIfUnableToGenNew [%x]\n", hr);
else
    printf("Hardware key %s be reused if unable"
        " to generate a new key.\n", bReuse ? "will" : "will not");

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header xenroll.h
Library Uuid.lib
DLL Xenroll.dll

See also

CEnroll

ICEnroll3

ICEnroll4