[][src]Struct jsonwebtoken::Header

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>,
}

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.

Methods

impl Header[src]

pub fn new(algorithm: Algorithm) -> Header[src]

Returns a JWT header with the algorithm given

Trait Implementations

impl PartialEq<Header> for Header[src]

impl Default for Header[src]

fn default() -> Self[src]

Returns a JWT header using the default Algorithm, HS256

impl Clone for Header[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Header[src]

impl Serialize for Header[src]

impl<'de> Deserialize<'de> for Header[src]

Auto Trait Implementations

impl Send for Header

impl Sync for Header

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]