Struct libp2p_core::signed_envelope::SignedEnvelope[][src]

pub struct SignedEnvelope { /* fields omitted */ }
Expand description

A signed envelope contains an arbitrary byte string payload, a signature of the payload, and the public key that can be used to verify the signature.

For more details see libp2p RFC0002: https://github.com/libp2p/specs/blob/master/RFC/0002-signed-envelopes.md

Implementations

Constructs a new SignedEnvelope.

Verify this SignedEnvelope against the provided domain-separation string.

Extract the payload of this SignedEnvelope.

You must provide the correct domain-separation string and expected payload type in order to get the payload. This guards against accidental mis-use of the payload where the signature was created for a different purpose or payload type.

Encode this SignedEnvelope using the protobuf encoding specified in the RFC.

Decode a SignedEnvelope using the protobuf encoding specified in the RFC.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.