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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
 * NetHSM
 *
 * 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.
 *
 * The version of the OpenAPI document: v1
 * Contact: Nitrokey <info@nitrokey.com>
 * Generated by: https://openapi-generator.tech
 */

///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DecryptMode {
    #[serde(rename = "RAW")]
    Raw,
    #[serde(rename = "PKCS1")]
    Pkcs1,
    #[serde(rename = "OAEP_MD5")]
    OaepMd5,
    #[serde(rename = "OAEP_SHA1")]
    OaepSha1,
    #[serde(rename = "OAEP_SHA224")]
    OaepSha224,
    #[serde(rename = "OAEP_SHA256")]
    OaepSha256,
    #[serde(rename = "OAEP_SHA384")]
    OaepSha384,
    #[serde(rename = "OAEP_SHA512")]
    OaepSha512,
    #[serde(rename = "AES_CBC")]
    AesCbc,
}

impl ToString for DecryptMode {
    fn to_string(&self) -> String {
        match self {
            Self::Raw => String::from("RAW"),
            Self::Pkcs1 => String::from("PKCS1"),
            Self::OaepMd5 => String::from("OAEP_MD5"),
            Self::OaepSha1 => String::from("OAEP_SHA1"),
            Self::OaepSha224 => String::from("OAEP_SHA224"),
            Self::OaepSha256 => String::from("OAEP_SHA256"),
            Self::OaepSha384 => String::from("OAEP_SHA384"),
            Self::OaepSha512 => String::from("OAEP_SHA512"),
            Self::AesCbc => String::from("AES_CBC"),
        }
    }
}

impl Default for DecryptMode {
    fn default() -> DecryptMode {
        Self::Raw
    }
}