@@ -12,7 +12,7 @@ use parsec_interface::operations::psa_destroy_key::Operation as PsaDestroyKey;
1212use parsec_interface:: operations:: psa_export_public_key:: Operation as PsaExportPublicKey ;
1313use parsec_interface:: operations:: psa_generate_key:: Operation as PsaGenerateKey ;
1414use 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 ;
1616use parsec_interface:: operations:: psa_sign_hash:: Operation as PsaSignHash ;
1717use parsec_interface:: operations:: psa_verify_hash:: Operation as PsaVerifyHash ;
1818use parsec_interface:: operations:: { NativeOperation , NativeResult } ;
@@ -117,23 +117,24 @@ use std::collections::HashSet;
117117///# use parsec_client::core::interface::requests::ProviderID;
118118///# let client: BasicClient = BasicClient::new(AuthenticationData::AppIdentity(String::from("app-name")));
119119///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};
121121///
122122///let key_name = String::from("rusty key 🔑");
123123///// This algorithm identifier will be used within the key policy (i.e. what
124124///// algorithms are usable with the key) and for indicating the desired
125125///// algorithm for each operation involving the key.
126126///let asym_sign_algo = AsymmetricSignature::RsaPkcs1v15Sign {
127- /// hash_alg: Hash::Sha256,
127+ /// hash_alg: Hash::Sha256.into() ,
128128///};
129129///
130130///// The key attributes define and limit the usage of the key material stored
131131///// 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 {
137138/// export: true,
138139/// copy: true,
139140/// cache: true,
@@ -145,7 +146,7 @@ use std::collections::HashSet;
145146/// verify_hash: false,
146147/// derive: false,
147148/// },
148- /// key_algorithm : asym_sign_algo.into(),
149+ /// permitted_algorithms : asym_sign_algo.into(),
149150/// },
150151///};
151152///
@@ -276,7 +277,7 @@ impl BasicClient {
276277 ///
277278 /// See the operation-specific response codes returned by the service
278279 /// [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 < ( ) > {
280281 let crypto_provider = self . can_provide_crypto ( ) ?;
281282
282283 let op = PsaGenerateKey {
@@ -356,7 +357,7 @@ impl BasicClient {
356357 & self ,
357358 key_name : String ,
358359 key_material : Vec < u8 > ,
359- key_attributes : KeyAttributes ,
360+ key_attributes : Attributes ,
360361 ) -> Result < ( ) > {
361362 let crypto_provider = self . can_provide_crypto ( ) ?;
362363
@@ -415,7 +416,7 @@ impl BasicClient {
415416 /// **[Cryptographic Operation]** Create an asymmetric signature on a pre-computed message digest.
416417 ///
417418 /// 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).
419420 ///
420421 /// The signature will be created with the algorithm defined in
421422 /// `sign_algorithm`, but only after checking that the key policy
@@ -466,7 +467,7 @@ impl BasicClient {
466467 /// **[Cryptographic Operation]** Verify an existing asymmetric signature over a pre-computed message digest.
467468 ///
468469 /// 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).
470471 ///
471472 /// The signature will be verifyied with the algorithm defined in
472473 /// `sign_algorithm`, but only after checking that the key policy
0 commit comments