pub struct KeyPair {
    pub public_key: PublicKey,
    pub secret_key: SecretKey,
}Expand description
A public/secret key pair for a KEM protocol.
Fields§
§public_key: PublicKey§secret_key: SecretKeyImplementations§
Source§impl KeyPair
 
impl KeyPair
Sourcepub fn generate<R: Rng + CryptoRng>(key_type: KeyType, csprng: &mut R) -> Self
 
pub fn generate<R: Rng + CryptoRng>(key_type: KeyType, csprng: &mut R) -> Self
Creates a public-secret key pair for a specified KEM protocol.
pub fn new(public_key: PublicKey, secret_key: SecretKey) -> Self
Sourcepub fn from_public_and_private(
    public_key: &[u8],
    secret_key: &[u8],
) -> Result<Self>
 
pub fn from_public_and_private( public_key: &[u8], secret_key: &[u8], ) -> Result<Self>
Deserialize public and secret keys that were serialized by PublicKey::serialize()
and SecretKey::serialize() respectively.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyPair
impl RefUnwindSafe for KeyPair
impl Send for KeyPair
impl Sync for KeyPair
impl Unpin for KeyPair
impl UnwindSafe for KeyPair
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
Source§impl<T> CloneToUninit for Twhere
    T: Clone,
 
impl<T> CloneToUninit for Twhere
    T: Clone,
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more