#[non_exhaustive]pub enum Identity<'a> {
X509(CertificateIdentity<'a>),
RawPublicKey(SubjectPublicKeyInfoDer<'a>),
}
Expand description
A peer’s identity, depending on the negotiated certificate type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
X509(CertificateIdentity<'a>)
A standard X.509 certificate chain.
This is the most common case.
RawPublicKey(SubjectPublicKeyInfoDer<'a>)
A raw public key, as defined in RFC 7250.
Implementations§
Source§impl<'a> Identity<'a>
impl<'a> Identity<'a>
Sourcepub fn from_cert_chain(
cert_chain: Vec<CertificateDer<'a>>,
) -> Result<Self, ApiMisuse>
pub fn from_cert_chain( cert_chain: Vec<CertificateDer<'a>>, ) -> Result<Self, ApiMisuse>
Create a PeerIdentity::X509
from a certificate chain.
Returns None
if cert_chain
is empty.
Sourcepub fn into_owned(self) -> Identity<'static>
pub fn into_owned(self) -> Identity<'static>
Convert this PeerIdentity
into an owned version.
Sourcepub fn as_signer(&self) -> SignerPublicKey<'_>
pub fn as_signer(&self) -> SignerPublicKey<'_>
Get the public key of this identity as a SignerPublicKey
.
Trait Implementations§
impl<'a> Eq for Identity<'a>
impl<'a> StructuralPartialEq for Identity<'a>
Auto Trait Implementations§
impl<'a> Freeze for Identity<'a>
impl<'a> RefUnwindSafe for Identity<'a>
impl<'a> Send for Identity<'a>
impl<'a> Sync for Identity<'a>
impl<'a> Unpin for Identity<'a>
impl<'a> UnwindSafe for Identity<'a>
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