verdict_parser/x509/rdn.rs
1use super::*;
2use vstd::prelude::*;
3
4verus! {
5
6// In X.509: RelativeDistinguishedName ::= SET OF AttributeTypeAndValue
7// TODO: support SET OF instead of using a sequence
8asn1! {
9 set of RDN(ASN1(AttributeTypeAndValue)): ASN1<AttributeTypeAndValue>;
10}
11
12}
13
14#[cfg(test)]
15mod test {
16 use super::*;
17
18 verus! {
19 /// Check that all trait bounds and preconditions are satisfied
20 #[test]
21 fn is_combinator() {
22 let _ = ASN1(RDN).parse(&[]);
23 }
24 }
25
26 #[test]
27 fn sanity() {
28 assert!(ASN1(RDN)
29 .parse(&[0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x50, 0x41,])
30 .is_ok());
31 }
32}