[][src]Struct rc_crypto::agreement::PrivateKey

pub struct PrivateKey<U: Lifetime> {
    wrapped: PrivateKey,
    alg: &'static Algorithm,
    usage: PhantomData<U>,
}

A private key for key agreement.

Fields

wrapped: PrivateKeyalg: &'static Algorithmusage: PhantomData<U>

Implementations

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

pub fn algorithm(&self) -> &'static Algorithm[src]

pub fn compute_public_key(&self) -> Result<PublicKey>[src]

pub fn agree(
    self,
    peer_public_key: &UnparsedPublicKey<'_>
) -> Result<InputKeyMaterial>
[src]

Ephemeral agreement. This consumes self, ensuring that the private key can only be used for a single agreement operation.

impl PrivateKey<Static>[src]

pub fn agree_static(
    &self,
    peer_public_key: &UnparsedPublicKey<'_>
) -> Result<InputKeyMaterial>
[src]

Static agreement. This borrows self, allowing the private key to be used for a multiple agreement operations.

pub fn import(ec_key: &EcKey) -> Result<Self>[src]

pub fn export(&self) -> Result<EcKey>[src]

pub fn _tests_only_dangerously_convert_to_ephemeral(
    self
) -> PrivateKey<Ephemeral>
[src]

The whole point of having Ephemeral and Static lifetimes is to use the type system to avoid re-using the same ephemeral key. However for tests we might need to create a "static" ephemeral key.

Auto Trait Implementations

impl<U> RefUnwindSafe for PrivateKey<U> where
    U: RefUnwindSafe

impl<U> Send for PrivateKey<U> where
    U: Send

impl<U> !Sync for PrivateKey<U>

impl<U> Unpin for PrivateKey<U> where
    U: Unpin

impl<U> UnwindSafe for PrivateKey<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.