pub struct TlsCertificate {
pub der: Vec<u8>,
}Expand description
A TLS certificate wrapping raw DER-encoded X.509 data.
Fields§
§der: Vec<u8>Raw DER-encoded certificate data.
Implementations§
Source§impl TlsCertificate
impl TlsCertificate
Sourcepub fn subject_cn(&self) -> Option<String>
pub fn subject_cn(&self) -> Option<String>
Extract the subject common name (CN) from the certificate.
This is a basic ASN.1 parser that looks for the CN OID (2.5.4.3). In X.509, issuer comes before subject, so subject CN is the second occurrence. For self-signed certs (only one CN), falls back to the first occurrence.
Trait Implementations§
Source§impl Clone for TlsCertificate
impl Clone for TlsCertificate
Source§fn clone(&self) -> TlsCertificate
fn clone(&self) -> TlsCertificate
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 moreAuto Trait Implementations§
impl Freeze for TlsCertificate
impl RefUnwindSafe for TlsCertificate
impl Send for TlsCertificate
impl Sync for TlsCertificate
impl Unpin for TlsCertificate
impl UnsafeUnpin for TlsCertificate
impl UnwindSafe for TlsCertificate
Blanket Implementations§
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> 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>
Converts
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>
Converts
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