nethsm_sdk_rs/models/
private_key.rs1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12#[non_exhaustive]
13pub struct PrivateKey {
14 #[serde(rename = "mechanisms")]
15 pub mechanisms: Vec<crate::models::KeyMechanism>,
16 #[serde(rename = "type")]
17 pub r#type: crate::models::KeyType,
18 #[serde(rename = "private")]
19 pub private: Box<crate::models::KeyPrivateData>,
20 #[serde(rename = "restrictions", skip_serializing_if = "Option::is_none")]
21 pub restrictions: Option<Box<crate::models::KeyRestrictions>>,
22}
23
24impl PrivateKey {
25 pub fn new(
26 mechanisms: Vec<crate::models::KeyMechanism>,
27 r#type: crate::models::KeyType,
28 private: crate::models::KeyPrivateData,
29 ) -> PrivateKey {
30 PrivateKey {
31 mechanisms,
32 r#type,
33 private: Box::new(private),
34 restrictions: None,
35 }
36 }
37}