pub struct RegisteredClaims {
    pub issuer: Option<StringOrUri>,
    pub subject: Option<StringOrUri>,
    pub audience: Option<SingleOrMultiple<StringOrUri>>,
    pub expiry: Option<Timestamp>,
    pub not_before: Option<Timestamp>,
    pub issued_at: Option<Timestamp>,
    pub id: Option<String>,
}
Expand description

Registered claims defined by RFC7519#4.1

Fields

issuer: Option<StringOrUri>

Token issuer. Serialized to iss.

subject: Option<StringOrUri>

Subject where the JWT is referring to. Serialized to sub

audience: Option<SingleOrMultiple<StringOrUri>>

Audience intended for the JWT. Serialized to aud

expiry: Option<Timestamp>

Expiration time in seconds since Unix Epoch. Serialized to exp

not_before: Option<Timestamp>

Not before time in seconds since Unix Epoch. Serialized to nbf

issued_at: Option<Timestamp>

Issued at Time in seconds since Unix Epoch. Serialized to iat

id: Option<String>

Application specific JWT ID. Serialized to jti

Implementations

Validates that the token contains the claims defined as required

Validates that if the token has an exp claim, it has not passed.

Validates that if the token has an nbf claim, it has passed.

Validates that if the token has an iat claim, it is not in the future and not older than the Duration

Validates that if the token has an aud claim, it contains an entry which matches the expected audience

Validates that if the token has an iss claim, it matches the expected issuer

Performs full validation of the token according to the ValidationOptions supplied

First it validates that all claims marked as required are present Then it validates each claim marked to be validated if they are present in the token (even those that are not marked as required, but are present).

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 the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. 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
Compare self to key and return true if they are equal.

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.