pub struct RsaCertificate { /* private fields */ }Expand description
A Certificate together with the RSA key material needed to sign and
verify with it. The private key is only present if it was loaded, e.g.
via RsaCertificate::from_safebag or RsaCertificate::with_private.
Implementations§
Source§impl RsaCertificate
impl RsaCertificate
Sourcepub fn new(cert: Certificate) -> Option<Self>
pub fn new(cert: Certificate) -> Option<Self>
Wraps cert as an RsaCertificate with no private key, by
extracting its public key from the certificate’s content.
Returns None if the certificate’s content isn’t a valid RSA
public key.
Sourcepub fn with_private(
cert: Certificate,
private_key: RsaPrivateKey,
) -> Option<Self>
pub fn with_private( cert: Certificate, private_key: RsaPrivateKey, ) -> Option<Self>
Wraps cert as an RsaCertificate, together with its matching
private key.
Returns None if the certificate’s content isn’t a valid RSA
public key.
Sourcepub fn from_safebag<P>(bag: SafeBag, password: P) -> Option<Self>
pub fn from_safebag<P>(bag: SafeBag, password: P) -> Option<Self>
Decrypts the private key in bag with password and pairs it with
the certificate it came with.
Returns None if the password is wrong or the key/certificate data
is malformed.
Sourcepub fn public_key(&self) -> &RsaPublicKey
pub fn public_key(&self) -> &RsaPublicKey
The RSA public key.
Sourcepub fn private_key(&self) -> Option<&RsaPrivateKey>
pub fn private_key(&self) -> Option<&RsaPrivateKey>
The RSA private key, if one was loaded.
Trait Implementations§
Source§impl Clone for RsaCertificate
impl Clone for RsaCertificate
Source§fn clone(&self) -> RsaCertificate
fn clone(&self) -> RsaCertificate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RsaCertificate
impl Debug for RsaCertificate
Source§impl Hash for RsaCertificate
impl Hash for RsaCertificate
Source§impl ToCertificate for RsaCertificate
impl ToCertificate for RsaCertificate
Source§fn to_certificate(&self) -> Certificate
fn to_certificate(&self) -> Certificate
Auto Trait Implementations§
impl !Freeze for RsaCertificate
impl RefUnwindSafe for RsaCertificate
impl Send for RsaCertificate
impl Sync for RsaCertificate
impl Unpin for RsaCertificate
impl UnsafeUnpin for RsaCertificate
impl UnwindSafe for RsaCertificate
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
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more