nethsm_sdk_rs/models/
sign_mode.rs

1/*
2 * NetHSM
3 *
4 * All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: Nitrokey <info@nitrokey.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
12#[non_exhaustive]
13pub enum SignMode {
14    #[serde(rename = "PKCS1")]
15    Pkcs1,
16    #[serde(rename = "PSS_MD5")]
17    PssMd5,
18    #[serde(rename = "PSS_SHA1")]
19    PssSha1,
20    #[serde(rename = "PSS_SHA224")]
21    PssSha224,
22    #[serde(rename = "PSS_SHA256")]
23    PssSha256,
24    #[serde(rename = "PSS_SHA384")]
25    PssSha384,
26    #[serde(rename = "PSS_SHA512")]
27    PssSha512,
28    #[serde(rename = "EdDSA")]
29    EdDsa,
30    #[serde(rename = "ECDSA")]
31    Ecdsa,
32    #[serde(rename = "BIP340")]
33    Bip340,
34}
35
36impl std::fmt::Display for SignMode {
37    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
38        write!(
39            f,
40            "{}",
41            match self {
42                Self::Pkcs1 => "PKCS1",
43                Self::PssMd5 => "PSS_MD5",
44                Self::PssSha1 => "PSS_SHA1",
45                Self::PssSha224 => "PSS_SHA224",
46                Self::PssSha256 => "PSS_SHA256",
47                Self::PssSha384 => "PSS_SHA384",
48                Self::PssSha512 => "PSS_SHA512",
49                Self::EdDsa => "EdDSA",
50                Self::Ecdsa => "ECDSA",
51                Self::Bip340 => "BIP340",
52            }
53        )
54    }
55}
56
57impl Default for SignMode {
58    fn default() -> SignMode {
59        Self::Pkcs1
60    }
61}