pub struct PrivateKey { /* private fields */ }Expand description
A sealed-box recipient’s P-384 private key.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn generate() -> Result<Self, CryptoError>
pub fn generate() -> Result<Self, CryptoError>
Generates a fresh key in the FIPS module.
Sourcepub fn from_pkcs8_der(der: &[u8]) -> Result<Self, CryptoError>
pub fn from_pkcs8_der(der: &[u8]) -> Result<Self, CryptoError>
Parses a P-384 PKCS#8 private key.
Sourcepub fn to_pkcs8_der(&self) -> Result<Zeroizing<Vec<u8>>, CryptoError>
pub fn to_pkcs8_der(&self) -> Result<Zeroizing<Vec<u8>>, CryptoError>
The key’s PKCS#8 DER, in a zeroizing buffer.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
The matching public key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrivateKey
impl RefUnwindSafe for PrivateKey
impl Send for PrivateKey
impl Sync 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