[][src]Struct jwt::Token

pub struct Token<H, C, S> { /* fields omitted */ }

Representation of a structured JWT. Methods vary based on the signature type S.

Methods

impl<H, C> Token<H, C, Unsigned>[src]

pub fn new(header: H, claims: C) -> Self[src]

Create a new unsigned token, with mutable headers and claims.

pub fn header_mut(&mut self) -> &mut H[src]

pub fn claims_mut(&mut self) -> &mut C[src]

impl<'a, H, C> Token<H, C, Signed>[src]

pub fn as_str(&self) -> &str[src]

Get the string representation of the token.

impl<'a, H: FromBase64, C: FromBase64> Token<H, C, Unverified<'a>>[src]

pub fn parse_unverified(
    token_str: &str
) -> Result<Token<H, C, Unverified>, Error>
[src]

Not recommended. Parse the header and claims without checking the validity of the signature.

impl<H, C, S> Token<H, C, S>[src]

pub fn header(&self) -> &H[src]

pub fn claims(&self) -> &C[src]

pub fn remove_signature(self) -> Token<H, C, Unsigned>[src]

Trait Implementations

impl<H, C> Default for Token<H, C, Unsigned> where
    H: Default,
    C: Default
[src]

impl<H, C, S> Into<(H, C)> for Token<H, C, S>[src]

impl<H, C> Into<String> for Token<H, C, Signed>[src]

impl<H, C> SignWithKey<Token<H, C, Signed>> for Token<H, C, Unsigned> where
    H: ToBase64 + JoseHeader,
    C: ToBase64
[src]

impl<H, C> SignWithStore<Token<H, C, Signed>> for Token<H, C, Unsigned> where
    H: ToBase64 + JoseHeader,
    C: ToBase64
[src]

impl<'a, H: JoseHeader, C> VerifyWithKey<Token<H, C, Verified>> for Token<H, C, Unverified<'a>>[src]

impl<'a, H, C> VerifyWithKey<Token<H, C, Verified>> for &'a str where
    H: FromBase64 + JoseHeader,
    C: FromBase64
[src]

impl<'a, H: JoseHeader, C> VerifyWithStore<Token<H, C, Verified>> for Token<H, C, Unverified<'a>>[src]

impl<'a, H, C> VerifyWithStore<Token<H, C, Verified>> for &'a str where
    H: FromBase64 + JoseHeader,
    C: FromBase64
[src]

Auto Trait Implementations

impl<H, C, S> RefUnwindSafe for Token<H, C, S> where
    C: RefUnwindSafe,
    H: RefUnwindSafe,
    S: RefUnwindSafe

impl<H, C, S> Send for Token<H, C, S> where
    C: Send,
    H: Send,
    S: Send

impl<H, C, S> Sync for Token<H, C, S> where
    C: Sync,
    H: Sync,
    S: Sync

impl<H, C, S> Unpin for Token<H, C, S> where
    C: Unpin,
    H: Unpin,
    S: Unpin

impl<H, C, S> UnwindSafe for Token<H, C, S> where
    C: UnwindSafe,
    H: UnwindSafe,
    S: UnwindSafe

Blanket Implementations

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

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

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

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

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

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

type Output = T

Should always be Self

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.