pub struct Header {
    pub typ: Option<String>,
    pub alg: Algorithm,
    pub cty: Option<String>,
    pub jku: Option<String>,
    pub kid: Option<String>,
    pub x5u: Option<String>,
    pub x5t: Option<String>,
}
Expand description

A basic JWT header, the alg defaults to HS256 and typ is automatically set to JWT. All the other fields are optional.

Fields

typ: Option<String>

The type of JWS: it can only be “JWT” here

Defined in RFC7515#4.1.9.

alg: Algorithm

The algorithm used

Defined in RFC7515#4.1.1.

cty: Option<String>

Content type

Defined in RFC7519#5.2.

jku: Option<String>

JSON Key URL

Defined in RFC7515#4.1.2.

kid: Option<String>

Key ID

Defined in RFC7515#4.1.4.

x5u: Option<String>

X.509 URL

Defined in RFC7515#4.1.5.

x5t: Option<String>

X.509 certificate thumbprint

Defined in RFC7515#4.1.7.

Implementations

Returns a JWT header with the algorithm given

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

Returns a JWT header using the default Algorithm, HS256

Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given [Hasher]. Read more
Feeds a slice of this type into the given [Hasher]. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

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 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.