pub struct HpkeKeyPair { /* private fields */ }Expand description
An HPKE key pair has an HPKE private and public key.
Implementations§
Source§impl HpkeKeyPair
impl HpkeKeyPair
Sourcepub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
pub fn new(sk: Vec<u8>, pk: Vec<u8>) -> Self
Create a new HPKE key pair. Consumes the private and public key bytes.
Sourcepub fn private_key(&self) -> &HpkePrivateKey
pub fn private_key(&self) -> &HpkePrivateKey
Get a reference to the HPKE private key of this key pair.
Sourcepub fn public_key(&self) -> &HpkePublicKey
pub fn public_key(&self) -> &HpkePublicKey
Get a reference to the HPKE public key of this key pair.
Sourcepub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
pub fn into_keys(self) -> (HpkePrivateKey, HpkePublicKey)
Split the key pair into the two keys
Sourcepub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
pub fn from_keys(private_key: HpkePrivateKey, public_key: HpkePublicKey) -> Self
Build a key pair from two keys
Trait Implementations§
Source§impl Debug for HpkeKeyPair
impl Debug for HpkeKeyPair
Source§impl Default for HpkeKeyPair
impl Default for HpkeKeyPair
Source§fn default() -> HpkeKeyPair
fn default() -> HpkeKeyPair
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HpkeKeyPair
impl RefUnwindSafe for HpkeKeyPair
impl Send for HpkeKeyPair
impl Sync for HpkeKeyPair
impl Unpin for HpkeKeyPair
impl UnwindSafe for HpkeKeyPair
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