pub enum RsaPrivKeyAnyBits {
B2048(RsaPrivKey<B2048>),
B3072(RsaPrivKey<B3072>),
B4096(RsaPrivKey<B4096>),
B6144(RsaPrivKey<B6144>),
B8192(RsaPrivKey<B8192>),
}
Expand description
An RSA private key whose bit length is unknown at compile time.
An RsaPrivKeyAnyBits
is an enum of RsaPrivKey
s over all supported bit
lengths. It is returned from RsaPrivKeyAnyBits::parse_from_der
.
Variants§
B2048(RsaPrivKey<B2048>)
B3072(RsaPrivKey<B3072>)
B4096(RsaPrivKey<B4096>)
B6144(RsaPrivKey<B6144>)
B8192(RsaPrivKey<B8192>)
Implementations§
Source§impl RsaPrivKeyAnyBits
impl RsaPrivKeyAnyBits
Sourcepub fn public(&self) -> RsaPubKeyAnyBits
pub fn public(&self) -> RsaPubKeyAnyBits
Gets the public key corresponding to this private key.
Sourcepub fn parse_from_der(bytes: &[u8]) -> Result<RsaPrivKeyAnyBits, Error>
pub fn parse_from_der(bytes: &[u8]) -> Result<RsaPrivKeyAnyBits, Error>
Parses a private key in DER format with any bit length.
parse_from_der
is like DerPrivateKey::parse_from_der
, but it
accepts any bit length rather that a particular bit length.
Since RsaPrivKey
requires a static RsaKeyBits
type parameter,
the parse_from_der
function on RsaPrivKey
’s DerPrivateKey
implementation can only be called when the bit length is known ahead of
time. This function, on the other hand, accepts any bit length.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RsaPrivKeyAnyBits
impl RefUnwindSafe for RsaPrivKeyAnyBits
impl !Send for RsaPrivKeyAnyBits
impl !Sync for RsaPrivKeyAnyBits
impl Unpin for RsaPrivKeyAnyBits
impl UnwindSafe for RsaPrivKeyAnyBits
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