pub trait AcmeCache {
type Error: CacheError;
// Required methods
fn read_key(
&self,
directory_name: &str,
domains: &[String]
) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send;
fn write_key(
&self,
directory_name: &str,
domains: &[String],
data: &[u8]
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn read_cert(
&self,
directory_name: &str,
domains: &[String]
) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send;
fn write_cert(
&self,
directory_name: &str,
domains: &[String],
data: &[u8]
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}
Available on crate feature
acme
only.Expand description
Trait to define a custom location/mechanism to cache account data and certificates.
Required Associated Types§
sourcetype Error: CacheError
type Error: CacheError
The error type returned from the functions on this trait.
Required Methods§
sourcefn read_key(
&self,
directory_name: &str,
domains: &[String]
) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send
fn read_key( &self, directory_name: &str, domains: &[String] ) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send
Returns the previously written private key retrieved from Acme
. The parameters are:
§Parameters
directory_name
: the name of theAcme
directory that this private key.domains
: the list of domains included in the private key was issued form.
§Errors
Returns an error when the private key was unable to be written successfully.
sourcefn write_key(
&self,
directory_name: &str,
domains: &[String],
data: &[u8]
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn write_key( &self, directory_name: &str, domains: &[String], data: &[u8] ) -> impl Future<Output = Result<(), Self::Error>> + Send
Writes a certificate retrieved from Acme
. The parameters are:
§Parameters
directory_name
: the name of theAcme
directory that this private key.domains
: the list of domains included in the private key was issued form.data
: the private key, encoded in PEM format.
§Errors
Returns an error when the certificate was unable to be written successfully.
sourcefn read_cert(
&self,
directory_name: &str,
domains: &[String]
) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send
fn read_cert( &self, directory_name: &str, domains: &[String] ) -> impl Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send
Returns the previously written certificate retrieved from Acme
. The parameters are:
§Parameters
directory_name
: the name of theAcme
directory that this certificatedomains
: the list of domains included in the certificate was issued form.
§Errors
Returns an error when the certificate was unable to be written successfully.
sourcefn write_cert(
&self,
directory_name: &str,
domains: &[String],
data: &[u8]
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn write_cert( &self, directory_name: &str, domains: &[String], data: &[u8] ) -> impl Future<Output = Result<(), Self::Error>> + Send
Writes a certificate retrieved from Acme
. The parameters are:
§Parameters
directory_name
: the name of theAcme
directory that this certificatedomains
: the list of domains included in the certificate was issued form.data
: the private key, encoded in PEM format.
§Errors
Returns an error when the certificate was unable to be written successfully.
Object Safety§
This trait is not object safe.