verdict_parser/x509/
ext_value.rs1use super::*;
2use crate::asn1::Boolean;
3use crate::asn1::Integer;
4use vstd::prelude::*;
5
6verus! {
7
8asn1! {
9 seq AuthorityKeyIdentifier {
11 #[optional] key_id: ASN1<ImplicitTag<OctetString>> = ASN1(ImplicitTag(tag_of!(IMPLICIT 0), OctetString)),
12 #[optional] auth_cert_issuer: placeholder_type!() = placeholder!(EXPLICIT 1),
14 #[optional] auth_cert_serial: ASN1<ImplicitTag<BigInt>> = ASN1(ImplicitTag(tag_of!(IMPLICIT 2), BigInt)),
15 }
16
17 seq BasicConstraints {
22 #[default(false)] is_ca: ASN1<Boolean> = ASN1(Boolean),
23 #[optional] path_len: ASN1<Integer> = ASN1(Integer),
24 }
25
26 seq PolicyInfo {
39 policy_id: ASN1<ObjectIdentifier> = ASN1(ObjectIdentifier),
40 #[optional] qualifiers: placeholder_type!() = placeholder!(SEQUENCE),
41 }
42
43 seq of CertificatePolicies(ASN1(PolicyInfo)): ASN1<PolicyInfo>;
45
46 seq of ExtendedKeyUsage(ASN1(ObjectIdentifier)): ASN1<ObjectIdentifier>;
47
48 seq NameConstraints {
61 #[optional] permitted: ASN1<ImplicitTag<GeneralSubtrees>> = ASN1(ImplicitTag(tag_of!(EXPLICIT 0), GeneralSubtrees)),
63 #[optional] excluded: ASN1<ImplicitTag<GeneralSubtrees>> = ASN1(ImplicitTag(tag_of!(EXPLICIT 1), GeneralSubtrees)),
64 }
65
66 seq of GeneralSubtrees(ASN1(GeneralSubtree)): ASN1<GeneralSubtree>;
67
68 seq GeneralSubtree {
75 base: GeneralName = GeneralName,
76 #[default(0i64)] min: ASN1<ImplicitTag<Integer>> = ASN1(ImplicitTag(tag_of!(IMPLICIT 0), Integer)),
77 #[optional] max: ASN1<ImplicitTag<Integer>> = ASN1(ImplicitTag(tag_of!(IMPLICIT 1), Integer)),
78 }
79
80 seq of AuthorityInfoAccess(ASN1(AccessDescription)): ASN1<AccessDescription>;
81
82 seq AccessDescription {
83 method: ASN1<ObjectIdentifier> = ASN1(ObjectIdentifier),
84 location: GeneralName = GeneralName,
85 }
86}
87
88oid_match_continuation! {
89 continuation ExtensionParam {
90 oid(AUTH_KEY_IDENT) =>
91 AuthorityKeyIdentifier(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(AuthorityKeyIdentifier)))): ASN1<ExplicitTag<ASN1<AuthorityKeyIdentifier>>>,
92
93 oid(SUBJECT_KEY_IDENT) =>
94 SubjectKeyIdentifier(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(OctetString)))): ASN1<ExplicitTag<ASN1<OctetString>>>,
95
96 oid(BASIC_CONSTRAINTS) =>
97 BasicConstraints(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(BasicConstraints)))): ASN1<ExplicitTag<ASN1<BasicConstraints>>>,
98
99 oid(CERT_POLICIES) =>
100 CertificatePolicies(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(CertificatePolicies)))): ASN1<ExplicitTag<ASN1<CertificatePolicies>>>,
101
102 oid(EXTENDED_KEY_USAGE) =>
103 ExtendedKeyUsage(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(ExtendedKeyUsage)))): ASN1<ExplicitTag<ASN1<ExtendedKeyUsage>>>,
104
105 oid(KEY_USAGE) =>
106 KeyUsage(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(BitString)))): ASN1<ExplicitTag<ASN1<BitString>>>,
107
108 oid(SUBJECT_ALT_NAME) =>
109 SubjectAltName(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(GeneralNames)))): ASN1<ExplicitTag<ASN1<GeneralNames>>>,
110
111 oid(NAME_CONSTRAINTS) =>
112 NameConstraints(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(NameConstraints)))): ASN1<ExplicitTag<ASN1<NameConstraints>>>,
113
114 oid(AUTH_INFO_ACCESS) =>
115 AuthorityInfoAccess(ASN1(ExplicitTag(tag_of!(OCTET_STRING), ASN1(AuthorityInfoAccess)))): ASN1<ExplicitTag<ASN1<AuthorityInfoAccess>>>,
116
117 _ => Other(ASN1(OctetString)): ASN1<OctetString>,
118 }
119}
120
121}