nethsm_sdk_rs/models/
public_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, Serialize, Deserialize)]
12#[non_exhaustive]
13pub struct PublicKey {
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 = "restrictions")]
19    pub restrictions: Box<crate::models::KeyRestrictions>,
20    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
21    pub public: Option<Box<crate::models::KeyPublicData>>,
22    #[serde(rename = "operations")]
23    pub operations: i32,
24}
25
26impl PublicKey {
27    pub fn new(
28        mechanisms: Vec<crate::models::KeyMechanism>,
29        r#type: crate::models::KeyType,
30        restrictions: crate::models::KeyRestrictions,
31        operations: i32,
32    ) -> PublicKey {
33        PublicKey {
34            mechanisms,
35            r#type,
36            restrictions: Box::new(restrictions),
37            public: None,
38            operations,
39        }
40    }
41}