pub struct PeerCerts { /* private fields */ }Expand description
Leaf certificate and additional chain certificates presented by a TLS peer.
Built from PeerCertDer / PeerCertChainDer (moved out of the io query with
QueryItem::into_inner). Presence of a chain does not imply trust,
use crate::x509::trust::CaCerts::is_trusted.
Implementations§
Source§impl PeerCerts
impl PeerCerts
Sourcepub fn from_der(leaf: Bytes, chain: Vec<Bytes>) -> Result<PeerCerts, Error>
pub fn from_der(leaf: Bytes, chain: Vec<Bytes>) -> Result<PeerCerts, Error>
Parses the peer leaf certificate and chain, taking ownership of the buffers.
chain is expected leaf-first in the order sent by the peer. If its first element is
the leaf itself (ntex-tls OpenSSL server side) it is removed, so Self::chain
never contains the leaf.
§Errors
Error::InvalidDer if the leaf or any chain certificate cannot be parsed.
Sourcepub fn new(leaf: Certificate, chain: Vec<Certificate>) -> PeerCerts
pub fn new(leaf: Certificate, chain: Vec<Certificate>) -> PeerCerts
Creates peer certificates from already parsed certificates.
chain must not contain the leaf, leaf issuer first.
Sourcepub fn leaf(&self) -> &Certificate
pub fn leaf(&self) -> &Certificate
Peer (leaf) certificate.
Sourcepub fn chain(&self) -> &[Certificate]
pub fn chain(&self) -> &[Certificate]
Additional certificates sent by the peer, leaf excluded, leaf issuer first.
Trait Implementations§
impl Eq for PeerCerts
impl StructuralPartialEq for PeerCerts
Auto Trait Implementations§
impl Freeze for PeerCerts
impl RefUnwindSafe for PeerCerts
impl Send for PeerCerts
impl Sync for PeerCerts
impl Unpin for PeerCerts
impl UnsafeUnpin for PeerCerts
impl UnwindSafe for PeerCerts
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.