Trait salvo_core::conn::acme::cache::AcmeCache

source ·
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§

source

type Error: CacheError

The error type returned from the functions on this trait.

Required Methods§

source

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 the Acme 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.

source

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 the Acme 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.

source

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 the Acme directory that this certificate
  • domains: the list of domains included in the certificate was issued form.
§Errors

Returns an error when the certificate was unable to be written successfully.

source

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 the Acme directory that this certificate
  • domains: 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.

Implementors§

source§

impl<P> AcmeCache for P
where P: AsRef<Path> + Send + Sync,

§

type Error = Error