Skip to main content

akeyless_api/models/
derive_key.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 DeriveKey {
16    /// for personal password manager
17    #[serde(rename = "accessibility", skip_serializing_if = "Option::is_none")]
18    pub accessibility: Option<String>,
19    /// Kdf algorithm
20    #[serde(rename = "alg")]
21    pub alg: String,
22    /// HashFunction the hash function to use (relevant for pbkdf2)
23    #[serde(rename = "hash-function", skip_serializing_if = "Option::is_none")]
24    pub hash_function: Option<String>,
25    /// IterationCount the number of iterations
26    #[serde(rename = "iter")]
27    pub iter: i64,
28    /// Set output format to JSON
29    #[serde(rename = "json", skip_serializing_if = "Option::is_none")]
30    pub json: Option<bool>,
31    /// KeyLength the byte length of the generated key
32    #[serde(rename = "key-len")]
33    pub key_len: i64,
34    /// MemorySizeInKb the memory paramter in kb (relevant for argon2id)
35    #[serde(rename = "mem", skip_serializing_if = "Option::is_none")]
36    pub mem: Option<i64>,
37    /// Static Secret full name
38    #[serde(rename = "name")]
39    pub name: String,
40    /// Parallelism the number of threads to use (relevant for argon2id)
41    #[serde(rename = "parallelism", skip_serializing_if = "Option::is_none")]
42    pub parallelism: Option<i64>,
43    /// Salt Base64 encoded salt value. If not provided, the salt will be generated as part of the operation. The salt should be securely-generated random bytes, minimum 64 bits, 128 bits is recommended
44    #[serde(rename = "salt", skip_serializing_if = "Option::is_none")]
45    pub salt: Option<String>,
46    /// Authentication token (see `/auth` and `/configure`)
47    #[serde(rename = "token", skip_serializing_if = "Option::is_none")]
48    pub token: Option<String>,
49    /// The universal identity token, Required only for universal_identity authentication
50    #[serde(rename = "uid-token", skip_serializing_if = "Option::is_none")]
51    pub uid_token: Option<String>,
52}
53
54impl DeriveKey {
55    pub fn new(alg: String, iter: i64, key_len: i64, name: String) -> DeriveKey {
56        DeriveKey {
57            accessibility: None,
58            alg,
59            hash_function: None,
60            iter,
61            json: None,
62            key_len,
63            mem: None,
64            name,
65            parallelism: None,
66            salt: None,
67            token: None,
68            uid_token: None,
69        }
70    }
71}
72