1 pub mod bit_string; 2 pub mod date; 3 pub mod restricted_string; 4 pub mod tag; 5 pub mod wrapper; 6 7 use tag::Tag; 8 9 pub trait Asn1Type { 10 const TAG: Tag; 11 const NAME: &'static str; 12 } 13 14 impl Asn1Type for () { 15 const TAG: Tag = Tag::NULL; 16 const NAME: &'static str = "()"; 17 } 18 19 impl Asn1Type for String { 20 const TAG: Tag = Tag::UTF8_STRING; 21 const NAME: &'static str = "String"; 22 } 23 24 impl Asn1Type for bool { 25 const TAG: Tag = Tag::BOOLEAN; 26 const NAME: &'static str = "bool"; 27 } 28 29 impl Asn1Type for u8 { 30 const TAG: Tag = Tag::INTEGER; 31 const NAME: &'static str = "u8"; 32 } 33 34 impl Asn1Type for u16 { 35 const TAG: Tag = Tag::INTEGER; 36 const NAME: &'static str = "u16"; 37 } 38 39 impl Asn1Type for u32 { 40 const TAG: Tag = Tag::INTEGER; 41 const NAME: &'static str = "u32"; 42 } 43 44 impl Asn1Type for u64 { 45 const TAG: Tag = Tag::INTEGER; 46 const NAME: &'static str = "u64"; 47 } 48 49 impl Asn1Type for u128 { 50 const TAG: Tag = Tag::INTEGER; 51 const NAME: &'static str = "u128"; 52 } 53