[][src]Struct rc_crypto::agreement::KeyPair

pub struct KeyPair<U: Lifetime> {
    private_key: PrivateKey<U>,
    public_key: PublicKey,
}

A key pair for key agreement.

Fields

private_key: PrivateKey<U>public_key: PublicKey

Implementations

impl<U: Lifetime> KeyPair<U>[src]

pub fn generate(alg: &'static Algorithm) -> Result<Self>[src]

Generate a new key pair for the given algorithm.

pub fn from_private_key(private_key: PrivateKey<U>) -> Result<Self>[src]

pub fn private_key(&self) -> &PrivateKey<U>[src]

The private key.

pub fn public_key(&self) -> &PublicKey[src]

The public key.

pub fn split(self) -> (PrivateKey<U>, PublicKey)[src]

Split the key pair apart.

impl KeyPair<Static>[src]

pub fn from(private_key: PrivateKey<Static>) -> Result<Self>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.