Skip to main content

JweHeaderSet

Struct JweHeaderSet 

Source
pub struct JweHeaderSet { /* private fields */ }
Expand description

Represent JWE protected and unprotected header claims

Implementations§

Source§

impl JweHeaderSet

Source

pub fn new() -> Self

Return a JweHeader instance.

Source

pub fn set_algorithm(&mut self, value: impl Into<String>, protection: bool)

Set a value for algorithm header claim (alg).

§Arguments
  • value - a algorithm
  • protection - If it dosen’t need protection, set false.
Source

pub fn algorithm(&self) -> Option<&str>

Return the value for algorithm header claim (alg).

Source

pub fn set_content_encryption( &mut self, value: impl Into<String>, protection: bool, )

Set a value for content encryption header claim (enc).

§Arguments
  • value - a content encryption
  • protection - If it dosen’t need protection, set false.
Source

pub fn content_encryption(&self) -> Option<&str>

Return the value for content encryption header claim (enc).

Source

pub fn set_compression(&mut self, value: impl Into<String>)

Set a value for compression header claim (zip).

§Arguments
  • value - a encryption
Source

pub fn compression(&self) -> Option<&str>

Return the value for compression header claim (zip).

Source

pub fn set_jwk_set_url(&mut self, value: impl Into<String>, protection: bool)

Set a value for JWK set URL header claim (jku).

§Arguments
  • value - a JWK set URL
Source

pub fn jwk_set_url(&self) -> Option<&str>

Return the value for JWK set URL header claim (jku).

Source

pub fn set_jwk(&mut self, value: Jwk, protection: bool)

Set a value for JWK header claim (jwk).

§Arguments
  • value - a JWK
Source

pub fn jwk(&self) -> Option<Jwk>

Return the value for JWK header claim (jwk).

Source

pub fn set_x509_url(&mut self, value: impl Into<String>, protection: bool)

Set a value for X.509 URL header claim (x5u).

§Arguments
  • value - a X.509 URL
Source

pub fn x509_url(&self) -> Option<&str>

Return a value for a X.509 URL header claim (x5u).

Source

pub fn set_x509_certificate_chain( &mut self, values: &Vec<impl AsRef<[u8]>>, protection: bool, )

Set values for X.509 certificate chain header claim (x5c).

§Arguments
  • values - X.509 certificate chain
Source

pub fn x509_certificate_chain(&self) -> Option<Vec<Vec<u8>>>

Return values for a X.509 certificate chain header claim (x5c).

Source

pub fn set_x509_certificate_sha1_thumbprint( &mut self, value: impl AsRef<[u8]>, protection: bool, )

Set a value for X.509 certificate SHA-1 thumbprint header claim (x5t).

§Arguments
  • value - A X.509 certificate SHA-1 thumbprint
Source

pub fn x509_certificate_sha1_thumbprint(&self) -> Option<Vec<u8>>

Return the value for X.509 certificate SHA-1 thumbprint header claim (x5t).

Source

pub fn set_x509_certificate_sha256_thumbprint( &mut self, value: impl AsRef<[u8]>, protection: bool, )

