vaultrs/api/pki/
responses.rs

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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
use serde::{Deserialize, Serialize};

/// Response from executing
/// [GenerateCertificateRequest][crate::api::pki::requests::GenerateCertificateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct GenerateCertificateResponse {
    pub ca_chain: Option<Vec<String>>,
    pub certificate: String,
    pub expiration: Option<u64>,
    pub issuing_ca: String,
    pub private_key: String,
    pub private_key_type: String,
    pub serial_number: String,
}

/// Response from executing
/// [GenerateIntermediateRequest][crate::api::pki::requests::GenerateIntermediateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct GenerateIntermediateResponse {
    pub csr: String,
    pub private_key: Option<String>,
    pub private_key_type: Option<String>,
}

/// Response from executing
/// [GenerateRootRequest][crate::api::pki::requests::GenerateRootRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct GenerateRootResponse {
    pub certificate: String,
    pub issuing_ca: String,
    pub serial_number: String,
}

/// Response from executing
/// [ListCertificatesRequest][crate::api::pki::requests::ListCertificatesRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListCertificatesResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [ListRolesRequest][crate::api::pki::requests::ListRolesRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListRolesResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [ReadCertificateRequest][crate::api::pki::requests::ReadCertificateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadCertificateResponse {
    pub certificate: String,
    pub revocation_time: i64,
    pub ca_chain: Option<String>,
}

/// Response from executing
/// [ReadCRLConfigRequest][crate::api::pki::requests::ReadCRLConfigRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadCRLConfigResponse {
    pub disable: bool,
    pub expiry: String,
}

/// Response from executing
/// [RevokeCertificateRequest][crate::api::pki::requests::RevokeCertificateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct RevokeCertificateResponse {
    pub revocation_time: u64,
}

/// Response from executing
/// [RotateCRLsRequest][crate::api::pki::requests::RotateCRLsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct RotateCRLsResponse {
    pub success: bool,
}

/// Response from executing
/// [ReadURLsRequest][crate::api::pki::requests::ReadURLsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadURLsResponse {
    pub issuing_certificates: Vec<String>,
    pub crl_distribution_points: Vec<String>,
    pub ocsp_servers: Vec<String>,
}

/// Response from executing
/// [ReadRoleRequest][crate::api::pki::requests::ReadRoleRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadRoleResponse {
    pub allow_any_name: bool,
    pub allow_bare_domains: bool,
    pub allow_glob_domains: bool,
    pub allow_ip_sans: bool,
    pub allow_localhost: bool,
    pub allow_subdomains: bool,
    pub allow_token_displayname: bool,
    pub allowed_domains: Vec<String>,
    pub allowed_domains_template: bool,
    pub allowed_other_sans: Vec<String>,
    pub allowed_serial_numbers: Vec<String>,
    pub allowed_uri_sans: Vec<String>,
    pub basic_constraints_valid_for_non_ca: bool,
    pub client_flag: bool,
    pub code_signing_flag: bool,
    pub country: Vec<String>,
    pub email_protection_flag: bool,
    pub enforce_hostnames: bool,
    pub ext_key_usage: Vec<String>,
    pub ext_key_usage_oids: Vec<String>,
    pub generate_lease: bool,
    pub key_bits: u64,
    pub key_type: String,
    pub key_usage: Vec<String>,
    pub locality: Vec<String>,
    pub max_ttl: u64,
    pub no_store: bool,
    pub not_before_duration: u64,
    pub organization: Vec<String>,
    pub ou: Vec<String>,
    pub policy_identifiers: Vec<String>,
    pub postal_code: Vec<String>,
    pub province: Vec<String>,
    pub require_cn: bool,
    pub server_flag: bool,
    pub street_address: Vec<String>,
    pub ttl: u64,
    pub use_csr_common_name: bool,
    pub use_csr_sans: bool,
}

/// Response from executing
/// [SignCertificateRequest][crate::api::pki::requests::SignCertificateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct SignCertificateResponse {
    pub ca_chain: Option<Vec<String>>,
    pub certificate: String,
    pub issuing_ca: String,
    pub serial_number: String,
}

/// Response from executing
/// [SignIntermediateRequest][crate::api::pki::requests::SignIntermediateRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct SignIntermediateResponse {
    pub ca_chain: Option<Vec<String>>,
    pub certificate: String,
    pub issuing_ca: String,
    pub serial_number: String,
}

/// Response from executing
/// [SignSelfIssuedRequest][crate::api::pki::requests::SignSelfIssuedRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct SignSelfIssuedResponse {
    pub certificate: String,
    pub issuing_ca: String,
}