pub struct TrustedToken { /* private fields */ }Expand description
A TrustedToken is returned by either a verify() or decrypt() operation and represents
a validated token.
It represents a authenticated and non-tampered token. It does not validate additional things, such as claims that may be within the token payload itself. These must still be validated separately.
However, using the crate::public and crate::local API will automatically handle claims
validation. Any validated claims may be retrieved with TrustedToken::payload_claims().
Implementations§
Source§impl TrustedToken
impl TrustedToken
Sourcepub fn payload_claims(&self) -> Option<&Claims>
Available on crate feature std only.
pub fn payload_claims(&self) -> Option<&Claims>
std only.Get the footer used to create the token.
Empty if None was used during creation.
Sourcepub fn implicit_assert(&self) -> &[u8] ⓘ
pub fn implicit_assert(&self) -> &[u8] ⓘ
Get the implicit assertion used to create the token.
Empty if None was used during creation.
If token was created using V2, then it will always be empty.
Trait Implementations§
Source§impl Clone for TrustedToken
impl Clone for TrustedToken
Source§fn clone(&self) -> TrustedToken
fn clone(&self) -> TrustedToken
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TrustedToken
impl Debug for TrustedToken
Source§impl<'de> Deserialize<'de> for TrustedToken
impl<'de> Deserialize<'de> for TrustedToken
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TrustedToken
impl PartialEq for TrustedToken
Source§impl Serialize for TrustedToken
impl Serialize for TrustedToken
impl Eq for TrustedToken
impl StructuralPartialEq for TrustedToken
Auto Trait Implementations§
impl Freeze for TrustedToken
impl RefUnwindSafe for TrustedToken
impl Send for TrustedToken
impl Sync for TrustedToken
impl Unpin for TrustedToken
impl UnsafeUnpin for TrustedToken
impl UnwindSafe for TrustedToken
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more