@@ -11,8 +11,8 @@ use derivative::Derivative;
11
11
use log:: { error, trace} ;
12
12
use parsec_interface:: operations:: list_providers:: ProviderInfo ;
13
13
use parsec_interface:: operations:: {
14
- list_clients, list_keys, psa_destroy_key, psa_export_public_key , psa_generate_key ,
15
- psa_import_key, psa_sign_hash, psa_verify_hash,
14
+ list_clients, list_keys, psa_destroy_key, psa_export_key , psa_export_public_key ,
15
+ psa_generate_key , psa_generate_random , psa_import_key, psa_sign_hash, psa_verify_hash,
16
16
} ;
17
17
use parsec_interface:: requests:: { Opcode , ProviderId , Result } ;
18
18
use psa_crypto:: types:: key;
@@ -22,15 +22,18 @@ use uuid::Uuid;
22
22
mod asym_sign;
23
23
mod context;
24
24
mod error;
25
+ mod generate_random;
25
26
mod key_management;
26
27
27
- const SUPPORTED_OPCODES : [ Opcode ; 6 ] = [
28
+ const SUPPORTED_OPCODES : [ Opcode ; 8 ] = [
28
29
Opcode :: PsaDestroyKey ,
29
30
Opcode :: PsaGenerateKey ,
30
31
Opcode :: PsaSignHash ,
31
32
Opcode :: PsaVerifyHash ,
32
33
Opcode :: PsaImportKey ,
33
34
Opcode :: PsaExportPublicKey ,
35
+ Opcode :: PsaExportKey ,
36
+ Opcode :: PsaGenerateRandom ,
34
37
] ;
35
38
36
39
/// Trusted Service provider structure
@@ -174,6 +177,23 @@ impl Provide for Provider {
174
177
self . psa_export_public_key_internal ( app_name, op)
175
178
}
176
179
180
+ fn psa_export_key (
181
+ & self ,
182
+ app_name : ApplicationName ,
183
+ op : psa_export_key:: Operation ,
184
+ ) -> Result < psa_export_key:: Result > {
185
+ trace ! ( "psa_export_key ingress" ) ;
186
+ self . psa_export_key_internal ( app_name, op)
187
+ }
188
+
189
+ fn psa_generate_random (
190
+ & self ,
191
+ op : psa_generate_random:: Operation ,
192
+ ) -> Result < psa_generate_random:: Result > {
193
+ trace ! ( "psa_generate_random ingress" ) ;
194
+ self . psa_generate_random_internal ( op)
195
+ }
196
+
177
197
fn psa_sign_hash (
178
198
& self ,
179
199
app_name : ApplicationName ,
0 commit comments