ICEnroll4::WriteCertToCSP property

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

The WriteCertToCSP property sets or retrieves a Boolean value that determines whether a certificate should be written to the cryptographic service provider (CSP).

This property was first defined by the ICEnroll interface.

This property is read/write.

Syntax


HRESULT put_WriteCertToCSP(
  [in]   BOOL bValue
);

HRESULT get_WriteCertToCSP(
  [out]  BOOL *pbValue
);

Property value

If true, the certificate should be written to the CSP.

Error codes

If the property access methods put_WriteCertToCSP and get_WriteCertToCSP succeed, they return S_OK.

Any other HRESULT value indicates that the call failed.

Remarks

This property is typically used with smart cards, where the certificate is written to the smart card in addition to being written to the "MY" store.

The default value is true, which means that the Certificate Enrollment Control will try to write the certificate to the CSP but will not fail unless a hardware token error is encountered. If this value is true, but no smart card or other hardware-dependent CSP is installed, then hardware token errors will be ignored.

To explicitly force that the Certificate Enrollment Control not attempt to write to the CSP, set this value to false.

WriteCertToCSP affects the behavior of the following methods:

Examples


BOOL     bWriteCSP;
HRESULT  hr;

// pEnroll is previously instantiated ICEnroll interface pointer

// get the WriteCertToCSP value
hr = pEnroll->get_WriteCertToCSP( &bWriteCSP );
if (FAILED( hr ))
    printf("Failed get_WriteCertToCSP - %x\n", hr );
else
    printf( "WriteCertToCSP: %d\n", bWriteCSP );

// set the WriteCertToCSP value
hr = pEnroll->put_WriteCertToCSP( TRUE );
if (FAILED( hr ))
    printf("Failed put_WriteCertToCSP - %x\n", hr );
else
    printf( "WriteCertToCSP set to TRUE\n" );

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

 

 

Community Additions

ADD
Show:
© 2014 Microsoft