Struct libp2p::noise::X25519Spec
source · [−]pub struct X25519Spec(_);
Expand description
A X25519 key.
Trait Implementations
sourceimpl Clone for X25519Spec
impl Clone for X25519Spec
sourcepub fn clone(&self) -> X25519Spec
pub fn clone(&self) -> X25519Spec
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Protocol<X25519Spec> for X25519Spec
impl Protocol<X25519Spec> for X25519Spec
Noise protocols for X25519 with libp2p-spec compliant signatures.
Note: Only the XX handshake pattern is currently guaranteed to be interoperable with other libp2p implementations.
sourcepub fn params_ik() -> ProtocolParams
pub fn params_ik() -> ProtocolParams
The protocol parameters for the IK handshake pattern.
sourcepub fn params_ix() -> ProtocolParams
pub fn params_ix() -> ProtocolParams
The protocol parameters for the IX handshake pattern.
sourcepub fn params_xx() -> ProtocolParams
pub fn params_xx() -> ProtocolParams
The protocol parameters for the XX handshake pattern.
sourcepub fn public_from_bytes(
bytes: &[u8]
) -> Result<PublicKey<X25519Spec>, NoiseError>
pub fn public_from_bytes(
bytes: &[u8]
) -> Result<PublicKey<X25519Spec>, NoiseError>
Construct a DH public key from a byte slice.
sourcepub fn verify(
id_pk: &PublicKey,
dh_pk: &PublicKey<X25519Spec>,
sig: &Option<Vec<u8, Global>>
) -> bool
pub fn verify(
id_pk: &PublicKey,
dh_pk: &PublicKey<X25519Spec>,
sig: &Option<Vec<u8, Global>>
) -> bool
Verifies that a given static DH public key is authentic w.r.t. a given public identity key in the context of an optional signature. Read more
pub fn sign(
id_keys: &Keypair,
dh_pk: &PublicKey<X25519Spec>
) -> Result<Vec<u8, Global>, NoiseError>
sourcefn linked(id_pk: &PublicKey, dh_pk: &PublicKey<C>) -> bool
fn linked(id_pk: &PublicKey, dh_pk: &PublicKey<C>) -> bool
Determines whether the authenticity of the given DH static public key and public identity key is linked, i.e. that proof of ownership of a secret key for the static DH public key implies that the key is authentic w.r.t. the given public identity key. Read more
Auto Trait Implementations
impl RefUnwindSafe for X25519Spec
impl Send for X25519Spec
impl Sync for X25519Spec
impl Unpin for X25519Spec
impl UnwindSafe for X25519Spec
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToHex for T where
T: AsRef<[u8]>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
sourcepub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Lower case
letters are used (e.g. f9b4ca
) Read more
sourcepub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
Encode the hex strict representing self
into the result. Upper case
letters are used (e.g. F9B4CA
) Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more