pub struct RsaKeypair {
pub public: RsaPublicKey,
pub private: RsaPrivateKey,
}
Available on crate feature
alloc
only.Expand description
RSA private/public keypair.
Fields§
§public: RsaPublicKey
Public key.
private: RsaPrivateKey
Private key.
Implementations§
source§impl RsaKeypair
impl RsaKeypair
sourcepub fn random(rng: &mut impl CryptoRngCore, bit_size: usize) -> Result<Self>
Available on crate feature rsa
only.
pub fn random(rng: &mut impl CryptoRngCore, bit_size: usize) -> Result<Self>
rsa
only.Generate a random RSA keypair of the given size.
Trait Implementations§
source§impl Clone for RsaKeypair
impl Clone for RsaKeypair
source§fn clone(&self) -> RsaKeypair
fn clone(&self) -> RsaKeypair
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 ConstantTimeEq for RsaKeypair
impl ConstantTimeEq for RsaKeypair
source§impl Debug for RsaKeypair
impl Debug for RsaKeypair
source§impl Decode for RsaKeypair
impl Decode for RsaKeypair
source§impl Encode for RsaKeypair
impl Encode for RsaKeypair
source§fn encoded_len(&self) -> Result<usize>
fn encoded_len(&self) -> Result<usize>
Get the length of this type encoded in bytes, prior to Base64 encoding.
source§fn encode(&self, writer: &mut impl Writer) -> Result<()>
fn encode(&self, writer: &mut impl Writer) -> Result<()>
Encode this value using the provided
Writer
.source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
Return the length of this type after encoding when prepended with a
uint32
length prefix.source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
Encode this value, first prepending a
uint32
length prefix
set to Encode::encoded_len
.source§impl From<&RsaKeypair> for RsaPublicKey
impl From<&RsaKeypair> for RsaPublicKey
source§fn from(keypair: &RsaKeypair) -> RsaPublicKey
fn from(keypair: &RsaKeypair) -> RsaPublicKey
Converts to this type from the input type.
source§impl From<RsaKeypair> for KeypairData
impl From<RsaKeypair> for KeypairData
source§fn from(keypair: RsaKeypair) -> KeypairData
fn from(keypair: RsaKeypair) -> KeypairData
Converts to this type from the input type.
source§impl From<RsaKeypair> for PrivateKey
impl From<RsaKeypair> for PrivateKey
source§fn from(keypair: RsaKeypair) -> PrivateKey
fn from(keypair: RsaKeypair) -> PrivateKey
Converts to this type from the input type.
source§impl From<RsaKeypair> for RsaPublicKey
impl From<RsaKeypair> for RsaPublicKey
source§fn from(keypair: RsaKeypair) -> RsaPublicKey
fn from(keypair: RsaKeypair) -> RsaPublicKey
Converts to this type from the input type.
source§impl PartialEq for RsaKeypair
impl PartialEq for RsaKeypair
source§impl Signer<Signature> for RsaKeypair
Available on crate feature rsa
only.
impl Signer<Signature> for RsaKeypair
Available on crate feature
rsa
only.source§impl TryFrom<&RsaKeypair> for RsaPrivateKey
Available on crate feature rsa
only.
impl TryFrom<&RsaKeypair> for RsaPrivateKey
Available on crate feature
rsa
only.source§fn try_from(key: &RsaKeypair) -> Result<RsaPrivateKey>
fn try_from(key: &RsaKeypair) -> Result<RsaPrivateKey>
Performs the conversion.
source§impl<D> TryFrom<&RsaKeypair> for SigningKey<D>where
D: Digest + AssociatedOid,
Available on crate feature rsa
only.
impl<D> TryFrom<&RsaKeypair> for SigningKey<D>where
D: Digest + AssociatedOid,
Available on crate feature
rsa
only.source§fn try_from(keypair: &RsaKeypair) -> Result<SigningKey<D>>
fn try_from(keypair: &RsaKeypair) -> Result<SigningKey<D>>
Performs the conversion.
source§impl TryFrom<&RsaPrivateKey> for RsaKeypair
Available on crate feature rsa
only.
impl TryFrom<&RsaPrivateKey> for RsaKeypair
Available on crate feature
rsa
only.source§fn try_from(key: &RsaPrivateKey) -> Result<RsaKeypair>
fn try_from(key: &RsaPrivateKey) -> Result<RsaKeypair>
Performs the conversion.
source§impl TryFrom<RsaKeypair> for RsaPrivateKey
Available on crate feature rsa
only.
impl TryFrom<RsaKeypair> for RsaPrivateKey
Available on crate feature
rsa
only.source§fn try_from(key: RsaKeypair) -> Result<RsaPrivateKey>
fn try_from(key: RsaKeypair) -> Result<RsaPrivateKey>
Performs the conversion.
source§impl TryFrom<RsaPrivateKey> for RsaKeypair
Available on crate feature rsa
only.
impl TryFrom<RsaPrivateKey> for RsaKeypair
Available on crate feature
rsa
only.source§fn try_from(key: RsaPrivateKey) -> Result<RsaKeypair>
fn try_from(key: RsaPrivateKey) -> Result<RsaKeypair>
Performs the conversion.
impl Eq for RsaKeypair
Auto Trait Implementations§
impl Freeze for RsaKeypair
impl RefUnwindSafe for RsaKeypair
impl Send for RsaKeypair
impl Sync for RsaKeypair
impl Unpin for RsaKeypair
impl UnwindSafe for RsaKeypair
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)