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