Struct bonsaidb::client::fabruic::Certificate
pub struct Certificate(/* private fields */);
Expand description
A public certificate. You can distribute it freely to peers.
Implementations§
§impl Certificate
impl Certificate
pub fn from_der<C>(certificate: C) -> Result<Certificate, Certificate>
pub fn from_der<C>(certificate: C) -> Result<Certificate, 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
pub fn unchecked_from_der<C>(certificate: C) -> Certificate
pub fn unchecked_from_der<C>(certificate: C) -> Certificate
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
.
pub 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§
§impl AsRef<[u8]> for Certificate
impl AsRef<[u8]> for Certificate
§impl Clone for Certificate
impl Clone for Certificate
§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 more§impl Debug for Certificate
impl Debug for Certificate
§impl<'de> Deserialize<'de> for Certificate
impl<'de> Deserialize<'de> for Certificate
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Certificate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Certificate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<Certificate> for Vec<u8>
impl From<Certificate> for Vec<u8>
§impl Hash for Certificate
impl Hash for Certificate
§impl Ord for Certificate
impl Ord for Certificate
§impl PartialEq for Certificate
impl PartialEq for Certificate
§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 ==
.§impl PartialOrd for Certificate
impl PartialOrd for Certificate
§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 more§impl Serialize for Certificate
impl Serialize for Certificate
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl TryFrom<Vec<u8>> for Certificate
impl TryFrom<Vec<u8>> for Certificate
§type Error = Certificate
type Error = Certificate
The type returned in the event of a conversion error.
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§
§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
Mutably borrows from an owned value. Read more
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)