pub struct SignedEnvelope { /* private fields */ }
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 and signing key 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.

It is the caller’s responsibility to check that the signing key is what is expected. For example, checking that the signing key is from a certain peer.

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

Returns the argument unchanged.

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

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.