parsec_interface/operations/psa_import_key.rs
1// Copyright 2019 Contributors to the Parsec project.
2// SPDX-License-Identifier: Apache-2.0
3//! # PsaImportKey operation
4//!
5//! Import a key in binary format.
6
7use super::psa_key_attributes::Attributes;
8use derivative::Derivative;
9
10/// Native object for cryptographic key importing operation.
11#[derive(Derivative)]
12#[derivative(Debug)]
13pub struct Operation {
14 /// `key_name` specifies a name by which the service will identify the key. Key
15 /// name must be unique per application.
16 pub key_name: String,
17 /// `attributes` specifies the attributes for the new key.
18 pub attributes: Attributes,
19 /// `data` contains the bytes for the key,
20 /// formatted in accordance with the requirements of the provider for the key type
21 /// specified in `attributes`.
22 // Debug is not derived for this because it could expose secrets if printed or logged
23 // somewhere
24 #[derivative(Debug = "ignore")]
25 pub data: crate::secrecy::Secret<Vec<u8>>,
26}
27
28/// Native object for the result of a cryptographic key import operation.
29///
30/// The true result is sent in the `status` field of the response header.
31#[derive(Copy, Clone, Debug)]
32pub struct Result;