Struct fabruic::Certificate
source · pub struct Certificate(_);
Expand description
A public certificate. You can distribute it freely to peers.
Implementations§
source§impl Certificate
impl Certificate
sourcepub fn from_der<C: Into<Vec<u8>>>(certificate: C) -> Result<Self, Certificate>
pub fn from_der<C: Into<Vec<u8>>>(certificate: C) -> Result<Self, Certificate>
Build Certificate
from DER-format. This is not meant as a full
validation of a Certificate
, it just offers some sane protections.
Errors
CertificateError::WebPki
orCertificateError::X509
if the certificate couldn’t be parsedCertificateError::Dangling
if the certificate contained uncorrelated bytesCertificateError::Expired
if the certificate has expiresCertificateError::Domain
if the certificate doesn’t contain a domain name
sourcepub fn unchecked_from_der<C: Into<Vec<u8>>>(certificate: C) -> Self
pub fn unchecked_from_der<C: Into<Vec<u8>>>(certificate: C) -> Self
Build Certificate
from DER-format. This skips the validation from
from_der
, which isn’t unsafe
, but could fail
nonetheless when used on an Endpoint
.
sourcepub fn domains(&self) -> Vec<String> ⓘ
pub fn domains(&self) -> Vec<String> ⓘ
Panics
Panics if Certificate
couldn’t be parsed or contained no valid
domain names. This can’t happen if Certificate
is constructed
correctly from from_der
.
Trait Implementations§
source§impl AsRef<[u8]> for Certificate
impl AsRef<[u8]> for Certificate
source§impl Clone for Certificate
impl Clone for Certificate
source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a copy 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<'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
source§impl From<Certificate> for Vec<u8>
impl From<Certificate> for Vec<u8>
source§fn from(certificate: Certificate) -> Self
fn from(certificate: Certificate) -> Self
Converts to this type from the input type.
source§impl Hash for Certificate
impl Hash for Certificate
source§impl Ord for Certificate
impl Ord for Certificate
source§fn cmp(&self, other: &Certificate) -> Ordering
fn cmp(&self, other: &Certificate) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<Certificate> for Certificate
impl PartialEq<Certificate> for Certificate
source§fn eq(&self, other: &Certificate) -> bool
fn eq(&self, other: &Certificate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Certificate> for Certificate
impl PartialOrd<Certificate> for Certificate
source§fn partial_cmp(&self, other: &Certificate) -> Option<Ordering>
fn partial_cmp(&self, other: &Certificate) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Certificate
impl Serialize for Certificate
impl Eq for Certificate
impl StructuralEq for Certificate
impl StructuralPartialEq for Certificate
Auto Trait Implementations§
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.