1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! Algorithms used to sign the JWT.
//!
//! The algorithms listed here are not comprehensive. The types are used to
//! represent various properties of the algorithms.

/// A marker trait for an Algorithm.
pub trait Algorithm {}

/// ECDSA using P-256 and SHA-256.
#[derive(Debug)]
pub struct Es256;

impl Algorithm for Es256 {}

/// HMAC using SHA-256.
#[derive(Debug)]
pub struct Hs256;

impl Algorithm for Hs256 {}

/// RSASSA-PKCS-v1_5 using SHA-256.
#[derive(Debug)]
pub struct Rs256;

impl Algorithm for Rs256 {}