pub struct Certificate {
pub domains: Vec<String>,
pub pem: Vec<u8>,
pub key: Vec<u8>,
pub acme: Option<String>,
pub not_after: i64,
pub not_before: i64,
pub issuer: String,
}Expand description
Represents a X.509 certificate with associated metadata
Fields§
§domains: Vec<String>List of domain names and ip addresses that this certificate is valid for
pem: Vec<u8>PEM-encoded certificate data as bytes
key: Vec<u8>PEM-encoded private key data as bytes
acme: Option<String>Optional ACME (Automated Certificate Management Environment) identifier
not_after: i64Unix timestamp when the certificate expires
not_before: i64Unix timestamp when the certificate becomes valid
issuer: StringDistinguished Name (DN) of the certificate issuer
Implementations§
Source§impl Certificate
impl Certificate
Sourcepub fn get_issuer_common_name(&self) -> String
pub fn get_issuer_common_name(&self) -> String
Extracts the Common Name (CN) from the certificate issuer field
§Returns
String- The issuer’s Common Name or empty string if not found
Sourcepub fn valid(&self, buffer_days: u16) -> bool
pub fn valid(&self, buffer_days: u16) -> bool
Checks if the certificate is valid and not expiring within 48 hours
§Returns
bool- True if the certificate is valid, false otherwise
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 Default for Certificate
impl Default for Certificate
Source§fn default() -> Certificate
fn default() -> Certificate
Returns the “default value” for a type. Read more
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 UnsafeUnpin 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> 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<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request