Skip to content

Commit fb4becf

Browse files
committed
pkcs12: move to EncryptedPrivateKeyInfoRef
Signed-off-by: Arthur Gautier <[email protected]>
1 parent 334e120 commit fb4becf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkcs12/tests/cert_tests.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use pkcs8::{
1313
self,
1414
pbes2::{AES_256_CBC_OID, HMAC_WITH_SHA256_OID, PBES2_OID, PBKDF2_OID},
1515
},
16-
EncryptedPrivateKeyInfo,
16+
EncryptedPrivateKeyInfoRef,
1717
};
1818
use spki::AlgorithmIdentifierOwned;
1919

@@ -242,9 +242,9 @@ fn decode_sample_pfx() {
242242
for safe_bag in safe_bags {
243243
match safe_bag.bag_id {
244244
pkcs12::PKCS_12_PKCS8_KEY_BAG_OID => {
245-
let cs: ContextSpecific<EncryptedPrivateKeyInfo> =
245+
let cs: ContextSpecific<EncryptedPrivateKeyInfoRef<'_>> =
246246
ContextSpecific::from_der(&safe_bag.bag_value).unwrap();
247-
let mut ciphertext = cs.value.encrypted_data.to_vec();
247+
let mut ciphertext = cs.value.encrypted_data.as_bytes().to_vec();
248248
let plaintext = cs
249249
.value
250250
.encryption_algorithm
@@ -628,9 +628,9 @@ fn decode_sample_pfx2() {
628628
for safe_bag in safe_bags {
629629
match safe_bag.bag_id {
630630
pkcs12::PKCS_12_PKCS8_KEY_BAG_OID => {
631-
let cs: ContextSpecific<EncryptedPrivateKeyInfo> =
631+
let cs: ContextSpecific<EncryptedPrivateKeyInfoRef<'_>> =
632632
ContextSpecific::from_der(&safe_bag.bag_value).unwrap();
633-
let mut ciphertext = cs.value.encrypted_data.to_vec();
633+
let mut ciphertext = cs.value.encrypted_data.as_bytes().to_vec();
634634
let plaintext = cs
635635
.value
636636
.encryption_algorithm

0 commit comments

Comments
 (0)