[−][src]Struct jwt::Token
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]
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]
token_str: &str
) -> Result<Token<H, C, Unverified>, Error>
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]
H: Default,
C: Default,
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]
H: ToBase64 + JoseHeader,
C: ToBase64,
fn sign_with_key(
self,
key: &dyn SigningAlgorithm
) -> Result<Token<H, C, Signed>, Error>
[src]
self,
key: &dyn SigningAlgorithm
) -> Result<Token<H, C, Signed>, Error>
impl<H, C> SignWithStore<Token<H, C, Signed>> for Token<H, C, Unsigned> where
H: ToBase64 + JoseHeader,
C: ToBase64,
[src]
H: ToBase64 + JoseHeader,
C: ToBase64,
fn sign_with_store<S, A>(self, store: &S) -> Result<Token<H, C, Signed>, Error> where
S: Store<Algorithm = A>,
A: SigningAlgorithm,
[src]
S: Store<Algorithm = A>,
A: SigningAlgorithm,
impl<'a, H: JoseHeader, C> VerifyWithKey<Token<H, C, Verified>> for Token<H, C, Unverified<'a>>
[src]
fn verify_with_key(
self,
key: &dyn VerifyingAlgorithm
) -> Result<Token<H, C, Verified>, Error>
[src]
self,
key: &dyn VerifyingAlgorithm
) -> Result<Token<H, C, Verified>, Error>
impl<'a, H, C> VerifyWithKey<Token<H, C, Verified>> for &'a str where
H: FromBase64 + JoseHeader,
C: FromBase64,
[src]
H: FromBase64 + JoseHeader,
C: FromBase64,
fn verify_with_key(
self,
key: &dyn VerifyingAlgorithm
) -> Result<Token<H, C, Verified>, Error>
[src]
self,
key: &dyn VerifyingAlgorithm
) -> Result<Token<H, C, Verified>, Error>
impl<'a, H: JoseHeader, C> VerifyWithStore<Token<H, C, Verified>> for Token<H, C, Unverified<'a>>
[src]
fn verify_with_store<S, A>(
self,
store: &S
) -> Result<Token<H, C, Verified>, Error> where
S: Store<Algorithm = A>,
A: VerifyingAlgorithm,
[src]
self,
store: &S
) -> Result<Token<H, C, Verified>, Error> where
S: Store<Algorithm = A>,
A: VerifyingAlgorithm,
impl<'a, H, C> VerifyWithStore<Token<H, C, Verified>> for &'a str where
H: FromBase64 + JoseHeader,
C: FromBase64,
[src]
H: FromBase64 + JoseHeader,
C: FromBase64,
fn verify_with_store<S, A>(
self,
store: &S
) -> Result<Token<H, C, Verified>, Error> where
S: Store<Algorithm = A>,
A: VerifyingAlgorithm,
[src]
self,
store: &S
) -> Result<Token<H, C, Verified>, Error> where
S: Store<Algorithm = A>,
A: VerifyingAlgorithm,
Auto Trait Implementations
impl<H, C, S> RefUnwindSafe for Token<H, C, S> where
C: RefUnwindSafe,
H: RefUnwindSafe,
S: RefUnwindSafe,
C: RefUnwindSafe,
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<H, C, S> Send for Token<H, C, S> where
C: Send,
H: Send,
S: Send,
C: Send,
H: Send,
S: Send,
impl<H, C, S> Sync for Token<H, C, S> where
C: Sync,
H: Sync,
S: Sync,
C: Sync,
H: Sync,
S: Sync,
impl<H, C, S> Unpin for Token<H, C, S> where
C: Unpin,
H: Unpin,
S: Unpin,
C: Unpin,
H: Unpin,
S: Unpin,
impl<H, C, S> UnwindSafe for Token<H, C, S> where
C: UnwindSafe,
H: UnwindSafe,
S: UnwindSafe,
C: UnwindSafe,
H: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,