bitwarden_api_api/models/
private_keys_response_model.rs

1/*
2 * Bitwarden Internal API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: latest
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use serde::{Deserialize, Serialize};
12
13use crate::models;
14
15/// PrivateKeysResponseModel : This response model is used to return the asymmetric encryption keys,
16/// and signature keys of an entity. This includes the private keys of the key pairs, (private key,
17/// signing key), and the public keys of the key pairs (unsigned public key, signed public key,
18/// verification key).
19#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
20pub struct PrivateKeysResponseModel {
21    #[serde(
22        rename = "object",
23        alias = "Object",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub object: Option<String>,
27    #[serde(
28        rename = "signatureKeyPair",
29        alias = "SignatureKeyPair",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub signature_key_pair: Option<Box<models::SignatureKeyPairResponseModel>>,
33    #[serde(
34        rename = "publicKeyEncryptionKeyPair",
35        alias = "PublicKeyEncryptionKeyPair"
36    )]
37    pub public_key_encryption_key_pair: Box<models::PublicKeyEncryptionKeyPairResponseModel>,
38    #[serde(
39        rename = "securityState",
40        alias = "SecurityState",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub security_state: Option<Box<models::SecurityStateModel>>,
44}
45
46impl PrivateKeysResponseModel {
47    /// This response model is used to return the asymmetric encryption keys, and signature keys of
48    /// an entity. This includes the private keys of the key pairs, (private key, signing key), and
49    /// the public keys of the key pairs (unsigned public key, signed public key, verification key).
50    pub fn new(
51        public_key_encryption_key_pair: models::PublicKeyEncryptionKeyPairResponseModel,
52    ) -> PrivateKeysResponseModel {
53        PrivateKeysResponseModel {
54            object: None,
55            signature_key_pair: None,
56            public_key_encryption_key_pair: Box::new(public_key_encryption_key_pair),
57            security_state: None,
58        }
59    }
60}