@@ -4,7 +4,7 @@ use const_oid::db::{
4
4
rfc5912:: ID_SHA_256 ,
5
5
} ;
6
6
use der:: {
7
- asn1:: { ContextSpecificExplicit , OctetString } ,
7
+ asn1:: { AnyCustomClassExplicit , OctetString } ,
8
8
Decode , Encode ,
9
9
} ;
10
10
use hex_literal:: hex;
@@ -199,8 +199,7 @@ fn decode_sample_pfx() {
199
199
for cert_bag in cert_bags {
200
200
match cert_bag. bag_id {
201
201
pkcs12:: PKCS_12_CERT_BAG_OID => {
202
- let cs: der:: asn1:: ContextSpecificExplicit < CertBag > =
203
- ContextSpecificExplicit :: from_der ( & cert_bag. bag_value ) . unwrap ( ) ;
202
+ let cs = AnyCustomClassExplicit :: < CertBag > :: from_der ( & cert_bag. bag_value ) . unwrap ( ) ;
204
203
let cb = cs. value ;
205
204
assert_eq ! (
206
205
include_bytes!( "examples/cert.der" ) ,
@@ -242,8 +241,10 @@ fn decode_sample_pfx() {
242
241
for safe_bag in safe_bags {
243
242
match safe_bag. bag_id {
244
243
pkcs12:: PKCS_12_PKCS8_KEY_BAG_OID => {
245
- let cs: ContextSpecificExplicit < EncryptedPrivateKeyInfoRef < ' _ > > =
246
- ContextSpecificExplicit :: from_der ( & safe_bag. bag_value ) . unwrap ( ) ;
244
+ let cs = AnyCustomClassExplicit :: < EncryptedPrivateKeyInfoRef < ' _ > > :: from_der (
245
+ & safe_bag. bag_value ,
246
+ )
247
+ . unwrap ( ) ;
247
248
let mut ciphertext = cs. value . encrypted_data . as_bytes ( ) . to_vec ( ) ;
248
249
let plaintext = cs
249
250
. value
@@ -606,8 +607,7 @@ fn decode_sample_pfx2() {
606
607
for safe_bag in safe_bags {
607
608
match safe_bag. bag_id {
608
609
pkcs12:: PKCS_12_CERT_BAG_OID => {
609
- let cs: ContextSpecificExplicit < CertBag > =
610
- ContextSpecificExplicit :: from_der ( & safe_bag. bag_value ) . unwrap ( ) ;
610
+ let cs = AnyCustomClassExplicit :: < CertBag > :: from_der ( & safe_bag. bag_value ) . unwrap ( ) ;
611
611
assert_eq ! (
612
612
include_bytes!( "examples/cert.der" ) ,
613
613
cs. value. cert_value. as_bytes( )
@@ -628,8 +628,10 @@ fn decode_sample_pfx2() {
628
628
for safe_bag in safe_bags {
629
629
match safe_bag. bag_id {
630
630
pkcs12:: PKCS_12_PKCS8_KEY_BAG_OID => {
631
- let cs: ContextSpecificExplicit < EncryptedPrivateKeyInfoRef < ' _ > > =
632
- ContextSpecificExplicit :: from_der ( & safe_bag. bag_value ) . unwrap ( ) ;
631
+ let cs = AnyCustomClassExplicit :: < EncryptedPrivateKeyInfoRef < ' _ > > :: from_der (
632
+ & safe_bag. bag_value ,
633
+ )
634
+ . unwrap ( ) ;
633
635
let mut ciphertext = cs. value . encrypted_data . as_bytes ( ) . to_vec ( ) ;
634
636
let plaintext = cs
635
637
. value
0 commit comments