Trait libp2p::noise::Protocol [−][src]
A Noise protocol over DH keys of type C
. The choice of C
determines the
protocol parameters for each handshake pattern.
Required methods
pub fn params_ik() -> ProtocolParams
[src]
The protocol parameters for the IK handshake pattern.
pub fn params_ix() -> ProtocolParams
[src]
The protocol parameters for the IX handshake pattern.
pub fn params_xx() -> ProtocolParams
[src]
The protocol parameters for the XX handshake pattern.
pub fn public_from_bytes(s: &[u8]) -> Result<PublicKey<C>, NoiseError>
[src]
Construct a DH public key from a byte slice.
Provided methods
pub fn linked(id_pk: &PublicKey, dh_pk: &PublicKey<C>) -> bool
[src]
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.
The trivial case is when the keys are byte for byte identical.
pub fn verify(
id_pk: &PublicKey,
dh_pk: &PublicKey<C>,
sig: &Option<Vec<u8, Global>>
) -> bool where
C: AsRef<[u8]>,
[src]
id_pk: &PublicKey,
dh_pk: &PublicKey<C>,
sig: &Option<Vec<u8, Global>>
) -> bool where
C: AsRef<[u8]>,
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.
The given static DH public key is assumed to already be authentic in the sense that possession of a corresponding secret key has been established, as is the case at the end of a Noise handshake involving static DH keys.
If the public keys are linked
, verification succeeds
without a signature, otherwise a signature over the static DH public key
must be given and is verified with the public identity key, establishing
the authenticity of the static DH public key w.r.t. the public identity key.
pub fn sign(
id_keys: &Keypair,
dh_pk: &PublicKey<C>
) -> Result<Vec<u8, Global>, NoiseError> where
C: AsRef<[u8]>,
[src]
id_keys: &Keypair,
dh_pk: &PublicKey<C>
) -> Result<Vec<u8, Global>, NoiseError> where
C: AsRef<[u8]>,
Implementors
impl Protocol<X25519> for X25519
[src]
Legacy Noise protocol for X25519.
Note: This Protocol
provides no configuration that
is interoperable with other libp2p implementations.
See crate::X25519Spec
instead.
pub fn params_ik() -> ProtocolParams
[src]
pub fn params_ix() -> ProtocolParams
[src]
pub fn params_xx() -> ProtocolParams
[src]
pub fn public_from_bytes(bytes: &[u8]) -> Result<PublicKey<X25519>, NoiseError>
[src]
pub fn linked(id_pk: &PublicKey, dh_pk: &PublicKey<X25519>) -> bool
[src]
impl Protocol<X25519Spec> for X25519Spec
[src]
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.
pub fn params_ik() -> ProtocolParams
[src]
pub fn params_ix() -> ProtocolParams
[src]
pub fn params_xx() -> ProtocolParams
[src]
pub fn public_from_bytes(
bytes: &[u8]
) -> Result<PublicKey<X25519Spec>, NoiseError>
[src]
bytes: &[u8]
) -> Result<PublicKey<X25519Spec>, NoiseError>
pub fn verify(
id_pk: &PublicKey,
dh_pk: &PublicKey<X25519Spec>,
sig: &Option<Vec<u8, Global>>
) -> bool
[src]
id_pk: &PublicKey,
dh_pk: &PublicKey<X25519Spec>,
sig: &Option<Vec<u8, Global>>
) -> bool
pub fn sign(
id_keys: &Keypair,
dh_pk: &PublicKey<X25519Spec>
) -> Result<Vec<u8, Global>, NoiseError>
[src]
id_keys: &Keypair,
dh_pk: &PublicKey<X25519Spec>
) -> Result<Vec<u8, Global>, NoiseError>