pub struct Keypair<T: Zeroize> { /* private fields */ }
Expand description

DH keypair.

Implementations

Create a new X25519 keypair.

Creates an X25519 Keypair from an identity::Keypair, if possible.

The returned keypair will be associated with the given identity keypair.

Returns None if the given identity keypair cannot be used as an X25519 keypair.

Note: If the identity keypair is already used in the context of other cryptographic protocols outside of Noise, it should be preferred to create a new static X25519 keypair for use in the Noise protocol.

See also:

Create a new X25519 keypair.

The public key of the DH keypair.

The secret key of the DH keypair.

Turn this DH keypair into a AuthenticKeypair, i.e. a DH keypair that is authentic w.r.t. the given identity keypair, by signing the DH public key.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Promote a X25519 secret key into a keypair.

Performs the conversion.

Promote a X25519 secret key into a keypair.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.