[][src]Struct libp2p::noise::Keypair

pub struct Keypair<T> { /* fields omitted */ }

ECC secret and public key.

Methods

impl<T> Keypair<T>[src]

pub fn new(s: SecretKey, p: PublicKey<T>) -> Keypair<T>[src]

Create a new keypair.

pub fn secret(&self) -> &SecretKey[src]

Access this keypair's secret key.

pub fn public(&self) -> &PublicKey<T>[src]

Access this keypair's public key.

impl Keypair<Curve25519>[src]

pub fn gen_curve25519() -> Keypair<Curve25519>[src]

Create a fresh Curve25519 keypair.

impl Keypair<Ed25519>[src]

pub fn gen_ed25519() -> Keypair<Ed25519>[src]

Create a fresh Ed25519 keypair.

Trait Implementations

impl<T> Clone for Keypair<T> where
    T: Clone
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Into<(SecretKey, PublicKey<T>)> for Keypair<T>[src]

Auto Trait Implementations

impl<T> Send for Keypair<T> where
    T: Send

impl<T> Sync for Keypair<T> where
    T: Sync

Blanket Implementations

impl<T> From for T[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

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

type Error = !

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

The type returned in the event of a conversion error.

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

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

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

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

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

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

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.