11//! Structs for the resolved Base Types
22use std:: collections:: { BTreeSet , HashMap } ;
33
4- use crate :: resolver:: asn:: structs:: types:: constraints:: Asn1ConstraintValueSet ;
4+ use crate :: resolver:: asn:: structs:: types:: { constraints:: Asn1ConstraintValueSet , Asn1ResolvedTag } ;
55
66#[ derive( Debug , Clone ) ]
77pub ( crate ) enum ResolvedBaseType {
@@ -26,6 +26,7 @@ pub(crate) struct Asn1ResolvedInteger {
2626 pub ( crate ) signed : bool ,
2727 pub ( crate ) resolved_constraints : Option < Asn1ConstraintValueSet > ,
2828 pub ( crate ) named_values : Option < HashMap < String , i128 > > ,
29+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
2930}
3031
3132impl Default for Asn1ResolvedInteger {
@@ -35,6 +36,7 @@ impl Default for Asn1ResolvedInteger {
3536 signed : true ,
3637 named_values : None ,
3738 resolved_constraints : None ,
39+ tag : None ,
3840 }
3941 }
4042}
@@ -49,6 +51,7 @@ pub(crate) struct Asn1ResolvedEnumerated {
4951 pub ( crate ) excepts : Option < BTreeSet < i128 > > ,
5052 pub ( crate ) named_root_values : Vec < ( String , i128 ) > ,
5153 pub ( crate ) named_ext_values : Vec < ( String , i128 ) > ,
54+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
5255}
5356
5457impl Default for Asn1ResolvedEnumerated {
@@ -62,6 +65,7 @@ impl Default for Asn1ResolvedEnumerated {
6265 excepts : None ,
6366 named_root_values : vec ! [ ] ,
6467 named_ext_values : vec ! [ ] ,
68+ tag : None ,
6569 }
6670 }
6771}
@@ -74,33 +78,45 @@ pub(crate) struct Asn1ResolvedBitString {
7478
7579 // We support only up to 128 named bits, if more than that is required, change this to appropriate. value
7680 pub ( crate ) named_values : HashMap < String , u8 > ,
81+
82+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
7783}
7884
7985// Just an empty structure for Resolved `BOOLEAN` type.
8086#[ derive( Debug , Default , Clone ) ]
81- pub ( crate ) struct Asn1ResolvedBoolean ;
87+ pub ( crate ) struct Asn1ResolvedBoolean {
88+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
89+ }
8290
8391// Just an empty structure for Resolved `NULL` type.
8492#[ derive( Debug , Default , Clone ) ]
85- pub ( crate ) struct Asn1ResolvedNull ;
93+ pub ( crate ) struct Asn1ResolvedNull {
94+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
95+ }
8696
87- // Just an empty structure for Resolved `NULL ` type.
97+ // Just an empty structure for Resolved `REAL ` type.
8898#[ derive( Debug , Default , Clone ) ]
89- pub ( crate ) struct Asn1ResolvedReal ;
99+ pub ( crate ) struct Asn1ResolvedReal {
100+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
101+ }
90102
91103// A structure representing a Resolved `OCTET STRING`. `SIZE` Constraint is resolved as well. The
92104// `CONTAINING` Constraint is not resolved.
93105#[ derive( Debug , Default , Clone ) ]
94106pub ( crate ) struct Asn1ResolvedOctetString {
95107 pub ( crate ) size : Option < Asn1ConstraintValueSet > ,
108+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
96109}
97110
98111// A structure representing a Resolved `CharacterString`. `SIZE` Constraint is resolved as well. The
99112#[ derive( Debug , Default , Clone ) ]
100113pub ( crate ) struct Asn1ResolvedCharacterString {
101114 pub ( crate ) str_type : String ,
102115 pub ( crate ) size : Option < Asn1ConstraintValueSet > ,
116+ pub ( crate ) tag : Option < Asn1ResolvedTag > ,
103117}
104118
105119#[ derive( Debug , Default , Clone ) ]
106- pub ( crate ) struct Asn1ResolvedObjectIdentifier ;
120+ pub ( crate ) struct Asn1ResolvedObjectIdentifier {
121+ pub ( crate ) tag : Asn1ResolvedTag ,
122+ }
0 commit comments