@gwydion-id/icao-9303-models 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/CC0-1.0.txt +121 -0
- package/LICENSES/LGPL-3.0-or-later.txt +304 -0
- package/README.md +79 -0
- package/package.json +17 -0
- package/package.json.license +3 -0
- package/src/digitalseal.js +234 -0
- package/src/digitalsealv3.js +359 -0
- package/src/digitalsealv4.js +369 -0
- package/src/index.js +41 -0
- package/src/mrvadocument.js +465 -0
- package/src/mrvadocumentwithvds3.js +559 -0
- package/src/mrvadocumentwithvds4.js +559 -0
- package/src/mrvbdocument.js +466 -0
- package/src/mrvbdocumentwithvds3.js +560 -0
- package/src/mrvbdocumentwithvds4.js +560 -0
- package/src/td1document.js +408 -0
- package/src/td1documentwithvds3.js +479 -0
- package/src/td1documentwithvds4.js +479 -0
- package/src/td2document.js +379 -0
- package/src/td2documentwithvds3.js +466 -0
- package/src/td2documentwithvds4.js +466 -0
- package/src/td3document.js +391 -0
- package/src/td3documentwithvds3.js +466 -0
- package/src/td3documentwithvds4.js +466 -0
- package/src/traveldocument.js +306 -0
- package/src/utilities/bytes-to-date.js +23 -0
- package/src/utilities/c40-decode.js +225 -0
- package/src/utilities/c40-encode.js +254 -0
- package/src/utilities/c40-shift1.js +10 -0
- package/src/utilities/date-to-bytes.js +38 -0
- package/src/utilities/der-length-to-length.js +33 -0
- package/src/utilities/expand-year.js +26 -0
- package/src/utilities/gender-marker-to-mrz.js +14 -0
- package/src/utilities/generate-mrz-check-digit.js +139 -0
- package/src/utilities/icao-date.js +234 -0
- package/src/utilities/length-to-der-length.js +41 -0
- package/src/utilities/nationality-codes.js +303 -0
- package/src/utilities/normalize-mrz-string.js +19 -0
- package/src/utilities/optional-data-mrz.js +29 -0
- package/src/utilities/pad-mrz-string.js +16 -0
- package/src/utilities/set-signature-zone.js +34 -0
- package/src/utilities/stringify-validation-array.js +27 -0
- package/src/utilities/validate-hex-string.js +41 -0
- package/src/utilities/validate-identifier-code.js +38 -0
- package/src/utilities/validate-mrz-string.js +44 -0
- package/src/utilities/vds-magic.js +9 -0
- package/src/utilities/vds-signature-marker.js +9 -0
- package/src/utilities/vds-version-3.js +9 -0
- package/src/utilities/vds-version-4.js +9 -0
- package/src/visadocument.js +114 -0
- package/tests/models/digitalsealv4.test.js +67 -0
- package/tests/models/mrvadocument.test.js +61 -0
- package/tests/models/mrvbdocument.test.js +61 -0
- package/tests/models/td1document.test.js +50 -0
- package/tests/models/td2document.test.js +49 -0
- package/tests/models/td3document.test.js +88 -0
- package/tests/utilities/c40-encodation-scheme.test.js +34 -0
- package/tests/utilities/der-tlv-length-conversion.test.js +99 -0
- package/tests/utilities/document-utilities.test.js +199 -0
- package/tests/utilities/icao-constants.test.js +35 -0
- package/tests/utilities/icao-date.test.js +141 -0
- package/tests/utilities/vds-date-conversions.test.js +28 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Don Geronimo <https://sentamal.in>
|
|
2
|
+
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
3
|
+
|
|
4
|
+
import { MRVADocument } from './mrvadocument.js';
|
|
5
|
+
import { DigitalSealV4 } from './digitalsealv4.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Stores properties and methods for machine-readable visas (MRV-A) with a
|
|
9
|
+
* machine-readable zone and a version 4 visible digital seal (VDS). These
|
|
10
|
+
* visas are used when additional information is placed on the visa sticker
|
|
11
|
+
* and clear zones along the visa sticker is unnecessary for the
|
|
12
|
+
* passport page.
|
|
13
|
+
*/
|
|
14
|
+
export class MRVADocumentWithVDS4 {
|
|
15
|
+
/**
|
|
16
|
+
* Create a `MRVADocumentWithVDS4`.
|
|
17
|
+
* @param { Object } [opt] - An options object.
|
|
18
|
+
* @param { string } [opt.typeCode] - A 1-2 character string consisting of the
|
|
19
|
+
* characters A-Z, 0-9, ' ', or <. 'A', 'I', 'P', or 'V' are recommended
|
|
20
|
+
* for the first character.
|
|
21
|
+
* @param { string } [opt.authorityCode] - A 3-character string consisting of
|
|
22
|
+
* the characters A-Z, 0-9, ' ', or <. A code from ISO-3166-1,
|
|
23
|
+
* ICAO 9303-3, or these user-assigned ranges are recommended: AAA-AAZ,
|
|
24
|
+
* QMA-QZZ, XAA-XZZ, or ZZA-ZZZ.
|
|
25
|
+
* @param { string } [opt.number] - A string no longer than 9 characters
|
|
26
|
+
* consisting of the characters A-Z, 0-9, ' ', or <.
|
|
27
|
+
* @param { string } [opt.primaryIdentifier] - The visa holder's primary
|
|
28
|
+
* identifier.
|
|
29
|
+
* @param { string | null } [opt.primaryIdentifierNative] - The visa
|
|
30
|
+
* holder's primary identifier in their native language.
|
|
31
|
+
* @param { string | null } [opt.secondaryIdentifer] - The visa holder's
|
|
32
|
+
* secondary identifier.
|
|
33
|
+
* @param { string | null } [opt.secondaryIdentifierNative] - The visa
|
|
34
|
+
* holder's secondary identifier in their native language.
|
|
35
|
+
* @param { string } [opt.nationalityCode] - A 3-character string consisting
|
|
36
|
+
* of the characters A-Z, 0-9, ' ', or <. A code from ISO-3166-1,
|
|
37
|
+
* ICAO 9303-3, or these user-assigned ranges are recommended: AAA-AAZ,
|
|
38
|
+
* QMA-QZZ, XAA-XZZ, or ZZA-ZZZ.
|
|
39
|
+
* @param { string | Date | IcaoDate } [opt.birthDate] - A calendar date string in
|
|
40
|
+
* YYYY-MM-DD format, a `Date` object, or an `IcaoDate` object.
|
|
41
|
+
* @param { 'F' | 'M' | 'X' } [opt.genderMarker] - The character 'F', 'M', or 'X'.
|
|
42
|
+
* @param { string | Date | IcaoDate } [opt.validThru] - A calendar date string in
|
|
43
|
+
* YYYY-MM-DD format, a `Date` object, or an `IcaoDate` object..
|
|
44
|
+
* @param { string } [opt.optionalData] - Up to 16 characters. Valid
|
|
45
|
+
* characters are from the ranges A-Z, 0-9, ' ', or <.
|
|
46
|
+
* @param { string } [opt.mrzLine1] - A MRZ line string of a 44-character
|
|
47
|
+
* length.
|
|
48
|
+
* @param { string } [opt.mrzLine2] - A MRZ line string of a 44-character
|
|
49
|
+
* length.
|
|
50
|
+
* @param { string } [opt.machineReadableZone] - A MRZ string of an
|
|
51
|
+
* 88-character length.
|
|
52
|
+
* @param { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
53
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas |
|
|
54
|
+
* VideoFrame } [opt.photo] - A path/URL to an image, or an image object,
|
|
55
|
+
* representing a photo of the visa holder or an image from the issuing
|
|
56
|
+
* authority.
|
|
57
|
+
* @param { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
58
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas |
|
|
59
|
+
* VideoFrame } [opt.signatureImage] - A path/URL to an image, or an image
|
|
60
|
+
* object, representing the signature or usual mark of the visa issuer.
|
|
61
|
+
* @param { string } [opt.placeOfIssue] - Location where the visa was issued.
|
|
62
|
+
* @param { string | Date | IcaoDate } [opt.validFrom] - A calendar date string in
|
|
63
|
+
* YYYY-MM-DD format, a `Date` object, or an `IcaoDate` object.
|
|
64
|
+
* @param { string | number } [opt.numberOfEntries] - 0 or any string denotes
|
|
65
|
+
* an unlimited number of entries.
|
|
66
|
+
* @param { string } [opt.visaType] - A type/name/description for this visa.
|
|
67
|
+
* @param { string } [opt.additionalInfo] - Additional textual information.
|
|
68
|
+
* @param { string } [opt.passportNumber] - A string no longer than 9
|
|
69
|
+
* characters consisting of the characters A-Z, 0-9, ' ', or <.
|
|
70
|
+
* @param { boolean } [opt.usePassportInMRZ] - Use `this.passportNumber`
|
|
71
|
+
* instead of `this.number` in the Machine-Readable Zone (MRZ).
|
|
72
|
+
* @param { string } [opt.identifierCode] - A 4-character string consisting of
|
|
73
|
+
* the characters 0-9 and A-Z.
|
|
74
|
+
* @param { string } [opt.certReference] - A hex-string that uniquely
|
|
75
|
+
* identifies a certificate for a given signer.
|
|
76
|
+
* @param { string | Date | IcaoDate } [opt.issueDate] - A calendar date string in
|
|
77
|
+
* YYYY-MM-DD format, a `Date` object, or an `IcaoDate` object.
|
|
78
|
+
* @param { string | Date | IcaoDate } [opt.signatureDate] - A calendar date string in
|
|
79
|
+
* YYYY-MM-DD format, a `Date` object, or an `IcaoDate` object.
|
|
80
|
+
* @param { number } [opt.featureDefinition] - A number in the range of
|
|
81
|
+
* 0x01-0xFE.
|
|
82
|
+
* @param { number } [opt.typeCategory] - A number in the range of 0x01-0xFE.
|
|
83
|
+
* Odd numbers in the range between 0x01 and 0xFD shall be used for
|
|
84
|
+
* ICAO-specified document type categories.
|
|
85
|
+
* @param { Map<number, number[]> } [opt.features] - A store of
|
|
86
|
+
* digitally-encoded document features used to create the message zone.
|
|
87
|
+
* @param { number[] } [opt.signatureData] - The raw signature data generated
|
|
88
|
+
* by concatenating the header and message zone, hashing the result, and
|
|
89
|
+
* signing the hash with a cryptographic key.
|
|
90
|
+
* @param { number[] } [opt.headerZone] - The header zone of the VDS as
|
|
91
|
+
* defined by ICAO 9303 part 13.
|
|
92
|
+
* @param { number[] } [opt.messageZone] - The message zone of the VDS as
|
|
93
|
+
* defined by ICAO 9303 part 13.
|
|
94
|
+
* @param { number[] } [opt.signatureZone] - The signature zone of the VDS as
|
|
95
|
+
* a TLV of the signature marker, its length in BER/DER definite length
|
|
96
|
+
* form, and the raw signature data.
|
|
97
|
+
* @param { number[] } [opt.unsignedSeal] - A concatenation of the header zone
|
|
98
|
+
* and the message zone of the VDS.
|
|
99
|
+
* @param { number[] } [opt.signedSeal] - A concatenation of the header zone,
|
|
100
|
+
* the message zone, and the signature zone of the VDS.
|
|
101
|
+
*/
|
|
102
|
+
constructor(opt) {
|
|
103
|
+
this.#document = new MRVADocument();
|
|
104
|
+
this.#digitalseal = new DigitalSealV4();
|
|
105
|
+
|
|
106
|
+
this.typeCode = opt?.typeCode ?? "V";
|
|
107
|
+
this.authorityCode = opt?.authorityCode ?? "UTO";
|
|
108
|
+
this.number = opt?.number ?? "M12388954";
|
|
109
|
+
this.primaryIdentifier = opt?.primaryIdentifier ?? "Eriksson";
|
|
110
|
+
this.primaryIdentifierNative = opt?.primaryIdentifierNative ?? null;
|
|
111
|
+
this.secondaryIdentifier = opt?.secondaryIdentifier ?? null;
|
|
112
|
+
this.secondaryIdentifierNative = opt?.secondaryIdentifierNative ?? null;
|
|
113
|
+
this.nationalityCode = opt?.nationalityCode ?? "XXX";
|
|
114
|
+
this.birthDate = opt?.birthDate ?? "1974-08-12";
|
|
115
|
+
this.genderMarker = opt?.genderMarker ?? "F";
|
|
116
|
+
this.validThru = opt?.validThru ?? "1996-12-10";
|
|
117
|
+
this.optionalData = opt?.optionalData ?? "6ZE184226B";
|
|
118
|
+
this.placeOfIssue = opt?.placeOfIssue ?? "Zenith";
|
|
119
|
+
this.validFrom = opt?.validFrom ?? "1991-12-10";
|
|
120
|
+
this.numberOfEntries = opt?.numberOfEntries ?? "Multiple";
|
|
121
|
+
this.visaType = opt?.visaType ?? "Business Multiple";
|
|
122
|
+
this.additionalInfo = opt?.additionalInfo ?? "";
|
|
123
|
+
this.passportNumber = opt?.passportNumber ?? "L8988901C";
|
|
124
|
+
this.usePassportInMRZ = opt?.usePassportInMRZ ?? true;
|
|
125
|
+
this.identifierCode = opt?.identifierCode ?? "UTSS";
|
|
126
|
+
this.certReference = opt?.certReference ?? "00000";
|
|
127
|
+
this.issueDate = opt?.issueDate ?? "2007-04-15";
|
|
128
|
+
this.signatureDate = opt?.signatureDate ?? "2007-04-15";
|
|
129
|
+
this.featureDefinition = opt?.featureDefinition ?? 0x01;
|
|
130
|
+
this.typeCategory = opt?.typeCategory ?? 0x01;
|
|
131
|
+
this.features = opt?.features ?? new Map();
|
|
132
|
+
this.signatureData = opt?.signatureData ?? Array(64).fill(0);
|
|
133
|
+
|
|
134
|
+
if (opt?.photo) { this.photo = opt.photo; }
|
|
135
|
+
if (opt?.signatureImage) { this.signatureImage = opt.signatureImage; }
|
|
136
|
+
if (opt?.mrzLine1) { this.mrzLine1 = opt.mrzLine1; }
|
|
137
|
+
if (opt?.mrzLine2) { this.mrzLine2 = opt.mrzLine2; }
|
|
138
|
+
if (opt?.machineReadableZone) {
|
|
139
|
+
this.machineReadableZone = opt.machineReadableZone;
|
|
140
|
+
}
|
|
141
|
+
if (opt?.headerZone) { this.headerZone = opt.headerZone; }
|
|
142
|
+
if (opt?.messageZone) { this.messageZone = opt.messageZone; }
|
|
143
|
+
if (opt?.signatureZone) { this.signatureZone = opt.signatureZone; }
|
|
144
|
+
if (opt?.unsignedSeal) { this.unsignedSeal = opt.unsignedSeal; }
|
|
145
|
+
if (opt?.signedSeal) { this.signedSeal = opt.signedSeal; }
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// The objects `MRVADocumentWithVDS4` uses to compose itself
|
|
149
|
+
#document;
|
|
150
|
+
#digitalseal;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* A code identifying the visa type.
|
|
154
|
+
* @type { string }
|
|
155
|
+
*/
|
|
156
|
+
get typeCode() { return this.#document.typeCode; }
|
|
157
|
+
/**
|
|
158
|
+
* @param { string } value - A 1-2 character string consisting of the
|
|
159
|
+
* characters A-Z, 0-9, ' ', or <. 'A', 'I', 'P', or 'V' are recommended
|
|
160
|
+
* for the first character.
|
|
161
|
+
*/
|
|
162
|
+
set typeCode(value) { this.#document.typeCode = value; }
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* A code identifying the authority who issued this visa.
|
|
166
|
+
* @type { string }
|
|
167
|
+
*/
|
|
168
|
+
get authorityCode() { return this.#document.authorityCode; }
|
|
169
|
+
/**
|
|
170
|
+
* @param { string } value - A 3-character string consisting of the characters
|
|
171
|
+
* A-Z, 0-9, ' ', or <. A code from ISO-3166-1, ICAO 9303-3, or these
|
|
172
|
+
* user-assigned ranges are recommended: AAA-AAZ, QMA-QZZ, XAA-XZZ, or
|
|
173
|
+
* ZZA-ZZZ.
|
|
174
|
+
*/
|
|
175
|
+
set authorityCode(value) {
|
|
176
|
+
this.#document.authorityCode = value;
|
|
177
|
+
this.#digitalseal.authorityCode = value;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* An identity document number unique for this visa.
|
|
182
|
+
* @type { string }
|
|
183
|
+
*/
|
|
184
|
+
get number() { return this.#document.number; }
|
|
185
|
+
/**
|
|
186
|
+
* @param { string } value - A string no longer than 9 characters consisting
|
|
187
|
+
* of the characters A-Z, 0-9, ' ', or <.
|
|
188
|
+
*/
|
|
189
|
+
set number(value) { this.#document.number = value; }
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The visa holder's primary identifier
|
|
193
|
+
* @type { string }
|
|
194
|
+
*/
|
|
195
|
+
get primaryIdentifier() { return this.#document.primaryIdentifier; }
|
|
196
|
+
/**
|
|
197
|
+
* @param { string }
|
|
198
|
+
*/
|
|
199
|
+
set primaryIdentifier(value) { this.#document.primaryIdentifier = value; }
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The visa holder's primary identifier in their native language
|
|
203
|
+
* @type { string | null }
|
|
204
|
+
*/
|
|
205
|
+
get primaryIdentifierNative() { return this.#document.primaryIdentifierNative; }
|
|
206
|
+
/**
|
|
207
|
+
* @param { string | null }
|
|
208
|
+
*/
|
|
209
|
+
set primaryIdentifierNative(value) { this.#document.primaryIdentifierNative = value; }
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The visa holder's secondary identifier
|
|
213
|
+
* @type { string | null }
|
|
214
|
+
*/
|
|
215
|
+
get secondaryIdentifier() { return this.#document.secondaryIdentifier; }
|
|
216
|
+
/**
|
|
217
|
+
* @param { string | null }
|
|
218
|
+
*/
|
|
219
|
+
set secondaryIdentifier(value) { this.#document.secondaryIdentifier = value; }
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The visa holder's secondary identifier in their native language
|
|
223
|
+
* @type { string | null }
|
|
224
|
+
*/
|
|
225
|
+
get secondaryIdentifierNative() { return this.#document.secondaryIdentifierNative; }
|
|
226
|
+
/**
|
|
227
|
+
* @param { string | null }
|
|
228
|
+
*/
|
|
229
|
+
set secondaryIdentifierNative(value) { this.#document.secondaryIdentifierNative = value; }
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* A code identifying the visa holder's nationality (or lack thereof).
|
|
233
|
+
* @type { string }
|
|
234
|
+
*/
|
|
235
|
+
get nationalityCode() { return this.#document.nationalityCode; }
|
|
236
|
+
/**
|
|
237
|
+
* @param { string } value - A 3-character string consisting of the characters
|
|
238
|
+
* A-Z, 0-9, ' ', or <. A code from ISO-3166-1, ICAO 9303-3, or these
|
|
239
|
+
* user-assigned ranges are recommended: AAA-AAZ, QMA-QZZ, XAA-XZZ, or
|
|
240
|
+
* ZZA-ZZZ.
|
|
241
|
+
*/
|
|
242
|
+
set nationalityCode(value) { this.#document.nationalityCode = value; }
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* The visa holder's date of birth.
|
|
246
|
+
* @type { IcaoDate }
|
|
247
|
+
*/
|
|
248
|
+
get birthDate() { return this.#document.birthDate; }
|
|
249
|
+
/**
|
|
250
|
+
* @param { string | Date | IcaoDate } value - A calendar date string in YYYY-MM-DD
|
|
251
|
+
* format, a `Date` object, or an `IcaoDate` object.
|
|
252
|
+
*/
|
|
253
|
+
set birthDate(value) { this.#document.birthDate = value; }
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* A marker representing the visa holder's gender.
|
|
257
|
+
* @type { 'F' | 'M' | 'X' }
|
|
258
|
+
*/
|
|
259
|
+
get genderMarker() { return this.#document.genderMarker; }
|
|
260
|
+
/**
|
|
261
|
+
* @param { 'F' | 'M' | 'X' } value - The character 'F', 'M', or 'X'.
|
|
262
|
+
*/
|
|
263
|
+
set genderMarker(value) { this.#document.genderMarker = value; }
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* The last date on which this visa is valid.
|
|
267
|
+
* @type { IcaoDate }
|
|
268
|
+
*/
|
|
269
|
+
get validThru() { return this.#document.expirationDate; }
|
|
270
|
+
/**
|
|
271
|
+
* @param { string | Date | IcaoDate } value - A calendar date string in YYYY-MM-DD
|
|
272
|
+
* format, a `Date` object, or an `IcaoDate` object.
|
|
273
|
+
*/
|
|
274
|
+
set validThru(value) { this.#document.expirationDate = value; }
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Optional data to include in the Machine-Readable Zone (MRZ).
|
|
278
|
+
* @type { string }
|
|
279
|
+
*/
|
|
280
|
+
get optionalData() { return this.#document.optionalData; }
|
|
281
|
+
/**
|
|
282
|
+
* @param { string } value - Up to 16 characters. Valid characters are from
|
|
283
|
+
* the ranges A-Z, 0-9, ' ', or <.
|
|
284
|
+
*/
|
|
285
|
+
set optionalData(value) { this.#document.optionalData = value; }
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* A path/URL to an image, or an image object, representing a photo of the
|
|
289
|
+
* visa holder or an image from the issuing authority.
|
|
290
|
+
* @type { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
291
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas | VideoFrame }
|
|
292
|
+
*/
|
|
293
|
+
get photo() { return this.#document.photo; }
|
|
294
|
+
/**
|
|
295
|
+
* @param { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
296
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas | VideoFrame } value
|
|
297
|
+
*/
|
|
298
|
+
set photo(value) { this.#document.photo = value; }
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* A path/URL to an image, or an image object, representing the signature or
|
|
302
|
+
* usual mark of the visa issuer.
|
|
303
|
+
* @type { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
304
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas | VideoFrame }
|
|
305
|
+
*/
|
|
306
|
+
get signatureImage() { return this.#document.signatureImage; }
|
|
307
|
+
/**
|
|
308
|
+
* @param { string | HTMLImageElement | SVGImageElement | HTMLVideoElement |
|
|
309
|
+
* HTMLCanvasElement | ImageBitmap | OffscreenCanvas | VideoFrame } value
|
|
310
|
+
*/
|
|
311
|
+
set signatureImage(value) { this.#document.signatureImage = value; }
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Location where the visa was issued.
|
|
315
|
+
* @type { string }
|
|
316
|
+
*/
|
|
317
|
+
get placeOfIssue() { return this.#document.placeOfIssue; }
|
|
318
|
+
/**
|
|
319
|
+
* @param { string } value
|
|
320
|
+
*/
|
|
321
|
+
set placeOfIssue(value) { this.#document.placeOfIssue = value; }
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Starting date on which the visa is valid.
|
|
325
|
+
* @type { IcaoDate }
|
|
326
|
+
*/
|
|
327
|
+
get validFrom() { return this.#document.validFrom; }
|
|
328
|
+
/**
|
|
329
|
+
* @param { string | Date | IcaoDate } value - A calendar date string in YYYY-MM-DD
|
|
330
|
+
* format, a `Date` object, or an `IcaoDate` object.
|
|
331
|
+
*/
|
|
332
|
+
set validFrom(value) { this.#document.validFrom = value; }
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Maximum number of entries this visa allows.
|
|
336
|
+
* @type { string }
|
|
337
|
+
*/
|
|
338
|
+
get numberOfEntries() { return this.#document.numberOfEntries; }
|
|
339
|
+
/**
|
|
340
|
+
* @param { string | number } value - 0 or any string denotes an unlimited
|
|
341
|
+
* number of entries.
|
|
342
|
+
*/
|
|
343
|
+
set numberOfEntries(value) { this.#document.numberOfEntries = value; }
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* The textual type/name/description for this visa.
|
|
347
|
+
* @type { string }
|
|
348
|
+
*/
|
|
349
|
+
get visaType() { return this.#document.visaType; }
|
|
350
|
+
/**
|
|
351
|
+
* @param { string } value
|
|
352
|
+
*/
|
|
353
|
+
set visaType(value) { this.#document.visaType = value; }
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Additional textual information to include with this visa.
|
|
357
|
+
* @type { string }
|
|
358
|
+
*/
|
|
359
|
+
get additionalInfo() { return this.#document.additionalInfo; }
|
|
360
|
+
/**
|
|
361
|
+
* @param { string } value
|
|
362
|
+
*/
|
|
363
|
+
set additionalInfo(value) { this.#document.additionalInfo = value; }
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* The identity document number for which this visa is issued.
|
|
367
|
+
* @type { string }
|
|
368
|
+
*/
|
|
369
|
+
get passportNumber() { return this.#document.passportNumber; }
|
|
370
|
+
/**
|
|
371
|
+
* @param { string } value - A string no longer than 9 characters consisting
|
|
372
|
+
* of the characters A-Z, 0-9, ' ', or <.
|
|
373
|
+
*/
|
|
374
|
+
set passportNumber(value) { this.#document.passportNumber = value; }
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Use `this.passportNumber` instead of `this.number` in the Machine-Readable
|
|
378
|
+
* Zone (MRZ).
|
|
379
|
+
* @type { boolean }
|
|
380
|
+
*/
|
|
381
|
+
get usePassportInMRZ() { return this.#document.usePassportInMRZ; }
|
|
382
|
+
/**
|
|
383
|
+
* @param { boolean } value
|
|
384
|
+
*/
|
|
385
|
+
set usePassportInMRZ(value) { this.#document.usePassportInMRZ = value; }
|
|
386
|
+
|
|
387
|
+
/**
|
|
388
|
+
* The first line of the Machine-Readable Zone (MRZ).
|
|
389
|
+
* @type { string }
|
|
390
|
+
*/
|
|
391
|
+
get mrzLine1() { return this.#document.mrzLine1; }
|
|
392
|
+
/**
|
|
393
|
+
* @param { string } value - A MRZ line string of a 44-character length.
|
|
394
|
+
*/
|
|
395
|
+
set mrzLine1(value) { this.#document.mrzLine1 = value; }
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* The second line of the Machine-Readable Zone (MRZ).
|
|
399
|
+
* @type { string }
|
|
400
|
+
*/
|
|
401
|
+
get mrzLine2() { return this.#document.mrzLine2; }
|
|
402
|
+
/**
|
|
403
|
+
* @param { string } value - A MRZ line string of a 44-character length.
|
|
404
|
+
*/
|
|
405
|
+
set mrzLine2(value) { this.#document.mrzLine2 = value; }
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* The full Machine-Readable Zone (MRZ).
|
|
409
|
+
* @type { string }
|
|
410
|
+
*/
|
|
411
|
+
get machineReadableZone() { return this.#document.machineReadableZone; }
|
|
412
|
+
/**
|
|
413
|
+
* @param { string } value - A MRZ string of a 88-character length.
|
|
414
|
+
*/
|
|
415
|
+
set machineReadableZone(value) { this.#document.machineReadableZone = value; }
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* A combination of a two-letter authority code and of two alphanumeric
|
|
419
|
+
* characters to identify a signer within the issuing authority.
|
|
420
|
+
* @type { string }
|
|
421
|
+
*/
|
|
422
|
+
get identifierCode() { return this.#digitalseal.identifierCode; }
|
|
423
|
+
/**
|
|
424
|
+
* @param { string } value - A 4-character string consisting of the characters
|
|
425
|
+
* 0-9 and A-Z.
|
|
426
|
+
*/
|
|
427
|
+
set identifierCode(value) { this.#digitalseal.identifierCode = value; }
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* A hex-string that uniquely identifies a certificate for a given signer.
|
|
431
|
+
* @type { string }
|
|
432
|
+
*/
|
|
433
|
+
get certReference() { return this.#digitalseal.certReference; }
|
|
434
|
+
/**
|
|
435
|
+
* @param { string } value - A hex string.
|
|
436
|
+
*/
|
|
437
|
+
set certReference(value) { this.#digitalseal.certReference = value; }
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A date string on which the document was issued.
|
|
441
|
+
* @type { IcaoDate }
|
|
442
|
+
*/
|
|
443
|
+
get issueDate() { return this.#digitalseal.issueDate; }
|
|
444
|
+
/**
|
|
445
|
+
* @param { string | Date | IcaoDate } value - A calendar date string in YYYY-MM-DD
|
|
446
|
+
* format, a `Date` object, or an `IcaoDate` object.
|
|
447
|
+
*/
|
|
448
|
+
set issueDate(value) { this.#digitalseal.issueDate = value; }
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* A date string on which the seal was signed.
|
|
452
|
+
* @type { IcaoDate }
|
|
453
|
+
*/
|
|
454
|
+
get signatureDate() { return this.#digitalseal.signatureDate; }
|
|
455
|
+
/**
|
|
456
|
+
* @param { string | Date | IcaoDate } value - A calendar date string in YYYY-MM-DD
|
|
457
|
+
* format, a `Date` object, or an `IcaoDate` object.
|
|
458
|
+
*/
|
|
459
|
+
set signatureDate(value) { this.#digitalseal.signatureDate = value; }
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* A reference code to a document that defines the number and encoding of VDS
|
|
463
|
+
* features.
|
|
464
|
+
* @type { number }
|
|
465
|
+
*/
|
|
466
|
+
get featureDefinition() { return this.#digitalseal.featureDefinition; }
|
|
467
|
+
/**
|
|
468
|
+
* @param { number } value - A number in the range of 0x01-0xFE.
|
|
469
|
+
*/
|
|
470
|
+
set featureDefinition(value) { this.#digitalseal.featureDefinition = value; }
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* A code defining the document type category to which the seal is attached.
|
|
474
|
+
* @type { number }
|
|
475
|
+
*/
|
|
476
|
+
get typeCategory() { return this.#digitalseal.typeCategory; }
|
|
477
|
+
/**
|
|
478
|
+
* @param { number } value - A number in the range of 0x01-0xFE. Odd numbers
|
|
479
|
+
* in the range between 0x01 and 0xFD shall be used for ICAO-specified
|
|
480
|
+
* document type categories.
|
|
481
|
+
*/
|
|
482
|
+
set typeCategory(value) { this.#digitalseal.typeCategory = value; }
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* A store of digitally-encoded document features used to create the message
|
|
486
|
+
* zone.
|
|
487
|
+
* @type { Map<number, number[]>}
|
|
488
|
+
*/
|
|
489
|
+
get features() { return this.#digitalseal.features; }
|
|
490
|
+
/**
|
|
491
|
+
* @param { Map<number, number[]> } value
|
|
492
|
+
*/
|
|
493
|
+
set features(value) { this.#digitalseal.features = value; }
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* The raw signature data generated by concatenating the header and message
|
|
497
|
+
* zone, hashing the result, and signing the hash with a cryptographic
|
|
498
|
+
* key.
|
|
499
|
+
* @type { number[] }
|
|
500
|
+
*/
|
|
501
|
+
get signatureData() { return this.#digitalseal.signatureData; }
|
|
502
|
+
/**
|
|
503
|
+
* @param { number[] } value
|
|
504
|
+
*/
|
|
505
|
+
set signatureData(value) { this.#digitalseal.signatureData = value; }
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* The header zone of the VDS as defined by ICAO 9303 part 13.
|
|
509
|
+
* @type { number[] }
|
|
510
|
+
*/
|
|
511
|
+
get headerZone() { return this.#digitalseal.headerZone; }
|
|
512
|
+
/**
|
|
513
|
+
* @param { number[] } value
|
|
514
|
+
*/
|
|
515
|
+
set headerZone(value) { this.#digitalseal.headerZone = value; }
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* The message zone of the VDS as defined by ICAO 9303 part 13.
|
|
519
|
+
* @type { number[] }
|
|
520
|
+
*/
|
|
521
|
+
get messageZone() { return this.#digitalseal.messageZone; }
|
|
522
|
+
/**
|
|
523
|
+
* @param { number[] } value
|
|
524
|
+
*/
|
|
525
|
+
set messageZone(value) { this.#digitalseal.messageZone = value; }
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* The signature zone of the VDS as a TLV of the signature marker, its length
|
|
529
|
+
* in BER/DER definite length form, and the raw signature data.
|
|
530
|
+
* @type { number[] }
|
|
531
|
+
*/
|
|
532
|
+
get signatureZone() { return this.#digitalseal.signatureZone; }
|
|
533
|
+
/**
|
|
534
|
+
* @param { number[] } value
|
|
535
|
+
*/
|
|
536
|
+
set signatureZone(value) { this.#digitalseal.signatureZone = value; }
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* A concatenation of the header zone and the message zone of the VDS.
|
|
540
|
+
* @type { number[] }
|
|
541
|
+
*/
|
|
542
|
+
get unsignedSeal() { return this.#digitalseal.unsignedSeal; }
|
|
543
|
+
/**
|
|
544
|
+
* @param { number[] } value
|
|
545
|
+
*/
|
|
546
|
+
set unsignedSeal(value) { this.#digitalseal.unsignedSeal = value; }
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* A concatenation of the header zone, the message zone, and the signature
|
|
550
|
+
* zone of the VDS.
|
|
551
|
+
* @type { number[] }
|
|
552
|
+
*/
|
|
553
|
+
get signedSeal() { return this.#digitalseal.signedSeal; }
|
|
554
|
+
/**
|
|
555
|
+
* @param { number[] } value
|
|
556
|
+
*/
|
|
557
|
+
set signedSeal(value) { this.#digitalseal.signedSeal = value; }
|
|
558
|
+
}
|
|
559
|
+
|