File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ impl<'a> ::der::Tagged for EncKeyWithIdChoice<'a> {
266
266
fn tag ( & self ) -> :: der:: Tag {
267
267
match self {
268
268
Self :: String ( _) => <Utf8StringRef < ' a > as :: der:: FixedTag >:: TAG ,
269
- Self :: GeneralName ( _ ) => self . tag ( ) ,
269
+ Self :: GeneralName ( variant ) => variant . tag ( ) ,
270
270
}
271
271
}
272
272
}
@@ -298,3 +298,26 @@ pub struct PrivateKeyInfo {
298
298
) ]
299
299
pub attrs : Option < Attributes > ,
300
300
}
301
+
302
+ #[ cfg( test) ]
303
+ mod tests {
304
+ use der:: { Tag , TagNumber , asn1:: Ia5String } ;
305
+ use x509_cert:: ext:: pkix:: name:: GeneralName ;
306
+
307
+ use super :: EncKeyWithIdChoice ;
308
+
309
+ #[ test]
310
+ fn enc_key_with_id_choice_tag ( ) {
311
+ use der:: Tagged ;
312
+ let enc_key_choice = EncKeyWithIdChoice :: GeneralName ( GeneralName :: DnsName (
313
+ Ia5String :: new ( "test" ) . expect ( "valid Ia5String" ) ,
314
+ ) ) ;
315
+ assert_eq ! (
316
+ enc_key_choice. tag( ) ,
317
+ Tag :: ContextSpecific {
318
+ constructed: false ,
319
+ number: TagNumber ( 2 )
320
+ }
321
+ ) ;
322
+ }
323
+ }
You can’t perform that action at this time.
0 commit comments