pub struct PrivateKey { /* private fields */ }Expand description
A recipient’s KEM key pair: the ML-KEM-1024 decapsulation key and, in pq_hybrid, a P-384 scalar, with the key as carried that others seal to.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn generate(profile: Profile) -> Result<PrivateKey, SealError>
pub fn generate(profile: Profile) -> Result<PrivateKey, SealError>
A fresh recipient key in profile.
Sourcepub fn from_parts(
profile: Profile,
mlkem_dk: &[u8],
carried: &[u8],
p384_scalar: Option<&[u8]>,
) -> Result<PrivateKey, SealError>
pub fn from_parts( profile: Profile, mlkem_dk: &[u8], carried: &[u8], p384_scalar: Option<&[u8]>, ) -> Result<PrivateKey, SealError>
A recipient key from its parts: the expanded ML-KEM-1024 decapsulation key (3168 bytes), the key as carried that it answers to, and in pq_hybrid only its 48-byte P-384 scalar.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
The recipient key others seal to.
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