Skip to main content

akeyless_api/models/
generate_csr.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 GenerateCsr {
16    #[serde(rename = "alg", skip_serializing_if = "Option::is_none")]
17    pub alg: Option<String>,
18    /// A comma-separated list of dns alternative names
19    #[serde(rename = "alt-names", skip_serializing_if = "Option::is_none")]
20    pub alt_names: Option<String>,
21    /// The certificate type to be included in the CSR certificate (ssl-client/ssl-server/certificate-signing)
22    #[serde(rename = "certificate-type", skip_serializing_if = "Option::is_none")]
23    pub certificate_type: Option<String>,
24    /// The city to be included in the CSR certificate
25    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
26    pub city: Option<String>,
27    /// The common name to be included in the CSR certificate
28    #[serde(rename = "common-name")]
29    pub common_name: String,
30    /// The country to be included in the CSR certificate
31    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
32    pub country: Option<String>,
33    /// Add critical to the key usage extension (will be false if not added)
34    #[serde(rename = "critical", skip_serializing_if = "Option::is_none")]
35    pub critical: Option<bool>,
36    /// The department to be included in the CSR certificate
37    #[serde(rename = "dep", skip_serializing_if = "Option::is_none")]
38    pub dep: Option<String>,
39    /// A comma-separated list of email addresses alternative names
40    #[serde(rename = "email-addresses", skip_serializing_if = "Option::is_none")]
41    pub email_addresses: Option<String>,
42    /// The flag to indicate if the private key should be exported
43    #[serde(rename = "export-private-key", skip_serializing_if = "Option::is_none")]
44    pub export_private_key: Option<bool>,
45    /// Generate a new classic key for the csr
46    #[serde(rename = "generate-key", skip_serializing_if = "Option::is_none")]
47    pub generate_key: Option<bool>,
48    /// Specifies the hash algorithm used for the encryption key's operations, available options: SHA256, SHA384, SHA512
49    #[serde(rename = "hash-algorithm", skip_serializing_if = "Option::is_none")]
50    pub hash_algorithm: Option<String>,
51    /// A comma-separated list of ip addresses alternative names
52    #[serde(rename = "ip-addresses", skip_serializing_if = "Option::is_none")]
53    pub ip_addresses: Option<String>,
54    /// Set output format to JSON
55    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
56    pub json: Option<bool>,
57    /// The type of the key to generate (classic-key/dfc)
58    #[serde(rename = "key-type")]
59    pub key_type: String,
60    /// The key name
61    #[serde(rename = "name")]
62    pub name: String,
63    /// The organization to be included in the CSR certificate
64    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
65    pub org: Option<String>,
66    /// The number of fragments that the item will be split into (not includes customer fragment)
67    #[serde(rename = "split-level", skip_serializing_if = "Option::is_none")]
68    pub split_level: Option<i64>,
69    /// The state to be included in the CSR certificate
70    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
71    pub state: Option<String>,
72    /// Authentication token (see `/auth` and `/configure`)
73    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
74    pub token: Option<String>,
75    /// The universal identity token, Required only for universal_identity authentication
76    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
77    pub uid_token: Option<String>,
78    /// A comma-separated list of uri alternative names
79    #[serde(rename = "uri-sans", skip_serializing_if = "Option::is_none")]
80    pub uri_sans: Option<String>,
81}
82
83impl GenerateCsr {
84    pub fn new(common_name: String, key_type: String, name: String) -> GenerateCsr {
85        GenerateCsr {
86            alg: None,
87            alt_names: None,
88            certificate_type: None,
89            city: None,
90            common_name,
91            country: None,
92            critical: None,
93            dep: None,
94            email_addresses: None,
95            export_private_key: None,
96            generate_key: None,
97            hash_algorithm: None,
98            ip_addresses: None,
99            json: None,
100            key_type,
101            name,
102            org: None,
103            split_level: None,
104            state: None,
105            token: None,
106            uid_token: None,
107            uri_sans: None,
108        }
109    }
110}
111