Struct fabruic::KeyPair [−][src]
pub struct KeyPair { /* fields omitted */ }
Expand description
A key-pair, consisting of a CertificateChain
and PrivateKey
.
Implementations
This is supported on crate feature rcgen
only.
rcgen
only.Generate a self signed certificate.
pub fn from_parts(
certificate_chain: CertificateChain,
private_key: PrivateKey
) -> Result<Self, KeyPair>
pub fn from_parts(
certificate_chain: CertificateChain,
private_key: PrivateKey
) -> Result<Self, KeyPair>
Builds a new KeyPair
from the given CertificateChain
and
PrivateKey
. Will validate if they pair up correctly.
This presumes that CertificateChain
and PrivateKey
are valid,
see CertificateChain::from_certificates
and
PrivateKey::from_der
.
Errors
TODO: this doesn’t do any validation yet
pub fn unchecked_from_parts(
certificate_chain: CertificateChain,
private_key: PrivateKey
) -> Self
pub fn unchecked_from_parts(
certificate_chain: CertificateChain,
private_key: PrivateKey
) -> Self
Build KeyPair
from the given CertificateChain
and
PrivateKey
. This skips the validation from
from_parts
, which isn’t unsafe
, but could fail
nonetheless when used on an Endpoint
.
Return the CertificateChain
of this KeyPair
.
Returns the end-entity Certificate
.
Panics
If the KeyPair
is invalid. This can’t happen if validated
through from_parts
.
Return the secret PrivateKey
of this KeyPair
.
Destructure KeyPair
into it’s owned parts.
Destructure KeyPair
into it’s borrowed parts.
Trait Implementations
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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn try_from(
(certificate_chain, private_key): (CertificateChain, PrivateKey)
) -> Result<Self, Self::Error>
fn try_from(
(certificate_chain, private_key): (CertificateChain, PrivateKey)
) -> Result<Self, Self::Error>
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for KeyPair
impl UnwindSafe for KeyPair
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more