Struct jwt::Token [] [src]

pub struct Token {
    pub header: Header,
    pub claims: Claims,
    // some fields omitted
}

Fields

header: Header claims: Claims

Methods

impl Token
[src]

fn new(header: Header, claims: Claims) -> Token

fn parse(raw: &str) -> Result<TokenError>

Parse a token from a string.

fn verify<D: Digest>(&self, key: &[u8], digest: D) -> bool

Verify a parsed token with a key and a given hashing algorithm. Make sure to check the token's algorithm before applying.

fn signed<D: Digest>(&self, key: &[u8], digest: D) -> Result<StringError>

Generate the signed token from a key and a given hashing algorithm.

Trait Implementations

impl Default for Token
[src]

fn default() -> Token

Returns the "default value" for a type. Read more

impl Debug for Token
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for Token
[src]

fn eq(&self, other: &Token) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.