nethsm_sdk_rs/models/
private_key.rs

1/*
2 * NetHSM
3 *
4 * All endpoints expect exactly the specified JSON. Additional properties will cause a Bad Request Error (400). All HTTP errors contain a JSON structure with an explanation of type string. All [base64](https://tools.ietf.org/html/rfc4648#section-4) encoded values are Big Endian.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: Nitrokey <info@nitrokey.com>
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct PrivateKey {
13    #[serde(rename = "mechanisms")]
14    pub mechanisms: Vec<crate::models::KeyMechanism>,
15    #[serde(rename = "type")]
16    pub r#type: crate::models::KeyType,
17    #[serde(rename = "private")]
18    pub private: Box<crate::models::KeyPrivateData>,
19    #[serde(rename = "restrictions", skip_serializing_if = "Option::is_none")]
20    pub restrictions: Option<Box<crate::models::KeyRestrictions>>,
21}
22
23impl PrivateKey {
24    pub fn new(
25        mechanisms: Vec<crate::models::KeyMechanism>,
26        r#type: crate::models::KeyType,
27        private: crate::models::KeyPrivateData,
28    ) -> PrivateKey {
29        PrivateKey {
30            mechanisms,
31            r#type,
32            private: Box::new(private),
33            restrictions: None,
34        }
35    }
36}