Skip to main content

JwsSigningAlgorithm

Trait JwsSigningAlgorithm 

Source
pub trait JwsSigningAlgorithm<JT>:
    Clone
    + Debug
    + DeserializeOwned
    + Eq
    + Hash
    + PartialEq
    + Serialize
    + 'static
where JT: JsonWebKeyType,
{ // Required methods fn key_type(&self) -> Option<JT>; fn uses_shared_secret(&self) -> bool; fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>; fn rsa_sha_256() -> Self; }
Expand description

JSON Web Signature (JWS) algorithm.

Required Methods§

Source

fn key_type(&self) -> Option<JT>

Returns the type of key required to use this signature algorithm, or None if this algorithm does not require a key.

Source

fn uses_shared_secret(&self) -> bool

Returns true if the signature algorithm uses a shared secret (symmetric key).

Source

fn hash_bytes(&self, bytes: &[u8]) -> Result<Vec<u8>, String>

Hashes the given bytes using the hash algorithm associated with this signing algorithm, and returns the hashed bytes.

If hashing fails or this signing algorithm does not have an associated hash function, an Err is returned with a string describing the cause of the error.

Source

fn rsa_sha_256() -> Self

Returns the RS256 algorithm.

This is the default algorithm for OpenID Connect ID tokens and must be supported by all implementations.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§