@@ -6,18 +6,7 @@ use parsec_client::core::interface::operations::psa_key_attributes::*;
6
6
use parsec_client:: core:: interface:: requests:: ResponseStatus ;
7
7
use parsec_client:: core:: interface:: requests:: Result ;
8
8
use picky_asn1:: wrapper:: IntegerAsn1 ;
9
- use serde:: { Deserialize , Serialize } ;
10
-
11
- // The RSA Public Key data are DER encoded with the following representation:
12
- // RSAPublicKey ::= SEQUENCE {
13
- // modulus INTEGER, -- n
14
- // publicExponent INTEGER -- e
15
- // }
16
- #[ derive( Serialize , Deserialize , Debug ) ]
17
- struct RsaPublicKey {
18
- modulus : IntegerAsn1 ,
19
- public_exponent : IntegerAsn1 ,
20
- }
9
+ use picky_asn1_x509:: RSAPublicKey ;
21
10
22
11
const KEY_DATA : [ u8 ; 140 ] = [
23
12
48 , 129 , 137 , 2 , 129 , 129 , 0 , 153 , 165 , 220 , 135 , 89 , 101 , 254 , 229 , 28 , 33 , 138 , 247 , 20 , 102 ,
@@ -83,7 +72,7 @@ fn check_format_import1() -> Result<()> {
83
72
let mut client = TestClient :: new ( ) ;
84
73
let key_name = String :: from ( "check_format_import" ) ;
85
74
86
- let public_key = RsaPublicKey {
75
+ let public_key = RSAPublicKey {
87
76
modulus : IntegerAsn1 :: from_unsigned_bytes_be ( example_modulus_1024 ( ) ) ,
88
77
public_exponent : IntegerAsn1 :: from_unsigned_bytes_be ( vec ! [ 0x01 , 0x00 , 0x01 ] ) ,
89
78
} ;
@@ -100,7 +89,7 @@ fn check_format_import2() -> Result<()> {
100
89
let mut client = TestClient :: new ( ) ;
101
90
let key_name = String :: from ( "check_format_import2" ) ;
102
91
103
- let public_key = RsaPublicKey {
92
+ let public_key = RSAPublicKey {
104
93
modulus : IntegerAsn1 :: from_unsigned_bytes_be ( example_modulus_1024 ( ) ) ,
105
94
public_exponent : IntegerAsn1 :: from_unsigned_bytes_be ( vec ! [ 0x01 , 0x00 , 0x01 ] ) ,
106
95
} ;
@@ -146,7 +135,7 @@ fn check_format_import3() -> Result<()> {
146
135
let mut client = TestClient :: new ( ) ;
147
136
let key_name = String :: from ( "check_format_import3" ) ;
148
137
149
- let public_key = RsaPublicKey {
138
+ let public_key = RSAPublicKey {
150
139
modulus : IntegerAsn1 :: from_unsigned_bytes_be ( vec ! [ 0xDE ; 1024 ] ) ,
151
140
public_exponent : IntegerAsn1 :: from_unsigned_bytes_be ( vec ! [ 0x01 , 0x00 , 0x01 ] ) ,
152
141
} ;
@@ -194,7 +183,7 @@ fn failed_imported_key_should_be_removed() -> Result<()> {
194
183
let mut client = TestClient :: new ( ) ;
195
184
let key_name = String :: from ( "failed_imported_key_should_be_removed" ) ;
196
185
197
- let public_key = RsaPublicKey {
186
+ let public_key = RSAPublicKey {
198
187
modulus : IntegerAsn1 :: from_unsigned_bytes_be ( example_modulus_1024 ( ) ) ,
199
188
public_exponent : IntegerAsn1 :: from_unsigned_bytes_be ( vec ! [ 0x01 , 0x00 , 0x01 ] ) ,
200
189
} ;
0 commit comments