[−][src]Struct aliri_jose::jwt::Claims
Common claims used in JWTs
Implementations
impl Claims
[src]
impl<C: Serialize> Claims<C>
[src]
pub fn sign<H: Serialize + HasAlgorithm>(
&self,
jwk: &Jwk,
headers: &H
) -> Result<Jwt, JwtSigningError>
[src]
&self,
jwk: &Jwk,
headers: &H
) -> Result<Jwt, JwtSigningError>
Produces a signed JWT with the given header and claims
impl<P> Claims<P>
[src]
pub fn with_audience(self, aud: impl Into<Audience>) -> Self
[src]
Sets the aud
claim for the JWT
pub fn with_audiences(self, aud: impl Into<Audiences>) -> Self
[src]
Sets the aud
claim for the JWT, where multiple audiences are allowed
pub fn with_issuer(self, iss: impl Into<Issuer>) -> Self
[src]
Sets the iss
claim for the JWT
pub fn with_subject(self, sub: impl Into<Subject>) -> Self
[src]
Sets the sub
claim for the JWT
pub fn with_future_expiration(self, secs: u64) -> Self
[src]
Sets the exp
claim for the JWT using the system clock
pub fn with_future_expiration_from_clock<C: Clock>(
self,
secs: u64,
clock: &C
) -> Self
[src]
self,
secs: u64,
clock: &C
) -> Self
Sets the exp
claim for the JWT using the specified clock
pub fn with_expiration(self, time: UnixTime) -> Self
[src]
Sets the exp
claim for the JWT
pub fn with_not_before(self, time: UnixTime) -> Self
[src]
Sets the nbf
claim for the JWT
pub fn with_payload<Q>(self, payload: Q) -> Claims<Q>
[src]
Adds a custom payload of claims to the JWT
pub fn payload(&self) -> &P
[src]
Borrows the custom claims attached to the JWT
pub fn take_payload(self) -> P
[src]
Moves the custom claims out
Trait Implementations
impl<P: Clone> Clone for Claims<P>
[src]
impl<P> CoreClaims for Claims<P>
[src]
fn aud(&self) -> &Audiences
[src]
fn iss(&self) -> Option<&IssuerRef>
[src]
fn sub(&self) -> Option<&SubjectRef>
[src]
fn exp(&self) -> Option<UnixTime>
[src]
fn nbf(&self) -> Option<UnixTime>
[src]
impl<P: Debug> Debug for Claims<P>
[src]
impl<'de, P> Deserialize<'de> for Claims<P> where
P: Deserialize<'de>,
[src]
P: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<P: Eq> Eq for Claims<P>
[src]
impl<P: PartialEq> PartialEq<Claims<P>> for Claims<P>
[src]
impl<P> Serialize for Claims<P> where
P: Serialize,
[src]
P: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<P> StructuralEq for Claims<P>
[src]
impl<P> StructuralPartialEq for Claims<P>
[src]
Auto Trait Implementations
impl<P> RefUnwindSafe for Claims<P> where
P: RefUnwindSafe,
P: RefUnwindSafe,
impl<P> Send for Claims<P> where
P: Send,
P: Send,
impl<P> Sync for Claims<P> where
P: Sync,
P: Sync,
impl<P> Unpin for Claims<P> where
P: Unpin,
P: Unpin,
impl<P> UnwindSafe for Claims<P> where
P: UnwindSafe,
P: 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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,