vaultrs/api/transit/
responses.rs1use super::KeyType;
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[derive(Debug, Serialize, Deserialize)]
8pub struct ReadKeyResponse {
9 #[serde(rename = "type")]
10 pub key_type: KeyType,
11 pub deletion_allowed: bool,
12 pub derived: bool,
13 pub exportable: bool,
14 pub allow_plaintext_backup: bool,
15 pub keys: ReadKeyData,
17 pub min_decryption_version: u64,
18 pub min_encryption_version: u64,
19 pub name: String,
20 pub supports_encryption: bool,
21 pub supports_decryption: bool,
22 pub supports_derivation: bool,
23 pub supports_signing: bool,
24 pub imported: Option<bool>,
25}
26
27#[derive(Debug, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum ReadKeyData {
30 Symmetric(HashMap<String, u64>),
32 Asymmetric(HashMap<String, ReadPublicKeyEntry>),
34}
35
36#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
37pub struct ReadPublicKeyEntry {
38 pub creation_time: String,
40 pub name: String,
41 pub public_key: String,
42}
43
44#[derive(Deserialize, Debug, Serialize)]
47pub struct ListKeysResponse {
48 pub keys: Vec<String>,
49}
50
51#[derive(Debug, Serialize, Deserialize)]
54pub struct ExportKeyResponse {
55 pub name: String,
56 pub keys: HashMap<String, String>,
57}
58
59#[derive(Debug, Serialize, Deserialize)]
62pub struct EncryptDataResponse {
63 pub ciphertext: String,
64}
65
66#[derive(Debug, Serialize, Deserialize)]
69pub struct DecryptDataResponse {
70 pub plaintext: String,
71}
72
73#[derive(Debug, Serialize, Deserialize)]
76pub struct RewrapDataResponse {
77 pub ciphertext: String,
78}
79
80#[derive(Debug, Serialize, Deserialize)]
83pub struct GenerateDataKeyResponse {
84 pub plaintext: Option<String>,
85 pub ciphertext: String,
86}
87
88#[derive(Debug, Serialize, Deserialize)]
91pub struct GenerateRandomBytesResponse {
92 pub random_bytes: String,
93}
94
95#[derive(Debug, Serialize, Deserialize)]
98pub struct HashDataResponse {
99 pub sum: String,
100}
101
102#[derive(Debug, Serialize, Deserialize)]
105pub struct GenerateHmacResponse {
106 pub hmac: String,
107}
108
109#[derive(Debug, Serialize, Deserialize)]
112pub struct SignDataResponse {
113 pub signature: String,
114}
115
116#[derive(Debug, Serialize, Deserialize)]
119pub struct VerifySignedDataResponse {
120 pub valid: bool,
121}
122
123#[derive(Debug, Serialize, Deserialize)]
126pub struct BackupKeyResponse {
127 pub backup: String,
128}
129
130#[derive(Debug, Serialize, Deserialize)]
133pub struct ReadTransitCacheConfigurationResponse {
134 pub size: u64,
135}