pub struct KeyPair<U: Lifetime> { /* private fields */ }
Expand description
A key pair for key agreement.
Implementations§
Source§impl<U: Lifetime> KeyPair<U>
impl<U: Lifetime> KeyPair<U>
Sourcepub fn generate(alg: &'static Algorithm) -> Result<Self>
pub fn generate(alg: &'static Algorithm) -> Result<Self>
Generate a new key pair for the given algorithm.
pub fn from_private_key(private_key: PrivateKey<U>) -> Result<Self>
Sourcepub fn private_key(&self) -> &PrivateKey<U>
pub fn private_key(&self) -> &PrivateKey<U>
The private key.
Sourcepub fn public_key(&self) -> &PublicKey
pub fn public_key(&self) -> &PublicKey
The public key.
Sourcepub fn split(self) -> (PrivateKey<U>, PublicKey)
pub fn split(self) -> (PrivateKey<U>, PublicKey)
Split the key pair apart.
Auto Trait Implementations§
impl<U> Freeze for KeyPair<U>
impl<U> RefUnwindSafe for KeyPair<U>where
U: RefUnwindSafe,
impl<U> Send for KeyPair<U>where
U: Send,
impl<U> !Sync for KeyPair<U>
impl<U> Unpin for KeyPair<U>where
U: Unpin,
impl<U> UnwindSafe for KeyPair<U>where
U: UnwindSafe,
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