Struct hpke_rs::HpkeKeyPair
source · 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 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