File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ use der::Encode;
11
11
#[ cfg( feature = "pem" ) ]
12
12
use der:: EncodePem ;
13
13
14
+ #[ cfg( feature = "encryption" ) ]
15
+ use pkcs8:: EncryptedPrivateKeyInfoOwned ;
16
+
14
17
/// Ed25519 PKCS#8 private key plaintext encoded as ASN.1 DER
15
18
#[ cfg( feature = "encryption" ) ]
16
19
const ED25519_DER_PLAINTEXT_EXAMPLE : & [ u8 ] = include_bytes ! ( "examples/ed25519-priv-pkcs8v1.der" ) ;
@@ -184,7 +187,8 @@ fn decrypt_ed25519_der_encpriv_aes256_scrypt() {
184
187
#[ cfg( feature = "encryption" ) ]
185
188
#[ test]
186
189
fn decrypt_ed25519_der_encpriv_aes128_gcm_scrypt ( ) {
187
- let enc_pk = EncryptedPrivateKeyInfo :: try_from ( ED25519_DER_AES128_GCM_SCRYPT_EXAMPLE ) . unwrap ( ) ;
190
+ let enc_pk =
191
+ EncryptedPrivateKeyInfoOwned :: try_from ( ED25519_DER_AES128_GCM_SCRYPT_EXAMPLE ) . unwrap ( ) ;
188
192
let pk = enc_pk. decrypt ( PASSWORD ) . unwrap ( ) ;
189
193
assert_eq ! ( pk. as_bytes( ) , ED25519_DER_PLAINTEXT_EXAMPLE ) ;
190
194
}
@@ -213,7 +217,8 @@ fn encrypt_ed25519_der_encpriv_aes128_gcm_scrypt() {
213
217
#[ cfg( feature = "encryption" ) ]
214
218
#[ test]
215
219
fn decrypt_ed25519_der_encpriv_aes256_gcm_scrypt ( ) {
216
- let enc_pk = EncryptedPrivateKeyInfo :: try_from ( ED25519_DER_AES256_GCM_SCRYPT_EXAMPLE ) . unwrap ( ) ;
220
+ let enc_pk =
221
+ EncryptedPrivateKeyInfoOwned :: try_from ( ED25519_DER_AES256_GCM_SCRYPT_EXAMPLE ) . unwrap ( ) ;
217
222
let pk = enc_pk. decrypt ( PASSWORD ) . unwrap ( ) ;
218
223
assert_eq ! ( pk. as_bytes( ) , ED25519_DER_PLAINTEXT_EXAMPLE ) ;
219
224
}
You can’t perform that action at this time.
0 commit comments