Set a value for a x509 certificate SHA-256 thumbprint header claim (x5t#S256).

§Arguments
  • value - A x509 certificate SHA-256 thumbprint
Source

pub fn x509_certificate_sha256_thumbprint(&self) -> Option<Vec<u8>>

Return the value for X.509 certificate SHA-256 thumbprint header claim (x5t#S256).

Source

pub fn set_key_id(&mut self, value: impl Into<String>, protection: bool)

Set a value for key ID header claim (kid).

§Arguments
  • value - a key ID
Source

pub fn key_id(&self) -> Option<&str>

Return the value for key ID header claim (kid).

Source

pub fn set_token_type(&mut self, value: impl Into<String>, protection: bool)

Set a value for token type header claim (typ).

§Arguments
  • value - a token type (e.g. “JWT”)
Source

pub fn token_type(&self) -> Option<&str>

Return the value for token type header claim (typ).

Source

pub fn set_content_type(&mut self, value: impl Into<String>, protection: bool)

Set a value for content type header claim (cty).

§Arguments
  • value - a content type (e.g. “JWT”)
Source

pub fn content_type(&self) -> Option<&str>

Return the value for content type header claim (cty).

Source

pub fn set_critical(&mut self, values: &Vec<impl AsRef<str>>)

Set values for critical header claim (crit).

§Arguments
  • values - critical claim names
Source

pub fn critical(&self) -> Option<Vec<&str>>

Return values for critical header claim (crit).

Source

pub fn set_url(&mut self, value: impl Into<String>, protection: bool)

Set a value for url header claim (url).

§Arguments
  • value - a url
Source

pub fn url(&self) -> Option<&str>

Return the value for url header claim (url).

Source

pub fn set_nonce(&mut self, value: impl AsRef<[u8]>, protection: bool)

Set a value for a nonce header claim (nonce).

§Arguments
  • value - A nonce
Source

pub fn nonce(&self) -> Option<Vec<u8>>

Return the value for nonce header claim (nonce).

Source

pub fn set_agreement_partyuinfo( &mut self, value: impl AsRef<[u8]>, protection: bool, )

Set a value for a agreement PartyUInfo header claim (apu).

§Arguments
  • value - A agreement PartyUInfo
Source

pub fn agreement_partyuinfo(&self) -> Option<Vec<u8>>

Return the value for agreement PartyUInfo header claim (apu).

Source

pub fn set_agreement_partyvinfo( &mut self, value: impl AsRef<[u8]>, protection: bool, )

Set a value for a agreement PartyVInfo header claim (apv).

§Arguments
  • value - A agreement PartyVInfo
Source

pub fn agreement_partyvinfo(&self) -> Option<Vec<u8>>

Return the value for agreement PartyVInfo header claim (apv).

Source

pub fn set_issuer(&mut self, value: impl Into<String>, protection: bool)

Set a value for issuer header claim (iss).

§Arguments
  • value - a issuer
Source

pub fn issuer(&self) -> Option<&str>

Return the value for issuer header claim (iss).

Source

pub fn set_subject(&mut self, value: impl Into<String>, protection: bool)

Set a value for subject header claim (sub).

§Arguments
  • value - a subject
Source

pub fn subject(&self) -> Option<&str>

Return the value for subject header claim (sub).

Source

pub fn set_audience(&mut self, values: Vec<impl Into<String>>, protection: bool)

Set values for audience header claim (aud).

§Arguments
  • values - a list of audiences
Source

pub fn audience(&self) -> Option<Vec<&str>>

Return values for audience header claim (aud).

Source

pub fn set_claim( &mut self, key: &str, value: Option<Value>, protection: bool, ) -> Result<(), JoseError>

Source

pub fn claims_set(&self, protection: bool) -> &Map<String, Value>

Return values for header claims set

Source

pub fn to_map(&self) -> Map<String, Value>

Trait Implementations§

Source§

impl Clone for JweHeaderSet

Source§

fn clone(&self) -> JweHeaderSet

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for JweHeaderSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for JweHeaderSet

Source§

type Target = dyn JoseHeader

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Display for JweHeaderSet

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for JweHeaderSet

Source§

impl JoseHeader for JweHeaderSet

Source§

fn len(&self) -> usize

Return claim count.
Source§

fn claim(&self, key: &str) -> Option<&Value>

Return the value for header claim of a specified key. Read more
Source§

fn box_clone(&self) -> Box<dyn JoseHeader>

Source§

fn as_any(&self) -> &dyn Any

Source§

fn as_any_mut(&mut self) -> &mut dyn Any

Source§

fn into_any(self: Box<Self>) -> Box<dyn Any>

Source§

impl PartialEq for JweHeaderSet

Source§

fn eq(&self, other: &JweHeaderSet) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for JweHeaderSet

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.