@@ -173,7 +173,7 @@ use zeroize::Zeroizing;
173173///};
174174///
175175///client
176- /// .psa_generate_key(key_name.clone() , key_attrs)
176+ /// .psa_generate_key(& key_name, key_attrs)
177177/// .expect("Failed to create key!");
178178///```
179179#[ derive( Debug ) ]
@@ -469,11 +469,11 @@ impl BasicClient {
469469 ///
470470 /// See the operation-specific response codes returned by the service
471471 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_generate_key.html#specific-response-status-codes).
472- pub fn psa_generate_key ( & self , key_name : String , key_attributes : Attributes ) -> Result < ( ) > {
472+ pub fn psa_generate_key ( & self , key_name : & str , key_attributes : Attributes ) -> Result < ( ) > {
473473 let crypto_provider = self . can_provide_crypto ( ) ?;
474474
475475 let op = PsaGenerateKey {
476- key_name,
476+ key_name : String :: from ( key_name ) ,
477477 attributes : key_attributes,
478478 } ;
479479
@@ -499,10 +499,12 @@ impl BasicClient {
499499 ///
500500 /// See the operation-specific response codes returned by the service
501501 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_destroy_key.html#specific-response-status-codes).
502- pub fn psa_destroy_key ( & self , key_name : String ) -> Result < ( ) > {
502+ pub fn psa_destroy_key ( & self , key_name : & str ) -> Result < ( ) > {
503503 let crypto_provider = self . can_provide_crypto ( ) ?;
504504
505- let op = PsaDestroyKey { key_name } ;
505+ let op = PsaDestroyKey {
506+ key_name : String :: from ( key_name) ,
507+ } ;
506508
507509 let _ = self . op_client . process_operation (
508510 NativeOperation :: PsaDestroyKey ( op) ,
@@ -541,15 +543,15 @@ impl BasicClient {
541543 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_import_key.html#specific-response-status-codes).
542544 pub fn psa_import_key (
543545 & self ,
544- key_name : String ,
546+ key_name : & str ,
545547 key_material : & [ u8 ] ,
546548 key_attributes : Attributes ,
547549 ) -> Result < ( ) > {
548550 let key_material = Secret :: new ( key_material. to_vec ( ) ) ;
549551 let crypto_provider = self . can_provide_crypto ( ) ?;
550552
551553 let op = PsaImportKey {
552- key_name,
554+ key_name : String :: from ( key_name ) ,
553555 attributes : key_attributes,
554556 data : key_material,
555557 } ;
@@ -577,10 +579,12 @@ impl BasicClient {
577579 ///
578580 /// See the operation-specific response codes returned by the service
579581 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_export_public_key.html#specific-response-status-codes).
580- pub fn psa_export_public_key ( & self , key_name : String ) -> Result < Vec < u8 > > {
582+ pub fn psa_export_public_key ( & self , key_name : & str ) -> Result < Vec < u8 > > {
581583 let crypto_provider = self . can_provide_crypto ( ) ?;
582584
583- let op = PsaExportPublicKey { key_name } ;
585+ let op = PsaExportPublicKey {
586+ key_name : String :: from ( key_name) ,
587+ } ;
584588
585589 let res = self . op_client . process_operation (
586590 NativeOperation :: PsaExportPublicKey ( op) ,
@@ -611,10 +615,12 @@ impl BasicClient {
611615 ///
612616 /// See the operation-specific response codes returned by the service
613617 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_export_key.html#specific-response-status-codes).
614- pub fn psa_export_key ( & self , key_name : String ) -> Result < Vec < u8 > > {
618+ pub fn psa_export_key ( & self , key_name : & str ) -> Result < Vec < u8 > > {
615619 let crypto_provider = self . can_provide_crypto ( ) ?;
616620
617- let op = PsaExportKey { key_name } ;
621+ let op = PsaExportKey {
622+ key_name : String :: from ( key_name) ,
623+ } ;
618624
619625 let res = self . op_client . process_operation (
620626 NativeOperation :: PsaExportKey ( op) ,
@@ -652,15 +658,15 @@ impl BasicClient {
652658 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_sign_hash.html#specific-response-status-codes).
653659 pub fn psa_sign_hash (
654660 & self ,
655- key_name : String ,
661+ key_name : & str ,
656662 hash : & [ u8 ] ,
657663 sign_algorithm : AsymmetricSignature ,
658664 ) -> Result < Vec < u8 > > {
659665 let hash = Zeroizing :: new ( hash. to_vec ( ) ) ;
660666 let crypto_provider = self . can_provide_crypto ( ) ?;
661667
662668 let op = PsaSignHash {
663- key_name,
669+ key_name : String :: from ( key_name ) ,
664670 alg : sign_algorithm,
665671 hash,
666672 } ;
@@ -701,7 +707,7 @@ impl BasicClient {
701707 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_verify_hash.html#specific-response-status-codes).
702708 pub fn psa_verify_hash (
703709 & self ,
704- key_name : String ,
710+ key_name : & str ,
705711 hash : & [ u8 ] ,
706712 sign_algorithm : AsymmetricSignature ,
707713 signature : & [ u8 ] ,
@@ -711,7 +717,7 @@ impl BasicClient {
711717 let crypto_provider = self . can_provide_crypto ( ) ?;
712718
713719 let op = PsaVerifyHash {
714- key_name,
720+ key_name : String :: from ( key_name ) ,
715721 alg : sign_algorithm,
716722 hash,
717723 signature,
@@ -744,15 +750,15 @@ impl BasicClient {
744750 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_sign_message.html#specific-response-status-codes).
745751 pub fn psa_sign_message (
746752 & self ,
747- key_name : String ,
753+ key_name : & str ,
748754 msg : & [ u8 ] ,
749755 sign_algorithm : AsymmetricSignature ,
750756 ) -> Result < Vec < u8 > > {
751757 let message = Zeroizing :: new ( msg. to_vec ( ) ) ;
752758 let crypto_provider = self . can_provide_crypto ( ) ?;
753759
754760 let op = PsaSignMessage {
755- key_name,
761+ key_name : String :: from ( key_name ) ,
756762 alg : sign_algorithm,
757763 message,
758764 } ;
@@ -790,7 +796,7 @@ impl BasicClient {
790796 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_verify_message.html#specific-response-status-codes).
791797 pub fn psa_verify_message (
792798 & self ,
793- key_name : String ,
799+ key_name : & str ,
794800 msg : & [ u8 ] ,
795801 sign_algorithm : AsymmetricSignature ,
796802 signature : & [ u8 ] ,
@@ -800,7 +806,7 @@ impl BasicClient {
800806 let crypto_provider = self . can_provide_crypto ( ) ?;
801807
802808 let op = PsaVerifyMessage {
803- key_name,
809+ key_name : String :: from ( key_name ) ,
804810 alg : sign_algorithm,
805811 message,
806812 signature,
@@ -836,7 +842,7 @@ impl BasicClient {
836842 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_asymmetric_encrypt.html#specific-response-status-codes).
837843 pub fn psa_asymmetric_encrypt (
838844 & self ,
839- key_name : String ,
845+ key_name : & str ,
840846 encrypt_alg : AsymmetricEncryption ,
841847 plaintext : & [ u8 ] ,
842848 salt : Option < & [ u8 ] > ,
@@ -845,7 +851,7 @@ impl BasicClient {
845851 let crypto_provider = self . can_provide_crypto ( ) ?;
846852
847853 let op = PsaAsymEncrypt {
848- key_name,
854+ key_name : String :: from ( key_name ) ,
849855 alg : encrypt_alg,
850856 plaintext : plaintext. to_vec ( ) . into ( ) ,
851857 salt,
@@ -888,7 +894,7 @@ impl BasicClient {
888894 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_asymmetric_decrypt.html#specific-response-status-codes).
889895 pub fn psa_asymmetric_decrypt (
890896 & self ,
891- key_name : String ,
897+ key_name : & str ,
892898 encrypt_alg : AsymmetricEncryption ,
893899 ciphertext : & [ u8 ] ,
894900 salt : Option < & [ u8 ] > ,
@@ -897,7 +903,7 @@ impl BasicClient {
897903 let crypto_provider = self . can_provide_crypto ( ) ?;
898904
899905 let op = PsaAsymDecrypt {
900- key_name,
906+ key_name : String :: from ( key_name ) ,
901907 alg : encrypt_alg,
902908 ciphertext : Zeroizing :: new ( ciphertext. to_vec ( ) ) ,
903909 salt,
@@ -998,7 +1004,7 @@ impl BasicClient {
9981004 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_aead_encrypt.html#specific-response-status-codes).
9991005 pub fn psa_aead_encrypt (
10001006 & self ,
1001- key_name : String ,
1007+ key_name : & str ,
10021008 encrypt_alg : Aead ,
10031009 nonce : & [ u8 ] ,
10041010 additional_data : & [ u8 ] ,
@@ -1007,7 +1013,7 @@ impl BasicClient {
10071013 let crypto_provider = self . can_provide_crypto ( ) ?;
10081014
10091015 let op = PsaAeadEncrypt {
1010- key_name,
1016+ key_name : String :: from ( key_name ) ,
10111017 alg : encrypt_alg,
10121018 nonce : nonce. to_vec ( ) . into ( ) ,
10131019 additional_data : additional_data. to_vec ( ) . into ( ) ,
@@ -1051,7 +1057,7 @@ impl BasicClient {
10511057 /// [here](https://parallaxsecond.github.io/parsec-book/parsec_client/operations/psa_aead_decrypt.html#specific-response-status-codes).
10521058 pub fn psa_aead_decrypt (
10531059 & self ,
1054- key_name : String ,
1060+ key_name : & str ,
10551061 encrypt_alg : Aead ,
10561062 nonce : & [ u8 ] ,
10571063 additional_data : & [ u8 ] ,
@@ -1060,7 +1066,7 @@ impl BasicClient {
10601066 let crypto_provider = self . can_provide_crypto ( ) ?;
10611067
10621068 let op = PsaAeadDecrypt {
1063- key_name,
1069+ key_name : String :: from ( key_name ) ,
10641070 alg : encrypt_alg,
10651071 nonce : nonce. to_vec ( ) . into ( ) ,
10661072 additional_data : additional_data. to_vec ( ) . into ( ) ,
@@ -1103,12 +1109,12 @@ impl BasicClient {
11031109 pub fn psa_raw_key_agreement (
11041110 & self ,
11051111 alg : RawKeyAgreement ,
1106- private_key_name : String ,
1112+ private_key_name : & str ,
11071113 peer_key : & [ u8 ] ,
11081114 ) -> Result < Vec < u8 > > {
11091115 let op = PsaRawKeyAgreement {
11101116 alg,
1111- private_key_name,
1117+ private_key_name : String :: from ( private_key_name ) ,
11121118 peer_key : Zeroizing :: new ( peer_key. to_vec ( ) ) ,
11131119 } ;
11141120 let crypto_provider = self . can_provide_crypto ( ) ?;
0 commit comments