Struct jwt_simple::token::TokenMetadata
source · [−]pub struct TokenMetadata { /* private fields */ }
Expand description
JWT token information useful before signature/tag verification
Implementations
sourceimpl TokenMetadata
impl TokenMetadata
sourcepub fn algorithm(&self) -> &str
pub fn algorithm(&self) -> &str
The JWT algorithm for this token (“alg”) This information should not be trusted: it is unprotected and can be freely modified by a third party. Clients should ignore it and use the correct type of key directly.
sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
The content type for this token (“cty”)
sourcepub fn signature_type(&self) -> Option<&str>
pub fn signature_type(&self) -> Option<&str>
The signature type for this token (“typ”)
sourcepub fn critical(&self) -> Option<&[String]>
pub fn critical(&self) -> Option<&[String]>
The set of raw critical properties for this token (“crit”)
sourcepub fn certificate_chain(&self) -> Option<&[String]>
pub fn certificate_chain(&self) -> Option<&[String]>
The certificate chain for this token (“x5c”) This information should not be trusted: it is unprotected and can be freely modified by a third party.
sourcepub fn key_set_url(&self) -> Option<&str>
pub fn key_set_url(&self) -> Option<&str>
The key set URL for this token (“jku”) This information should not be trusted: it is unprotected and can be freely modified by a third party. At the bare minimum, you should check that the URL belongs to the domain you expect.
sourcepub fn public_key(&self) -> Option<&str>
pub fn public_key(&self) -> Option<&str>
The public key for this token (“jwk”) This information should not be trusted: it is unprotected and can be freely modified by a third party. At the bare minimum, you should check that it’s in a set of public keys you already trust.
sourcepub fn certificate_url(&self) -> Option<&str>
pub fn certificate_url(&self) -> Option<&str>
The certificate URL for this token (“x5u”) This information should not be trusted: it is unprotected and can be freely modified by a third party. At the bare minimum, you should check that the URL belongs to the domain you expect.
sourcepub fn certificate_sha1_thumbprint(&self) -> Option<&str>
pub fn certificate_sha1_thumbprint(&self) -> Option<&str>
URLsafe-base64-encoded SHA1 hash of the X.509 certificate for this token (“x5t”) In practice, it can also be any string representing the public key. This information should not be trusted: it is unprotected and can be freely modified by a third party.
sourcepub fn certificate_sha256_thumbprint(&self) -> Option<&str>
pub fn certificate_sha256_thumbprint(&self) -> Option<&str>
URLsafe-base64-encoded SHA256 hash of the X.509 certificate for this token (“x5t#256”) In practice, it can also be any string representing the public key. This information should not be trusted: it is unprotected and can be freely modified by a third party.
Trait Implementations
sourceimpl Clone for TokenMetadata
impl Clone for TokenMetadata
sourcefn clone(&self) -> TokenMetadata
fn clone(&self) -> TokenMetadata
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TokenMetadata
impl Debug for TokenMetadata
sourceimpl Default for TokenMetadata
impl Default for TokenMetadata
sourcefn default() -> TokenMetadata
fn default() -> TokenMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for TokenMetadata
impl Send for TokenMetadata
impl Sync for TokenMetadata
impl Unpin for TokenMetadata
impl UnwindSafe for TokenMetadata
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more