pub struct PrivateKey(/* private fields */);Expand description
An RSA private key.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn from_der_rsa_private_key(der: &[u8]) -> Option<Self>
pub fn from_der_rsa_private_key(der: &[u8]) -> Option<Self>
Parse a DER-encoded RSAPrivateKey structure (from RFC 8017).
Sourcepub fn to_der_rsa_private_key(&self) -> Buffer
pub fn to_der_rsa_private_key(&self) -> Buffer
Serialize to a DER-encoded RSAPrivateKey structure (from RFC 8017).
Sourcepub fn from_der_private_key_info(der: &[u8]) -> Option<Self>
pub fn from_der_private_key_info(der: &[u8]) -> Option<Self>
Parse a DER-encrypted PrivateKeyInfo struct (from RFC 5208). This is often called “PKCS#8 format”.
Sourcepub fn to_der_private_key_info(&self) -> Buffer
pub fn to_der_private_key_info(&self) -> Buffer
Serialize to a DER-encrypted PrivateKeyInfo struct (from RFC 5208). This is often called “PKCS#8 format”.
Sourcepub fn sign_pkcs1<Hash: Algorithm>(&self, to_be_signed: &[u8]) -> Vec<u8>
pub fn sign_pkcs1<Hash: Algorithm>(&self, to_be_signed: &[u8]) -> Vec<u8>
Compute the signature of the digest of to_be_signed with PKCS#1 using
this private key. The specified hash function is used to compute the
Trait Implementations§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§impl Drop for PrivateKey
impl Drop for PrivateKey
impl Send for PrivateKey
impl Sync for PrivateKey
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Unpin for PrivateKey
impl UnsafeUnpin for PrivateKey
impl UnwindSafe for PrivateKey
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