fusionauth_rust_client/models/
algorithm.rs

1/*
2 * FusionAuth API
3 *
4 * This is a FusionAuth server. Find out more at [https://fusionauth.io](https://fusionauth.io). You need to [set up an API key](https://fusionauth.io/docs/v1/tech/apis/authentication#managing-api-keys) in the FusionAuth instance you are using to test out the API calls.
5 *
6 * The version of the OpenAPI document: 1.60.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Algorithm : Available JSON Web Algorithms (JWA) as described in RFC 7518 available for this JWT implementation.
15/// Available JSON Web Algorithms (JWA) as described in RFC 7518 available for this JWT implementation.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum Algorithm {
18    #[serde(rename = "ES256")]
19    Es256,
20    #[serde(rename = "ES384")]
21    Es384,
22    #[serde(rename = "ES512")]
23    Es512,
24    #[serde(rename = "HS256")]
25    Hs256,
26    #[serde(rename = "HS384")]
27    Hs384,
28    #[serde(rename = "HS512")]
29    Hs512,
30    #[serde(rename = "PS256")]
31    Ps256,
32    #[serde(rename = "PS384")]
33    Ps384,
34    #[serde(rename = "PS512")]
35    Ps512,
36    #[serde(rename = "RS256")]
37    Rs256,
38    #[serde(rename = "RS384")]
39    Rs384,
40    #[serde(rename = "RS512")]
41    Rs512,
42    #[serde(rename = "none")]
43    None,
44
45}
46
47impl std::fmt::Display for Algorithm {
48    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
49        match self {
50            Self::Es256 => write!(f, "ES256"),
51            Self::Es384 => write!(f, "ES384"),
52            Self::Es512 => write!(f, "ES512"),
53            Self::Hs256 => write!(f, "HS256"),
54            Self::Hs384 => write!(f, "HS384"),
55            Self::Hs512 => write!(f, "HS512"),
56            Self::Ps256 => write!(f, "PS256"),
57            Self::Ps384 => write!(f, "PS384"),
58            Self::Ps512 => write!(f, "PS512"),
59            Self::Rs256 => write!(f, "RS256"),
60            Self::Rs384 => write!(f, "RS384"),
61            Self::Rs512 => write!(f, "RS512"),
62            Self::None => write!(f, "none"),
63        }
64    }
65}
66
67impl Default for Algorithm {
68    fn default() -> Algorithm {
69        Self::Es256
70    }
71}
72