Trait sozu_lib::tls::ResolveCertificate
source · 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§
sourcefn get_certificate(
&self,
fingerprint: &Fingerprint
) -> Option<CertifiedKeyWrapper>
fn get_certificate( &self, fingerprint: &Fingerprint ) -> Option<CertifiedKeyWrapper>
return the certificate in both a Rustls-usable form, and the pem format
sourcefn add_certificate(
&mut self,
opts: &AddCertificate
) -> Result<Fingerprint, Self::Error>
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
sourcefn remove_certificate(&mut self, opts: &Fingerprint) -> Result<(), Self::Error>
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§
sourcefn replace_certificate(
&mut self,
opts: &ReplaceCertificate
) -> Result<Fingerprint, Self::Error>
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.