Struct libp2p_noise::SecretKey

source ·
pub struct SecretKey<T: Zeroize>(_);
Expand description

DH secret key.

Implementations§

source§

impl SecretKey<X25519>

source

pub fn from_ed25519(ed25519_sk: &SecretKey) -> Self

Construct a X25519 secret key from a Ed25519 secret key.

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

See also:

Trait Implementations§

source§

impl<T: AsRef<[u8]> + Zeroize> AsRef<[u8]> for SecretKey<T>

source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: Clone + Zeroize> Clone for SecretKey<T>

source§

fn clone(&self) -> SecretKey<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Zeroize> Drop for SecretKey<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl From<SecretKey<X25519>> for Keypair<X25519>

Promote a X25519 secret key into a keypair.

source§

fn from(secret: SecretKey<X25519>) -> Keypair<X25519>

Converts to this type from the input type.
source§

impl From<SecretKey<X25519Spec>> for Keypair<X25519Spec>

Promote a X25519 secret key into a keypair.

source§

fn from(secret: SecretKey<X25519Spec>) -> Keypair<X25519Spec>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for SecretKey<T>where T: RefUnwindSafe,

§

impl<T> Send for SecretKey<T>where T: Send,

§

impl<T> Sync for SecretKey<T>where T: Sync,

§

impl<T> Unpin for SecretKey<T>where T: Unpin,

§

impl<T> UnwindSafe for SecretKey<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ProtocolName for Twhere T: AsRef<[u8]>,

source§

fn protocol_name(&self) -> &[u8]

The protocol name as bytes. Transmitted on the network. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V