pub struct Certificate {
pub domain: String,
pub cert_path: PathBuf,
pub key_path: PathBuf,
pub issued_at: DateTime<Utc>,
pub expires_at: DateTime<Utc>,
pub issuer: String,
pub san_domains: Vec<String>,
pub auto_renew: bool,
pub last_renewal_check: Option<DateTime<Utc>>,
}Fields§
§domain: String§cert_path: PathBuf§key_path: PathBuf§issued_at: DateTime<Utc>§expires_at: DateTime<Utc>§issuer: String§san_domains: Vec<String>§auto_renew: bool§last_renewal_check: Option<DateTime<Utc>>Implementations§
Source§impl Certificate
impl Certificate
pub async fn from_files( domain: String, cert_path: PathBuf, key_path: PathBuf, auto_renew: bool, ) -> Result<Self, Box<dyn Error>>
pub async fn save_certificate( &self, cert_pem: &str, key_pem: &str, ) -> Result<(), Box<dyn Error>>
pub fn days_until_expiry(&self) -> i64
pub fn needs_renewal(&self, days_before_expiry: i64) -> bool
pub fn is_expired(&self) -> bool
pub fn covers_domain(&self, domain: &str) -> bool
pub async fn validate_certificate_files(&self) -> Result<bool, Box<dyn Error>>
pub async fn get_rustls_config(&self) -> Result<ServerConfig, Box<dyn Error>>
Trait Implementations§
Source§impl Clone for Certificate
impl Clone for Certificate
Source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Certificate
impl Debug for Certificate
Source§impl<'de> Deserialize<'de> for Certificate
impl<'de> Deserialize<'de> for Certificate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more