Enum openid::biscuit::jwa::SignatureAlgorithm[][src]

pub enum SignatureAlgorithm {
    None,
    HS256,
    HS384,
    HS512,
    RS256,
    RS384,
    RS512,
    ES256,
    ES384,
    ES512,
    PS256,
    PS384,
    PS512,
}

The algorithms supported for digital signature and MACs, defined by RFC7518#3.

Variants

None

No encryption/signature is included for the JWT. During verification, the signature MUST BE empty or verification will fail.

HS256

HMAC using SHA-256

HS384

HMAC using SHA-384

HS512

HMAC using SHA-512

RS256

RSASSA-PKCS1-v1_5 using SHA-256

RS384

RSASSA-PKCS1-v1_5 using SHA-384

RS512

RSASSA-PKCS1-v1_5 using SHA-512

ES256

ECDSA using P-256 and SHA-256

ES384

ECDSA using P-384 and SHA-384

ES512

ECDSA using P-521 and SHA-512 – This variant is unsupported and will probably never be.

PS256

RSASSA-PSS using SHA-256 and MGF1 with SHA-256. The size of the salt value is the same size as the hash function output.

PS384

RSASSA-PSS using SHA-384 and MGF1 with SHA-384 The size of the salt value is the same size as the hash function output.

PS512

RSASSA-PSS using SHA-512 and MGF1 with SHA-512 The size of the salt value is the same size as the hash function output.

Implementations

impl SignatureAlgorithm[src]

pub fn sign(
    self,
    data: &[u8],
    secret: &Secret
) -> Result<Vec<u8, Global>, Error>
[src]

Take some bytes and sign it according to the algorithm and secret provided.

pub fn verify(
    self,
    expected_signature: &[u8],
    data: &[u8],
    secret: &Secret
) -> Result<(), Error>
[src]

Verify signature based on the algorithm and secret provided.

Trait Implementations

impl Clone for SignatureAlgorithm[src]

impl Copy for SignatureAlgorithm[src]

impl Debug for SignatureAlgorithm[src]

impl Default for SignatureAlgorithm[src]

impl<'de> Deserialize<'de> for SignatureAlgorithm[src]

impl Eq for SignatureAlgorithm[src]

impl PartialEq<SignatureAlgorithm> for SignatureAlgorithm[src]

impl Serialize for SignatureAlgorithm[src]

impl StructuralEq for SignatureAlgorithm[src]

impl StructuralPartialEq for SignatureAlgorithm[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.