pub struct CertificateStore { /* private fields */ }
Expand description

The certificate store manages the storage of a server/client’s own certificate & private key and the trust / rejection of certificates from the other end.

Implementations

Sets up the certificate store to the specified PKI directory. It is a bad idea to have more than one running instance pointing to the same path location on disk.

Reads a private key from a path on disk.

Reads the store’s own certificate and private key

Fetches the public certificate and private key into options

Create a certificate and key pair to the specified locations

This function will use the supplied arguments to create an Application Instance Certificate consisting of a X509v3 certificate and public/private key pair. The cert (including pubkey) and private key will be written to disk under the pki path.

Validates the cert as trusted and valid. If the cert is unknown, it will be written to the rejected folder so that the administrator can manually move it to the trusted folder.

Errors

A non Good status code indicates a failure in the cert or in some action required in order to validate it.

Validates the certificate according to the strictness set in the CertificateStore itself. Validation might include checking the issue time, expiration time, revocation, trust chain etc. In the first instance this function will only check if the cert is recognized and is already contained in the trusted or rejected folder.

Errors

A non Good status code indicates a failure in the cert or in some action required in order to validate it.

Returns a certificate file name from the cert’s issuer and thumbprint fields. File name is either “prefix - [thumbprint].der” or “thumbprint.der” depending on the cert’s common name being empty or not

Creates the PKI directory structure

Errors

A string description of any failure

Get path to application instance certificate

Get path to application instance private key

Get the path to the rejected certs dir

Get the path to the trusted certs dir

Write a cert to the rejected directory. If the write succeeds, the function returns a path to the written file.

Errors

A string description of any failure

Reads an X509 certificate in .def or .pem format from disk

Errors

A string description of any failure

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.