pub struct JwsHeader { /* private fields */ }
Expand description
Represent JWS header claims
Implementations§
source§impl JwsHeader
impl JwsHeader
sourcepub fn from_bytes(value: &[u8]) -> Result<Self, JoseError>
pub fn from_bytes(value: &[u8]) -> Result<Self, JoseError>
Return a new header instance from json style header.
§Arguments
value
- The json style header claims
sourcepub fn set_algorithm(&mut self, value: impl Into<String>)
pub fn set_algorithm(&mut self, value: impl Into<String>)
sourcepub fn set_jwk_set_url(&mut self, value: impl Into<String>)
pub fn set_jwk_set_url(&mut self, value: impl Into<String>)
sourcepub fn jwk_set_url(&self) -> Option<&str>
pub fn jwk_set_url(&self) -> Option<&str>
Return the value for JWK set URL header claim (jku).
sourcepub fn set_x509_url(&mut self, value: impl Into<String>)
pub fn set_x509_url(&mut self, value: impl Into<String>)
sourcepub fn set_x509_certificate_chain(&mut self, values: &Vec<impl AsRef<[u8]>>)
pub fn set_x509_certificate_chain(&mut self, values: &Vec<impl AsRef<[u8]>>)
Set values for X.509 certificate chain header claim (x5c).
§Arguments
values
- X.509 certificate chain
sourcepub fn x509_certificate_chain(&self) -> Option<Vec<Vec<u8>>>
pub fn x509_certificate_chain(&self) -> Option<Vec<Vec<u8>>>
Return values for a X.509 certificate chain header claim (x5c).
sourcepub fn set_x509_certificate_sha1_thumbprint(&mut self, value: impl AsRef<[u8]>)
pub fn set_x509_certificate_sha1_thumbprint(&mut self, value: impl AsRef<[u8]>)
Set a value for X.509 certificate SHA-1 thumbprint header claim (x5t).
§Arguments
value
- A X.509 certificate SHA-1 thumbprint
sourcepub fn x509_certificate_sha1_thumbprint(&self) -> Option<Vec<u8>>
pub fn x509_certificate_sha1_thumbprint(&self) -> Option<Vec<u8>>
Return the value for X.509 certificate SHA-1 thumbprint header claim (x5t).
sourcepub fn set_x509_certificate_sha256_thumbprint(
&mut self,
value: impl AsRef<[u8]>
)
pub fn set_x509_certificate_sha256_thumbprint( &mut self, value: impl AsRef<[u8]> )
Set a value for a x509 certificate SHA-256 thumbprint header claim (x5t#S256).
§Arguments
value
- A x509 certificate SHA-256 thumbprint
sourcepub fn x509_certificate_sha256_thumbprint(&self) -> Option<Vec<u8>>
pub fn x509_certificate_sha256_thumbprint(&self) -> Option<Vec<u8>>
Return the value for X.509 certificate SHA-256 thumbprint header claim (x5t#S256).
sourcepub fn set_key_id(&mut self, value: impl Into<String>)
pub fn set_key_id(&mut self, value: impl Into<String>)
sourcepub fn set_token_type(&mut self, value: impl Into<String>)
pub fn set_token_type(&mut self, value: impl Into<String>)
sourcepub fn token_type(&self) -> Option<&str>
pub fn token_type(&self) -> Option<&str>
Return the value for token type header claim (typ).
sourcepub fn set_content_type(&mut self, value: impl Into<String>)
pub fn set_content_type(&mut self, value: impl Into<String>)
sourcepub fn content_type(&self) -> Option<&str>
pub fn content_type(&self) -> Option<&str>
Return the value for content type header claim (cty).
sourcepub fn set_critical(&mut self, values: &Vec<impl AsRef<str>>)
pub fn set_critical(&mut self, values: &Vec<impl AsRef<str>>)
sourcepub fn set_base64url_encode_payload(&mut self, value: bool)
pub fn set_base64url_encode_payload(&mut self, value: bool)
Set a value for base64url-encode payload header claim (b64).
§Arguments
value
- is base64url-encode payload
sourcepub fn base64url_encode_payload(&self) -> Option<bool>
pub fn base64url_encode_payload(&self) -> Option<bool>
Return the value for base64url-encode payload header claim (b64).
sourcepub fn set_claim(
&mut self,
key: &str,
value: Option<Value>
) -> Result<(), JoseError>
pub fn set_claim( &mut self, key: &str, value: Option<Value> ) -> Result<(), JoseError>
Set a value for header claim of a specified key.
§Arguments
key
- a key name of header claimvalue
- a typed value of header claim
sourcepub fn claims_set(&self) -> &Map<String, Value>
pub fn claims_set(&self) -> &Map<String, Value>
Return values for header claims set
Trait Implementations§
source§impl JoseHeader for JwsHeader
impl JoseHeader for JwsHeader
source§impl PartialEq for JwsHeader
impl PartialEq for JwsHeader
impl Eq for JwsHeader
impl StructuralPartialEq for JwsHeader
Auto Trait Implementations§
impl Freeze for JwsHeader
impl RefUnwindSafe for JwsHeader
impl Send for JwsHeader
impl Sync for JwsHeader
impl Unpin for JwsHeader
impl UnwindSafe for JwsHeader
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.