Longfellow ZK 0290cb32

Loading...
Searching...
No Matches
mdoc_attribute_ids.h
1// Copyright 2025 Google LLC.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef PRIVACY_PROOFS_ZK_LIB_CIRCUITS_MDOC_MDOC_ATTRIBUTE_IDS_H_
16#define PRIVACY_PROOFS_ZK_LIB_CIRCUITS_MDOC_MDOC_ATTRIBUTE_IDS_H_
17
18#include <string_view>
19
20 namespace proofs {
21
22 struct MdocAttribute {
23 std::string_view identifier;
24 std::string_view documentspec;
25};
26
27 constexpr const char* kMDLNamespace = "org.iso.18013.5.1";
28 constexpr const char* kAAMVANamespace = "org.iso.18013.5.1.aamva";
29 constexpr const char* kEUAVNamespace = "eu.europa.ec.av.1";
30 constexpr const char* kEUDIPIDNamespace = "eu.europa.ec.eudi.pid.1";
31 constexpr const char* kISO23220Namespace = "org.iso.23220.1";
32 constexpr const char* kISO23220PhotoIDNamespace =
33 "org.iso.23220.photoID.1";
34 constexpr const char* kISO23220DTCNamespace = "org.iso.23220.dtc.1";
35
36 constexpr const char* kSupportedNamespaces[] = {
37 kMDLNamespace, kAAMVANamespace, kEUAVNamespace,
38 kEUDIPIDNamespace, kISO23220Namespace, kISO23220PhotoIDNamespace,
39 kISO23220DTCNamespace};
40
41 constexpr const char* kIDPassDocType = "com.google.wallet.idcard.1";
42 constexpr const char* kMDLDocType = "org.iso.18013.5.1.mDL";
43 constexpr const char* kEUAVDocType = "eu.europa.ec.av.1";
44 constexpr const char* kEUDIPIDDocType = "eu.europa.ec.eudi.pid.1";
45 constexpr const char* kISO23220PhotoIDDocType = "org.iso.23220.photoID.1";
46
47// Extracted from
48// https://github.com/ISOWG10/ISO-18013/blob/main/Working%20Documents/Working%20Draft%20WG%2010_N2549_ISO-IEC%2018013-5-%20Personal%20identification%20%E2%80%94%20ISO-compliant%20driving%20licence%20%E2%80%94%20Part%205-%20Mobile%20driving%20lic.pdf
49// https://www.aamva.org/getmedia/bb4fee66-592d-4d39-813a-8fdfd910268a/MobileDLGuidelines1-5.pdf
50 constexpr MdocAttribute kMdocAttributes[] = {
51 {"family_name", kMDLNamespace},
52 {"given_name", kMDLNamespace},
53 {"birth_date", kMDLNamespace},
54 {"issue_date", kMDLNamespace},
55 {"expiry_date", kMDLNamespace},
56 {"issuing_country", kMDLNamespace},
57 {"issuing_authority", kMDLNamespace},
58 {"document_number", kMDLNamespace},
59 {"portrait", kMDLNamespace},
60 {"driving_privileges", kMDLNamespace},
61 {"un_distinguishing_sign", kMDLNamespace},
62 {"administrative_number", kMDLNamespace},
63 {"sex", kMDLNamespace},
64 {"height", kMDLNamespace},
65 {"weight", kMDLNamespace},
66 {"eye_colour", kMDLNamespace},
67 {"hair_colour", kMDLNamespace},
68 {"birth_place", kMDLNamespace},
69 {"resident_address", kMDLNamespace},
70 {"portrait_capture_date", kMDLNamespace},
71 {"age_in_years", kMDLNamespace},
72 {"age_birth_year", kMDLNamespace},
73 {"age_over_10", kMDLNamespace},
74 {"age_over_11", kMDLNamespace},
75 {"age_over_12", kMDLNamespace},
76 {"age_over_13", kMDLNamespace},
77 {"age_over_14", kMDLNamespace},
78 {"age_over_15", kMDLNamespace},
79 {"age_over_16", kMDLNamespace},
80 {"age_over_17", kMDLNamespace},
81 {"age_over_18", kMDLNamespace},
82 {"age_over_19", kMDLNamespace},
83 {"age_over_20", kMDLNamespace},
84 {"age_over_21", kMDLNamespace},
85 {"age_over_23", kMDLNamespace},
86 {"age_over_25", kMDLNamespace},
87 {"age_over_50", kMDLNamespace},
88 {"age_over_55", kMDLNamespace},
89 {"age_over_60", kMDLNamespace},
90 {"age_over_65", kMDLNamespace},
91 {"age_over_70", kMDLNamespace},
92 {"age_over_75", kMDLNamespace},
93 {"issuing_jurisdiction", kMDLNamespace},
94 {"nationality", kMDLNamespace},
95 {"resident_city", kMDLNamespace},
96 {"resident_state", kMDLNamespace},
97 {"resident_postal_code", kMDLNamespace},
98 {"resident_country", kMDLNamespace},
99 {"biometric_template_face", kMDLNamespace},
100 {"biometric_template_voice", kMDLNamespace},
101 {"biometric_template_finger", kMDLNamespace},
102 {"biometric_template_iris", kMDLNamespace},
103 {"biometric_template_retina", kMDLNamespace},
104 {"biometric_template_hand_geometry", kMDLNamespace},
105 {"biometric_template_keystroke", kMDLNamespace},
106 {"biometric_template_signature_sign", kMDLNamespace},
107 {"biometric_template_lip_movement", kMDLNamespace},
108 {"biometric_template_thermal_face", kMDLNamespace},
109 {"biometric_template_thermal_hand", kMDLNamespace},
110 {"biometric_template_gait", kMDLNamespace},
111 {"biometric_template_body_odor", kMDLNamespace},
112 {"biometric_template_dna", kMDLNamespace},
113 {"biometric_template_ear", kMDLNamespace},
114 {"biometric_template_finger_geometry", kMDLNamespace},
115 {"biometric_template_palm_geometry", kMDLNamespace},
116 {"biometric_template_vein_pattern", kMDLNamespace},
117 {"biometric_template_foot_print", kMDLNamespace},
118 {"family_name_national_character", kMDLNamespace},
119 {"given_name_national_character", kMDLNamespace},
120 {"signature_usual_mark", kMDLNamespace},
121
122 {"name_suffix", kAAMVANamespace},
123 {"organ_donor", kAAMVANamespace},
124 {"veteran", kAAMVANamespace},
125 {"family_name_truncation", kAAMVANamespace},
126 {"given_name_truncation", kAAMVANamespace},
127 {"aka_family_name.v2", kAAMVANamespace},
128 {"aka_given_name.v2", kAAMVANamespace},
129 {"aka_suffix", kAAMVANamespace},
130 {"weight_range", kAAMVANamespace},
131 {"race_ethnicity", kAAMVANamespace},
132 {"sex", kAAMVANamespace},
133 {"first_name", kAAMVANamespace},
134 {"middle_names", kAAMVANamespace},
135 {"first_name_truncation", kAAMVANamespace},
136 {"middle_names_truncation", kAAMVANamespace},
137 {"EDL_credential", kAAMVANamespace},
138 {"EDL_credential.v2", kAAMVANamespace},
139 {"DHS_compliance", kAAMVANamespace},
140 {"resident_county", kAAMVANamespace},
141 {"resident_county.v2", kAAMVANamespace},
142 {"hazmat_endorsement_expiration_date", kAAMVANamespace},
143 {"CDL_indicator", kAAMVANamespace},
144 {"CDL_non_domiciled", kAAMVANamespace},
145 {"CDL_non_domiciled.v2", kAAMVANamespace},
146 {"DHS_compliance_text", kAAMVANamespace},
147 {"DHS_temporary_lawful_status", kAAMVANamespace},
148
149 {"family_name", kEUDIPIDNamespace},
150 {"given_name", kEUDIPIDNamespace},
151 {"birth_date", kEUDIPIDNamespace},
152 {"age_in_years", kEUDIPIDNamespace},
153 {"age_birth_year", kEUDIPIDNamespace},
154 {"age_equal_or_over", kEUDIPIDNamespace},
155 {"age_over_18", kEUDIPIDNamespace},
156 {"age_over_21", kEUDIPIDNamespace},
157 {"family_name_birth", kEUDIPIDNamespace},
158 {"given_name_birth", kEUDIPIDNamespace},
159 {"birth_place", kEUDIPIDNamespace},
160 {"place_of_birth", kEUDIPIDNamespace},
161 {"birth_country", kEUDIPIDNamespace},
162 {"birth_state", kEUDIPIDNamespace},
163 {"birth_city", kEUDIPIDNamespace},
164 {"address", kEUDIPIDNamespace},
165 {"resident_address", kEUDIPIDNamespace},
166 {"resident_country", kEUDIPIDNamespace},
167 {"resident_state", kEUDIPIDNamespace},
168 {"resident_city", kEUDIPIDNamespace},
169 {"resident_postal_code", kEUDIPIDNamespace},
170 {"resident_street", kEUDIPIDNamespace},
171 {"resident_house_number", kEUDIPIDNamespace},
172 {"sex", kEUDIPIDNamespace},
173 {"nationality", kEUDIPIDNamespace},
174 {"issuance_date", kEUDIPIDNamespace},
175 {"expiry_date", kEUDIPIDNamespace},
176 {"issuing_authority", kEUDIPIDNamespace},
177 {"document_number", kEUDIPIDNamespace},
178 {"personal_administrative_number", kEUDIPIDNamespace},
179 {"issuing_jurisdiction", kEUDIPIDNamespace},
180 {"issuing_country", kEUDIPIDNamespace},
181 {"portrait", kEUDIPIDNamespace},
182 {"email_address", kEUDIPIDNamespace},
183 {"mobile_phone_number", kEUDIPIDNamespace},
184
185 {"family_name_unicode", kISO23220Namespace},
186 {"given_name_unicode", kISO23220Namespace},
187 {"birth_date", kISO23220Namespace},
188 {"portrait", kISO23220Namespace},
189 {"issue_date", kISO23220Namespace},
190 {"expiry_date", kISO23220Namespace},
191 {"issuing_authority_unicode", kISO23220Namespace},
192 {"issuing_country", kISO23220Namespace},
193 {"age_in_years", kISO23220Namespace},
194 {"age_over_13", kISO23220Namespace},
195 {"age_over_16", kISO23220Namespace},
196 {"age_over_18", kISO23220Namespace},
197 {"age_over_21", kISO23220Namespace},
198 {"age_over_25", kISO23220Namespace},
199 {"age_over_60", kISO23220Namespace},
200 {"age_over_62", kISO23220Namespace},
201 {"age_over_65", kISO23220Namespace},
202 {"age_over_68", kISO23220Namespace},
203 {"age_birth_year", kISO23220Namespace},
204 {"portrait_capture_date", kISO23220Namespace},
205 {"birthplace", kISO23220Namespace},
206 {"name_at_birth", kISO23220Namespace},
207 {"resident_address_unicode", kISO23220Namespace},
208 {"resident_city_unicode", kISO23220Namespace},
209 {"resident_postal_code", kISO23220Namespace},
210 {"resident_country", kISO23220Namespace},
211 {"resident_city_latin1", kISO23220Namespace},
212 {"sex", kISO23220Namespace},
213 {"nationality", kISO23220Namespace},
214 {"document_number", kISO23220Namespace},
215 {"issuing_subdivision", kISO23220Namespace},
216 {"family_name_latin1", kISO23220Namespace},
217 {"given_name_latin1", kISO23220Namespace},
218
219 {"person_id", kISO23220PhotoIDNamespace},
220 {"birth_country", kISO23220PhotoIDNamespace},
221 {"birth_state", kISO23220PhotoIDNamespace},
222 {"birth_city", kISO23220PhotoIDNamespace},
223 {"administrative_number", kISO23220PhotoIDNamespace},
224 {"resident_street", kISO23220PhotoIDNamespace},
225 {"resident_house_number", kISO23220PhotoIDNamespace},
226 {"travel_document_number", kISO23220PhotoIDNamespace},
227 {"resident_state", kISO23220PhotoIDNamespace},
228
229 {"dtc_version", kISO23220DTCNamespace},
230 {"dtc_sod", kISO23220DTCNamespace},
231 {"dtc_dg1", kISO23220DTCNamespace},
232 {"dtc_dg2", kISO23220DTCNamespace},
233 {"dtc_dg3", kISO23220DTCNamespace},
234 {"dtc_dg4", kISO23220DTCNamespace},
235 {"dtc_dg5", kISO23220DTCNamespace},
236 {"dtc_dg6", kISO23220DTCNamespace},
237 {"dtc_dg7", kISO23220DTCNamespace},
238 {"dtc_dg8", kISO23220DTCNamespace},
239 {"dtc_dg9", kISO23220DTCNamespace},
240 {"dtc_dg10", kISO23220DTCNamespace},
241 {"dtc_dg11", kISO23220DTCNamespace},
242 {"dtc_dg12", kISO23220DTCNamespace},
243 {"dtc_dg13", kISO23220DTCNamespace},
244 {"dtc_dg14", kISO23220DTCNamespace},
245 {"dtc_dg15", kISO23220DTCNamespace},
246 {"dtc_dg16", kISO23220DTCNamespace},
247 {"dg_content_info", kISO23220DTCNamespace},
248
249 // https://ageverification.dev/av-doc-technical-specification/docs/architecture-and-technical-specifications/#411-attribute-set
250 {"age_over_18", kEUAVNamespace},
251 {"age_over_13", kEUAVNamespace}, /* The rest of these are optional. */
252 {"age_over_15", kEUAVNamespace},
253 {"age_over_16", kEUAVNamespace},
254 {"age_over_21", kEUAVNamespace},
255 {"age_over_23", kEUAVNamespace},
256 {"age_over_25", kEUAVNamespace},
257 {"age_over_27", kEUAVNamespace},
258 {"age_over_28", kEUAVNamespace},
259 {"age_over_40", kEUAVNamespace},
260 {"age_over_60", kEUAVNamespace},
261 {"age_over_65", kEUAVNamespace},
262 {"age_over_67", kEUAVNamespace},
263 {"portrait", kEUAVNamespace},
264};
265
266} // namespace proofs
267
268#endif // PRIVACY_PROOFS_ZK_LIB_CIRCUITS_MDOC_MDOC_ATTRIBUTE_IDS_H_
proofs::MdocAttribute
Definition mdoc_attribute_ids.h:22