pub struct JwsContext { /* private fields */ }Implementations§
Source§impl JwsContext
impl JwsContext
pub fn new() -> Self
Sourcepub fn is_acceptable_critical(&self, name: &str) -> bool
pub fn is_acceptable_critical(&self, name: &str) -> bool
Sourcepub fn add_acceptable_critical(&mut self, name: &str)
pub fn add_acceptable_critical(&mut self, name: &str)
Add a acceptable critical header claim name
§Arguments
name- a acceptable critical header claim name
Sourcepub fn remove_acceptable_critical(&mut self, name: &str)
pub fn remove_acceptable_critical(&mut self, name: &str)
Remove a acceptable critical header claim name
§Arguments
name- a acceptable critical header claim name
Sourcepub fn serialize_compact(
&self,
payload: &[u8],
header: &JwsHeader,
signer: &dyn JwsSigner,
) -> Result<String, JoseError>
pub fn serialize_compact( &self, payload: &[u8], header: &JwsHeader, signer: &dyn JwsSigner, ) -> Result<String, JoseError>
Return a representation of the data that is formatted by compact serialization.
§Arguments
payload- The payload data.header- The JWS heaser claims.signer- The JWS signer.
Sourcepub fn serialize_compact_with_selector<'a, F>(
&self,
payload: &[u8],
header: &JwsHeader,
selector: F,
) -> Result<String, JoseError>
pub fn serialize_compact_with_selector<'a, F>( &self, payload: &[u8], header: &JwsHeader, selector: F, ) -> Result<String, JoseError>
Return a representation of the data that is formatted by compact serialization.
§Arguments
payload- The payload data.header- The JWS heaser claims.selector- a function for selecting the signing algorithm.
Sourcepub fn serialize_general_json(
&self,
payload: &[u8],
signers: &[(&JwsHeaderSet, &dyn JwsSigner)],
) -> Result<String, JoseError>
pub fn serialize_general_json( &self, payload: &[u8], signers: &[(&JwsHeaderSet, &dyn JwsSigner)], ) -> Result<String, JoseError>
Return a representation of the data that is formatted by flattened json serialization.
§Arguments
protected- The JWS protected header claims.header- The JWS unprotected header claims.payload- The payload data.signers- The JWS signer.
Sourcepub fn serialize_general_json_with_selecter<'a, F>(
&self,
payload: &[u8],
headers: &[&JwsHeaderSet],
selector: F,
) -> Result<String, JoseError>
pub fn serialize_general_json_with_selecter<'a, F>( &self, payload: &[u8], headers: &[&JwsHeaderSet], selector: F, ) -> Result<String, JoseError>
Return a representation of the data that is formatted by flattened json serialization.
§Arguments
payload- The payload data.headers- The JWS headers.selector- a function for selecting the signing algorithm.
Sourcepub fn serialize_flattened_json(
&self,
payload: &[u8],
header: &JwsHeaderSet,
signer: &dyn JwsSigner,
) -> Result<String, JoseError>
pub fn serialize_flattened_json( &self, payload: &[u8], header: &JwsHeaderSet, signer: &dyn JwsSigner, ) -> Result<String, JoseError>
Return a representation of the data that is formatted by flattened json serialization.
§Arguments
payload- The payload data.header- The JWS protected and unprotected header claims.signer- The JWS signer.
Sourcepub fn serialize_flattened_json_with_selector<'a, F>(
&self,
payload: &[u8],
header: &JwsHeaderSet,
selector: F,
) -> Result<String, JoseError>
pub fn serialize_flattened_json_with_selector<'a, F>( &self, payload: &[u8], header: &JwsHeaderSet, selector: F, ) -> Result<String, JoseError>
Return a representation of the data that is formatted by flatted json serialization.
§Arguments
payload- The payload data.header- The JWS protected and unprotected header claims.selector- a function for selecting the signing algorithm.
Sourcepub fn deserialize_compact(
&self,
input: impl AsRef<[u8]>,
verifier: &dyn JwsVerifier,
) -> Result<(Vec<u8>, JwsHeader), JoseError>
pub fn deserialize_compact( &self, input: impl AsRef<[u8]>, verifier: &dyn JwsVerifier, ) -> Result<(Vec<u8>, JwsHeader), JoseError>
Deserialize the input that is formatted by compact serialization.
§Arguments
input- The input data.header- The decoded JWS header claims.verifier- The JWS verifier.
Sourcepub fn deserialize_compact_with_selector<'a, F>(
&self,
input: impl AsRef<[u8]>,
selector: F,
) -> Result<(Vec<u8>, JwsHeader), JoseError>
pub fn deserialize_compact_with_selector<'a, F>( &self, input: impl AsRef<[u8]>, selector: F, ) -> Result<(Vec<u8>, JwsHeader), JoseError>
Deserialize the input that is formatted by compact serialization.
§Arguments
input- The input data.header- The decoded JWS header claims.selector- a function for selecting the verifying algorithm.
Sourcepub fn deserialize_json<'a>(
&self,
input: impl AsRef<[u8]>,
verifier: &'a dyn JwsVerifier,
) -> Result<(Vec<u8>, JwsHeader), JoseError>
pub fn deserialize_json<'a>( &self, input: impl AsRef<[u8]>, verifier: &'a dyn JwsVerifier, ) -> Result<(Vec<u8>, JwsHeader), JoseError>
Deserialize the input that is formatted by json serialization.
§Arguments
input- The input data.header- The decoded JWS header claims.verifier- The JWS verifier.
Sourcepub fn deserialize_json_with_selector<'a, F>(
&self,
input: impl AsRef<[u8]>,
selector: F,
) -> Result<(Vec<u8>, JwsHeader), JoseError>
pub fn deserialize_json_with_selector<'a, F>( &self, input: impl AsRef<[u8]>, selector: F, ) -> Result<(Vec<u8>, JwsHeader), JoseError>
Deserialize the input that is formatted by json serialization.
§Arguments
input- The input data.header- The decoded JWS header claims.selector- a function for selecting the verifying algorithm.
Trait Implementations§
Source§impl Clone for JwsContext
impl Clone for JwsContext
Source§fn clone(&self) -> JwsContext
fn clone(&self) -> JwsContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JwsContext
impl Debug for JwsContext
impl Eq for JwsContext
Source§impl PartialEq for JwsContext
impl PartialEq for JwsContext
Source§fn eq(&self, other: &JwsContext) -> bool
fn eq(&self, other: &JwsContext) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for JwsContext
Auto Trait Implementations§
impl Freeze for JwsContext
impl RefUnwindSafe for JwsContext
impl Send for JwsContext
impl Sync for JwsContext
impl Unpin for JwsContext
impl UnsafeUnpin for JwsContext
impl UnwindSafe for JwsContext
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§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.