@@ -12,7 +12,7 @@ use parsec_interface::operations::psa_destroy_key::Operation as PsaDestroyKey;
12
12
use parsec_interface:: operations:: psa_export_public_key:: Operation as PsaExportPublicKey ;
13
13
use parsec_interface:: operations:: psa_generate_key:: Operation as PsaGenerateKey ;
14
14
use parsec_interface:: operations:: psa_import_key:: Operation as PsaImportKey ;
15
- use parsec_interface:: operations:: psa_key_attributes:: KeyAttributes ;
15
+ use parsec_interface:: operations:: psa_key_attributes:: Attributes ;
16
16
use parsec_interface:: operations:: psa_sign_hash:: Operation as PsaSignHash ;
17
17
use parsec_interface:: operations:: psa_verify_hash:: Operation as PsaVerifyHash ;
18
18
use parsec_interface:: operations:: { NativeOperation , NativeResult } ;
@@ -117,23 +117,24 @@ use std::collections::HashSet;
117
117
///# use parsec_client::core::interface::requests::ProviderID;
118
118
///# let client: BasicClient = BasicClient::new(AuthenticationData::AppIdentity(String::from("app-name")));
119
119
///use parsec_client::core::interface::operations::psa_algorithm::{Algorithm, AsymmetricSignature, Hash};
120
- ///use parsec_client::core::interface::operations::psa_key_attributes::{KeyAttributes, KeyPolicy, KeyType , UsageFlags};
120
+ ///use parsec_client::core::interface::operations::psa_key_attributes::{Attributes, Lifetime, Policy, Type , UsageFlags};
121
121
///
122
122
///let key_name = String::from("rusty key 🔑");
123
123
///// This algorithm identifier will be used within the key policy (i.e. what
124
124
///// algorithms are usable with the key) and for indicating the desired
125
125
///// algorithm for each operation involving the key.
126
126
///let asym_sign_algo = AsymmetricSignature::RsaPkcs1v15Sign {
127
- /// hash_alg: Hash::Sha256,
127
+ /// hash_alg: Hash::Sha256.into() ,
128
128
///};
129
129
///
130
130
///// The key attributes define and limit the usage of the key material stored
131
131
///// by the underlying cryptographic provider.
132
- ///let key_attrs = KeyAttributes {
133
- /// key_type: KeyType::RsaKeyPair,
134
- /// key_bits: 2048,
135
- /// key_policy: KeyPolicy {
136
- /// key_usage_flags: UsageFlags {
132
+ ///let key_attrs = Attributes {
133
+ /// lifetime: Lifetime::Persistent,
134
+ /// key_type: Type::RsaKeyPair,
135
+ /// bits: 2048,
136
+ /// policy: Policy {
137
+ /// usage_flags: UsageFlags {
137
138
/// export: true,
138
139
/// copy: true,
139
140
/// cache: true,
@@ -145,7 +146,7 @@ use std::collections::HashSet;
145
146
/// verify_hash: false,
146
147
/// derive: false,
147
148
/// },
148
- /// key_algorithm : asym_sign_algo.into(),
149
+ /// permitted_algorithms : asym_sign_algo.into(),
149
150
/// },
150
151
///};
151
152
///
@@ -276,7 +277,7 @@ impl BasicClient {
276
277
///
277
278
/// See the operation-specific response codes returned by the service
278
279
/// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_generate_key.html#specific-response-status-codes).
279
- pub fn psa_generate_key ( & self , key_name : String , key_attributes : KeyAttributes ) -> Result < ( ) > {
280
+ pub fn psa_generate_key ( & self , key_name : String , key_attributes : Attributes ) -> Result < ( ) > {
280
281
let crypto_provider = self . can_provide_crypto ( ) ?;
281
282
282
283
let op = PsaGenerateKey {
@@ -356,7 +357,7 @@ impl BasicClient {
356
357
& self ,
357
358
key_name : String ,
358
359
key_material : Vec < u8 > ,
359
- key_attributes : KeyAttributes ,
360
+ key_attributes : Attributes ,
360
361
) -> Result < ( ) > {
361
362
let crypto_provider = self . can_provide_crypto ( ) ?;
362
363
@@ -415,7 +416,7 @@ impl BasicClient {
415
416
/// **[Cryptographic Operation]** Create an asymmetric signature on a pre-computed message digest.
416
417
///
417
418
/// The key intended for signing **must** have its `sign_hash` flag set
418
- /// to `true` in its [key policy](https://docs.rs/parsec-interface/*/parsec_interface/operations/psa_key_attributes/struct.KeyPolicy .html).
419
+ /// to `true` in its [key policy](https://docs.rs/parsec-interface/*/parsec_interface/operations/psa_key_attributes/struct.Policy .html).
419
420
///
420
421
/// The signature will be created with the algorithm defined in
421
422
/// `sign_algorithm`, but only after checking that the key policy
@@ -466,7 +467,7 @@ impl BasicClient {
466
467
/// **[Cryptographic Operation]** Verify an existing asymmetric signature over a pre-computed message digest.
467
468
///
468
469
/// The key intended for signing **must** have its `verify_hash` flag set
469
- /// to `true` in its [key policy](https://docs.rs/parsec-interface/*/parsec_interface/operations/psa_key_attributes/struct.KeyPolicy .html).
470
+ /// to `true` in its [key policy](https://docs.rs/parsec-interface/*/parsec_interface/operations/psa_key_attributes/struct.Policy .html).
470
471
///
471
472
/// The signature will be verifyied with the algorithm defined in
472
473
/// `sign_algorithm`, but only after checking that the key policy
0 commit comments