pub struct TokenMetadata { /* private fields */ }
Expand description
JWT token information useful before signature/tag verification
Implementations§
source§impl 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§
source§impl Clone for TokenMetadata
impl Clone for TokenMetadata
source§fn clone(&self) -> TokenMetadata
fn clone(&self) -> TokenMetadata
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TokenMetadata
impl Debug for TokenMetadata
source§impl Default for TokenMetadata
impl Default for TokenMetadata
source§fn default() -> TokenMetadata
fn default() -> TokenMetadata
Auto Trait Implementations§
impl Freeze for TokenMetadata
impl RefUnwindSafe for TokenMetadata
impl Send for TokenMetadata
impl Sync for TokenMetadata
impl Unpin for TokenMetadata
impl UnwindSafe for TokenMetadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)