Struct josekit::jwt::JwtContext [−][src]
pub struct JwtContext { /* fields omitted */ }
Implementations
Add a acceptable critical header claim name
Arguments
name
- a acceptable critical header claim name
Remove a acceptable critical header claim name
Arguments
name
- a acceptable critical header claim name
pub fn encode_unsecured(
&self,
payload: &JwtPayload,
header: &JwsHeader
) -> Result<String, JoseError>
pub fn encode_unsecured(
&self,
payload: &JwtPayload,
header: &JwsHeader
) -> Result<String, JoseError>
Return the string repsentation of the JWT with a “none” algorithm.
Arguments
payload
- The payload data.header
- The JWT heaser claims.
pub fn encode_with_signer(
&self,
payload: &JwtPayload,
header: &JwsHeader,
signer: &dyn JwsSigner
) -> Result<String, JoseError>
pub fn encode_with_signer(
&self,
payload: &JwtPayload,
header: &JwsHeader,
signer: &dyn JwsSigner
) -> Result<String, JoseError>
Return the string repsentation of the JWT with the siginig algorithm.
Arguments
payload
- The payload data.header
- The JWS heaser claims.signer
- a signer object.
pub fn encode_with_encrypter(
&self,
payload: &JwtPayload,
header: &JweHeader,
encrypter: &dyn JweEncrypter
) -> Result<String, JoseError>
pub fn encode_with_encrypter(
&self,
payload: &JwtPayload,
header: &JweHeader,
encrypter: &dyn JweEncrypter
) -> Result<String, JoseError>
Return the string repsentation of the JWT with the encrypting algorithm.
Arguments
payload
- The payload data.header
- The JWE heaser claims.encrypter
- a encrypter object.
pub fn decode_header(
&self,
input: impl AsRef<[u8]>
) -> Result<Box<dyn JoseHeader>, JoseError>
pub fn decode_header(
&self,
input: impl AsRef<[u8]>
) -> Result<Box<dyn JoseHeader>, JoseError>
Return the JWT object decoded with the “none” algorithm.
Arguments
input
- a JWT string representation.
pub fn decode_with_verifier(
&self,
input: impl AsRef<[u8]>,
verifier: &dyn JwsVerifier
) -> Result<(JwtPayload, JwsHeader), JoseError>
pub fn decode_with_verifier(
&self,
input: impl AsRef<[u8]>,
verifier: &dyn JwsVerifier
) -> Result<(JwtPayload, JwsHeader), JoseError>
Return the JWT object decoded by the selected verifier.
Arguments
verifier
- a verifier of the signing algorithm.input
- a JWT string representation.
Return the JWT object decoded with a selected verifying algorithm.
Arguments
input
- a JWT string representation.selector
- a function for selecting the verifying algorithm.
Return the JWT object decoded by using a JWK set.
Arguments
input
- a JWT string representation.jwk_set
- a JWK set.selector
- a function for selecting the verifying algorithm.
pub fn decode_with_decrypter(
&self,
input: impl AsRef<[u8]>,
decrypter: &dyn JweDecrypter
) -> Result<(JwtPayload, JweHeader), JoseError>
pub fn decode_with_decrypter(
&self,
input: impl AsRef<[u8]>,
decrypter: &dyn JweDecrypter
) -> Result<(JwtPayload, JweHeader), JoseError>
Return the JWT object decoded by the selected decrypter.
Arguments
input
- a JWT string representation.decrypter
- a decrypter of the decrypting algorithm.
Return the JWT object decoded with a selected decrypting algorithm.
Arguments
input
- a JWT string representation.decrypter_selector
- a function for selecting the decrypting algorithm.
Return the JWT object decoded by using a JWK set.
Arguments
input
- a JWT string representation.jwk_set
- a JWK set.selector
- a function for selecting the decrypting algorithm.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl !RefUnwindSafe for JwtContext
impl Send for JwtContext
impl Sync for JwtContext
impl Unpin for JwtContext
impl !UnwindSafe for JwtContext
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.