This repository has been archived by the owner on Mar 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
tagconverter.py
227 lines (201 loc) · 9.78 KB
/
tagconverter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# Copyright 2009 Jean-Francois Houzard, Olivier Roger
#
# This file is part of pypassport.
#
# pypassport is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# pypassport is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with pyPassport.
# If not, see <http://www.gnu.org/licenses/>.
# DOC9303-2 pg III-38
tagLDSToName = {
"60" : "Common data elements",
"61" : "Template for MRZ data group",
"63" : "Template for Finger biometric data group",
"65" : "Template for digitized facial image",
"67" : "Template for digitized Signature or usual mark",
"68" : "Template for Machine Assisted Security - Encoded Data",
"69" : "Template for Machine Assisted Security - Structure",
"6A" : "Template for Machine Assisted Security - Substance",
"6B" : "Template for Additional Personal Details",
"6C" : "Template for Additional Document Details",
"6D" : "Optional details",
"6E" : "Reserved for future use",
"70" : "Person to Notify",
"75" : "Template for facial biometric data group",
"76" : "Template for Iris (eye) biometric template",
"77" : "EF.SOD (EF for security data)"
}
tagToName = {
#tagLDSToName = {
"02" : "Integer",
"5C" : "Tag list",
"5F01" : "LDS Version Number",
"5F08" : "Date of birth (truncated)",
"5F09" : "Compressed image (ANSI/NIST-ITL 1-2000)",
"5F0A" : "Security features - Encoded Data",
"5F0B" : "Security features - Structure",
"5F0C" : "Security features",
"5F0E" : "Full name, in national characters",
"5F0F" : "Other names",
"5F10" : "Personal Number",
"5F11" : "Place of birth",
"5F12" : "Telephone",
"5F13" : "Profession",
"5F14" : "Title",
"5F15" : "Personal Summary",
"5F16" : "Proof of citizenship (10918 image)",
"5F17" : "Other valid TD Numbers",
"5F18" : "Custody information",
"5F19" : "Issuing Authority",
"5F1A" : "Other people on document",
"5F1B" : "Endorsement/Observations",
"5F1C" : "Tax/Exit requirements",
"5F1D" : "Image of document front",
"5F1E" : "Image of document rear",
"5F1F" : "mrz_data_elements",
"5F26" : "Date of Issue",
"5F2B" : "Date of birth (8 digit)",
"5F2E" : "Biometric data block",
"5F36" : "Unicode Version Level",
"5F40" : "Compressed image template",
"5F42" : "Address",
"5F43" : "Compressed image template",
"5F50" : "Date data recorded",
"5F51" : "Name of person",
"5F52" : "Telephone",
"5F53" : "Address",
"5F55" : "Date and time document personalized",
"5F56" : "Serial number of personalization system",
"60" : "Common data elements",
"61" : "Template for MRZ data group",
"63" : "Template for Finger biometric data group",
"65" : "Template for digitized facial image",
"67" : "Template for digitized Signature or usual mark",
"68" : "Template for Machine Assisted Security - Encoded Data",
"69" : "Template for Machine Assisted Security - Structure",
"6A" : "Template for Machine Assisted Security - Substance",
"6B" : "Template for Additional Personal Details",
"6C" : "Template for Additional Document Details",
"6D" : "Optional details",
"6E" : "Reserved for future use",
"70" : "Person to Notify",
"75" : "Template for facial biometric data group",
"76" : "Template for Iris (eye) biometric template",
"77" : "EF.SOD (EF for security data)",
"7F2E" : "Biometric data block (enciphered)",
"7F60" : "Biometric Information Template",
"7F61" : "Biometric Information Group Template",
"80" : "ICAO header version",
"81" : "Biometric Type",
"82" : "Biometric subtype",
"83" : "Creation date and time",
"84" : "Validity period", # (revized in nov 2008)
"85" : "Validity period", # (since 2008)
"86" : "Creator of biometric reference data",
"87" : "Format Owner",
"88" : "Format Type",
"89" : "Context specific tags",
"8A" : "Context specific tags",
"8B" : "Context specific tags",
"8C" : "Context specific tags",
"8D" : "Context specific tags",
"8E" : "Context specific tags",
"8F" : "Context specific tags",
"90" : "Enciphered hash code",
"A0" : "Context specific constructed data objects",
"A1" : "Repeating template, 1 occurrence Biometric header",
"A2" : "Repeating template, 2 occurrence Biometric header",
"A3" : "Repeating template, 3 occurrence Biometric header",
"A4" : "Repeating template, 4 occurrence Biometric header",
"A5" : "Repeating template, 5 occurrence Biometric header",
"A6" : "Repeating template, 6 occurrence Biometric header",
"A7" : "Repeating template, 7 occurrence Biometric header",
"A8" : "Repeating template, 8 occurrence Biometric header",
"A9" : "Repeating template, 9 occurrence Biometric header",
"AA" : "Repeating template, 10 occurrence Biometric header",
"AB" : "Repeating template, 11 occurrence Biometric header",
"AC" : "Repeating template, 12 occurrence Biometric header",
"AD" : "Repeating template, 13 occurrence Biometric header",
"AE" : "Repeating template, 14 occurrence Biometric header",
"AF" : "Repeating template, 15 occurrence Biometric header",
"B0" : "Repeating template, 0 occurrence Biometric header",
"B1" : "Repeating template, 1 occurrence Biometric header",
"B2" : "Repeating template, 2 occurrence Biometric header",
"B3" : "Repeating template, 3 occurrence Biometric header",
"B4" : "Repeating template, 4 occurrence Biometric header",
"B5" : "Repeating template, 5 occurrence Biometric header",
"B6" : "Repeating template, 6 occurrence Biometric header",
"B7" : "Repeating template, 7 occurrence Biometric header",
"B8" : "Repeating template, 8 occurrence Biometric header",
"B9" : "Repeating template, 9 occurrence Biometric header",
"BA" : "Repeating template, 10 occurrence Biometric header",
"BB" : "Repeating template, 11 occurrence Biometric header",
"BC" : "Repeating template, 12 occurrence Biometric header",
"BD" : "Repeating template, 13 occurrence Biometric header",
"BE" : "Repeating template, 14 occurrence Biometric header",
"BF" : "Repeating template, 15 occurrence Biometric header",
# }
# DOC9303-2 pg III-40
#tagMRZtoName = {
"53" : "optional_data",
"59" : "expiry_date",
"02" : "document_number",
"5F02" : "optional_data_check",
"5F03" : "document_type",
"5F04" : "document_number_check",
"5F05" : "date_of_birth_check",
"5F06" : "expiry_date_check",
"5F07" : "composite",
"5F20" : "issuing_state_or_organization",
"5F2B" : "date_of_birth",
"5F2C" : "nationality",
"5F35" : "sex",
"5F57" : "date_of_birth",
# From DG1 (information tags)
"5F28" : "issuing_state_or_organization",
"5F5B" : "name", # version 2006
"5B" : "name", # version 2008
"5A" : "document_number",
# }
# DOC9303-2 pg III-40
#tagRFUtoName = {
"5F44" : "Country of entry/exit",
"5F45" : "Date of entry/exit",
"5F46" : "Port of entry/exit",
"5F47" : "Entry/Exit indicator",
"5F48" : "Length of stay",
"5F49" : "Category (classification)",
"5F4A" : "Inspector reference",
"5F4B" : "Entry/Exit indicator",
"71" : "Template for Electronic Visas",
"72" : "Template for Border Crossing Schemes",
"73" : "Template for Travel Record Data Group",
# DataGroup
"60" : "Index",
"61" : "MRZ",
"75" : "Face",
"63" : "Finger",
"76" : "Eye (Iris)",
"65" : "Portrait",
"66" : "Reserved for Future Use",
"67" : "Signature or Usual Mark",
"68" : "Data Features",
"69" : "Structure Features",
"6A" : "Substance Features",
"6B" : "Additional Personal Detail(s)",
"6C" : "Additional Documents Detail(s)",
"6D" : "Optional Details (Country Specific)",
"6E" : "Reserved for Future Use",
"6F" : "Active Authentication Public Key Info",
"70" : "Person to Notify",
"77" : "Security Object"
}