Skip to main content

akeyless_api/models/
encrypt.rs

1/*
2 * Akeyless API
3 *
4 * The purpose of this application is to provide access to Akeyless API.
5 *
6 * The version of the OpenAPI document: 3.0
7 * Contact: support@akeyless.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Encrypt {
16    /// The display id of the key to use in the encryption process
17    #[serde(rename = "display-id", skip_serializing_if = "Option::is_none")]
18    pub display_id: Option<String>,
19    /// name-value pair that specifies the encryption context to be used for authenticated encryption. If used here, the same value must be supplied to the decrypt command or decryption will fail
20    #[serde(rename = "encryption-context", skip_serializing_if = "Option::is_none")]
21    pub encryption_context: Option<std::collections::HashMap<String, String>>,
22    /// Select default assumed format for any plaintext input. Currently supported options: [base64]
23    #[serde(rename = "input-format", skip_serializing_if = "Option::is_none")]
24    pub input_format: Option<String>,
25    /// The item id of the key to use in the encryption process
26    #[serde(rename = "item-id", skip_serializing_if = "Option::is_none")]
27    pub item_id: Option<i64>,
28    /// Set output format to JSON
29    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
30    pub json: Option<bool>,
31    /// The name of the key to use in the encryption process
32    #[serde(rename = "key-name")]
33    pub key_name: String,
34    /// Data to be encrypted
35    #[serde(rename = "plaintext", skip_serializing_if = "Option::is_none")]
36    pub plaintext: Option<String>,
37    /// Authentication token (see `/auth` and `/configure`)
38    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
39    pub token: Option<String>,
40    /// The universal identity token, Required only for universal_identity authentication
41    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
42    pub uid_token: Option<String>,
43    /// key version (relevant only for classic key)
44    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
45    pub version: Option<i32>,
46}
47
48impl Encrypt {
49    pub fn new(key_name: String) -> Encrypt {
50        Encrypt {
51            display_id: None,
52            encryption_context: None,
53            input_format: None,
54            item_id: None,
55            json: None,
56            key_name,
57            plaintext: None,
58            token: None,
59            uid_token: None,
60            version: None,
61        }
62    }
63}
64