pub type IdToken<'a> = Jwt<'a, HashMap<String, Value>>;
Expand description
An OpenID Connect ID Token.
Aliased Type§
struct IdToken<'a> { /* private fields */ }
Implementations
source§impl<'a, T> Jwt<'a, T>
impl<'a, T> Jwt<'a, T>
sourcepub fn header(&self) -> &JsonWebSignatureHeader
pub fn header(&self) -> &JsonWebSignatureHeader
Get the JWT header
pub fn into_owned(self) -> Jwt<'static, T>
sourcepub fn verify<K, S>(&self, key: &K) -> Result<(), JwtVerificationError>where
K: Verifier<S>,
S: SignatureEncoding,
pub fn verify<K, S>(&self, key: &K) -> Result<(), JwtVerificationError>where
K: Verifier<S>,
S: SignatureEncoding,
Verify the signature of this JWT using the given key.
§Errors
Returns an error if the signature is invalid.
Verify the signature of this JWT using the given symmetric key.
§Errors
Returns an error if the signature is invalid or if the algorithm is not supported.
sourcepub fn verify_with_jwks(
&self,
jwks: &JsonWebKeySet<JsonWebKeyPublicParameters>,
) -> Result<(), NoKeyWorked>
pub fn verify_with_jwks( &self, jwks: &JsonWebKeySet<JsonWebKeyPublicParameters>, ) -> Result<(), NoKeyWorked>
Verify the signature of this JWT using the given JWKS.
§Errors
Returns an error if the signature is invalid, if no key matches the constraints, or if the algorithm is not supported.
sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Get the raw JWT string as an owned String
sourcepub fn into_parts(self) -> (JsonWebSignatureHeader, T)
pub fn into_parts(self) -> (JsonWebSignatureHeader, T)
Split the JWT into its parts (header and payload).
source§impl<T> Jwt<'static, T>
impl<T> Jwt<'static, T>
sourcepub fn sign<K, S>(
header: JsonWebSignatureHeader,
payload: T,
key: &K,
) -> Result<Jwt<'static, T>, JwtSignatureError>
pub fn sign<K, S>( header: JsonWebSignatureHeader, payload: T, key: &K, ) -> Result<Jwt<'static, T>, JwtSignatureError>
Sign the given payload with the given key.
§Errors
Returns an error if the payload could not be serialized or if the key could not sign the payload.
sourcepub fn sign_with_rng<R, K, S>(
rng: &mut R,
header: JsonWebSignatureHeader,
payload: T,
key: &K,
) -> Result<Jwt<'static, T>, JwtSignatureError>
pub fn sign_with_rng<R, K, S>( rng: &mut R, header: JsonWebSignatureHeader, payload: T, key: &K, ) -> Result<Jwt<'static, T>, JwtSignatureError>
Sign the given payload with the given key using the given RNG.
§Errors
Returns an error if the payload could not be serialized or if the key could not sign the payload.