Interface
ICertificateProvider5

Extension interface for certificate provider implementation, adding methods to read and write the root certificate to a file To override default certificate handling, your class should implement this interface.

Definition

Methods

ClearCertificateCache(bool, out CertificateStoreOperationStatus)

When this method is called, your extension should discard all certificates and clear any certificates that have been added to the user's certificate store

Declaration

cs-api-definition
bool ClearCertificateCache(bool bClearRoot, out CertificateStoreOperationStatus status)

Parameters

bClearRoot

bool

TRUE if the root certificate should also be cleared

status

CertificateStoreOperationStatus

Provides details in case operation is not successful

Returns

bool

TRUE, if all certificates were removed; FALSE if any certificates were preserved

ReadRootCertificateAndPrivateKeyFromPkcs12File(string, string, string)

When this method is called, your extension should read the root certificate and its private key from the PKCS#12 file(.pfx | .p12).

Declaration

cs-api-definition
void ReadRootCertificateAndPrivateKeyFromPkcs12File(string filename, string password, string alias = null)

Parameters

filename

string

The filename of the PKCS#12 file (.pfx | .p12).

password

string

The password which is used to protect the private key. Could be null or empty if the private key is not protected.

alias

string

The alias for the certificate and the private key. Could be null.

ReadRootCertificateAndPrivateKeyFromStream(Stream, string, string)

When this method is called, your extension should read the root certificate and its private key from a stream.

Declaration

cs-api-definition
void ReadRootCertificateAndPrivateKeyFromStream(Stream stream, string password, string alias = null)

Parameters

stream

Stream

The stream.

password

string

The password which is used to protect the private key. Could be null or empty if the private key is not protected.

alias

string

The alias for the certificate and the private key. Could be null.

WriteRootCertificateAndPrivateKeyToPkcs12File(string, string, string)

When this method is called, your extension should write the root certificate and its private key to a PKCS#12 file(.pfx | .p12).

Declaration

cs-api-definition
void WriteRootCertificateAndPrivateKeyToPkcs12File(string filename, string password, string alias = null)

Parameters

filename

string

The filename of the PKCS#12 file (.pfx | .p12).

password

string

The password which is used to protect the private key. If null or empty, the private key is written unprotected.

alias

string

The alias for the certificate and the private key. If null, a random alias could be created.

WriteRootCertificateAndPrivateKeyToStream(Stream, string, string)

When this method is called, your extension should write the root certificate and its private key to a stream.

Declaration

cs-api-definition
void WriteRootCertificateAndPrivateKeyToStream(Stream stream, string password, string alias = null)

Parameters

stream

Stream

The stream.

password

string

The password protecting the private key. If null or empty, the private key is written unprotected.

alias

string

The alias for the certificate and the private key. If null, a random alias could be created.

WriteRootCertificateToDerEncodedFile(string)

When this method is called, your extension should write the root certificate without the private key to a DER encoded file(.cer | .crt | .der).

Declaration

cs-api-definition
void WriteRootCertificateToDerEncodedFile(string filename)

Parameters

filename

string

The filename of the DER encoded file (.cer | .crt | .der)

WriteRootCertificateToStream(Stream)

When this method is called, your extension should write the root certificate without the private key to a stream.

Declaration

cs-api-definition
void WriteRootCertificateToStream(Stream stream)

Parameters

stream

Stream

The stream.