pub trait ResolveCertificate {
    type Error;

    // Required methods
    fn get_certificate(
        &self,
        fingerprint: &Fingerprint
    ) -> Option<CertifiedKeyWrapper>;
    fn add_certificate(
        &mut self,
        opts: &AddCertificate
    ) -> Result<Fingerprint, Self::Error>;
    fn remove_certificate(
        &mut self,
        opts: &Fingerprint
    ) -> Result<(), Self::Error>;

    // Provided method
    fn replace_certificate(
        &mut self,
        opts: &ReplaceCertificate
    ) -> Result<Fingerprint, Self::Error> { ... }
}

Required Associated Types§

Required Methods§

source

fn get_certificate( &self, fingerprint: &Fingerprint ) -> Option<CertifiedKeyWrapper>

return the certificate in both a Rustls-usable form, and the pem format

source

fn add_certificate( &mut self, opts: &AddCertificate ) -> Result<Fingerprint, Self::Error>

persist a certificate, after ensuring validity, and checking if it can replace another certificate

source

fn remove_certificate(&mut self, opts: &Fingerprint) -> Result<(), Self::Error>

Delete a certificate from the resolver. May fail if there is no alternative for

Provided Methods§

source

fn replace_certificate( &mut self, opts: &ReplaceCertificate ) -> Result<Fingerprint, Self::Error>

Short-hand for add_certificate and then remove_certificate. It is possible that the certificate will not be replaced, if the new certificate does not match add_certificate rules.

Implementors§