ICEnroll4::ReuseHardwareKeyIfUnableToGenNew property

[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(
  [in]   BOOL bValue
);

HRESULT get_ReuseHardwareKeyIfUnableToGenNew(
  [out]  BOOL *pbValue
);

Property value

If true, the certificate enrollment control object will reuse the existing hardware key if an error is encountered while generating a new key.

Error codes

If the property access methods put_ReuseHardwareKeyIfUnableToGenNew and get_ReuseHardwareKeyIfUnableToGenNew succeed, they return S_OK.

Any other HRESULT value indicates that the call failed.

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

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

See also

ICEnroll4
CEnroll
ICEnroll3

 

 

Community Additions

ADD
Show:
© 2014 Microsoft