pub struct CertificateData {
pub certificate_chain_pem: String,
pub private_key_pem: Zeroizing<String>,
}Expand description
PEM-encoded certificate chain and private key.
This is the interchange format between ACME provisioning, storage, and TLS configuration. Both fields are PEM strings.
The private key PEM is wrapped in Zeroizing so that the backing
allocation is zeroed on drop, preventing key material from lingering
in freed memory (defense-in-depth against core dumps, swap recovery,
and cold-boot attacks). See issue #82.
Fields§
§certificate_chain_pem: StringPEM-encoded certificate chain (leaf + intermediates).
private_key_pem: Zeroizing<String>PEM-encoded private key. Wrapped in Zeroizing so the backing
buffer is zeroed on drop.
Implementations§
Source§impl CertificateData
impl CertificateData
Sourcepub fn certificate_chain_der(
&self,
) -> Result<Vec<CertificateDer<'static>>, TlsError>
pub fn certificate_chain_der( &self, ) -> Result<Vec<CertificateDer<'static>>, TlsError>
Parse the PEM certificate chain into DER-encoded certificates.
§Errors
Returns TlsError::Certificate if the PEM data cannot be parsed.
Sourcepub fn private_key_der(&self) -> Result<PrivateKeyDer<'static>, TlsError>
pub fn private_key_der(&self) -> Result<PrivateKeyDer<'static>, TlsError>
Parse the PEM private key into a DER-encoded private key.
§Errors
Returns TlsError::Certificate if the PEM data cannot be parsed.
Sourcepub fn expiry_timestamp(&self) -> Result<i64, TlsError>
pub fn expiry_timestamp(&self) -> Result<i64, TlsError>
Extract the certificate expiry timestamp (notAfter) from the leaf certificate.
Returns seconds since Unix epoch.
§Errors
Returns TlsError::Certificate if the certificate cannot be parsed.
Sourcepub fn needs_renewal(&self) -> Result<bool, TlsError>
pub fn needs_renewal(&self) -> Result<bool, TlsError>
Check whether the certificate needs renewal (within 30 days of expiry).
§Errors
Returns TlsError::Certificate if the expiry cannot be determined.
Trait Implementations§
Source§impl Clone for CertificateData
impl Clone for CertificateData
Source§fn clone(&self) -> CertificateData
fn clone(&self) -> CertificateData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CertificateData
impl RefUnwindSafe for CertificateData
impl Send for CertificateData
impl Sync for CertificateData
impl Unpin for CertificateData
impl UnsafeUnpin for CertificateData
impl UnwindSafe for CertificateData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more