Struct jws::compact::Message

source ·
pub struct Message {
    pub header: HeaderMap,
    pub payload: Vec<u8>,
}
Expand description

A compact JWS message with header and payload, but without signature.

The signature is left off because the signature can only be computed from (and verified for) a serialized message, whereas this struct represents a mostly decoded message (the payload is still raw bytes).

You can call decode_and_verify to decode and verify a message. Alternatively, you can call split_encoded_parts, decode the parts and then use a Verifier manually. The latter allows you to access the decoded message, even if it’s signature is invalid.

Fields

header: HeaderMappayload: Vec<u8>

Implementations

Create a new Message by decoding the individual parts of a JWS Compact Serialization message.

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.

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.