@sswroom/sswr 1.6.12 → 1.6.14

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/certutil.js CHANGED
@@ -51,6 +51,12 @@ export const RuleCond = {
51
51
 
52
52
  export class PDUInfo
53
53
  {
54
+ /**
55
+ * @param {number} rawOfst
56
+ * @param {number} hdrLen
57
+ * @param {number} contLen
58
+ * @param {number} itemType
59
+ */
54
60
  constructor(rawOfst, hdrLen, contLen, itemType)
55
61
  {
56
62
  this.rawOfst = rawOfst;
@@ -72,6 +78,11 @@ export class PDUInfo
72
78
 
73
79
  export class ASN1Util
74
80
  {
81
+ /**
82
+ * @param {data.ByteReader} reader
83
+ * @param {number} ofst
84
+ * @param {number} endOfst
85
+ */
75
86
  static pduParseLen(reader, ofst, endOfst)
76
87
  {
77
88
  if (ofst >= endOfst)
@@ -115,6 +126,11 @@ export class ASN1Util
115
126
  }
116
127
  }
117
128
 
129
+ /**
130
+ * @param {data.ByteReader} reader
131
+ * @param {number} ofst
132
+ * @param {number} endOfst
133
+ */
118
134
  static pduParseUInt32(reader, ofst, endOfst)
119
135
  {
120
136
  if (endOfst - ofst < 3)
@@ -148,6 +164,11 @@ export class ASN1Util
148
164
  }
149
165
  }
150
166
 
167
+ /**
168
+ * @param {data.ByteReader} reader
169
+ * @param {number} ofst
170
+ * @param {number} endOfst
171
+ */
151
172
  static pduParseString(reader, ofst, endOfst)
152
173
  {
153
174
  let len = ASN1Util.pduParseLen(reader, ofst, endOfst);
@@ -161,6 +182,11 @@ export class ASN1Util
161
182
  val: reader.readUTF8(len.nextOfst, len.pduLen)};
162
183
  }
163
184
 
185
+ /**
186
+ * @param {data.ByteReader} reader
187
+ * @param {number} ofst
188
+ * @param {number} endOfst
189
+ */
164
190
  static pduParseChoice(reader, ofst, endOfst)
165
191
  {
166
192
  if (endOfst - ofst < 3)
@@ -194,6 +220,11 @@ export class ASN1Util
194
220
  }
195
221
  }
196
222
 
223
+ /**
224
+ * @param {data.ByteReader} reader
225
+ * @param {number} startOfst
226
+ * @param {number} endOfst
227
+ */
197
228
  static pduParseUTCTimeCont(reader, startOfst, endOfst)
198
229
  {
199
230
  if ((endOfst - startOfst) == 13 && reader.readUInt8(startOfst + 12) == 'Z'.charCodeAt(0))
@@ -233,8 +264,17 @@ export class ASN1Util
233
264
  return null;
234
265
  }
235
266
 
267
+ /**
268
+ * @param {data.ByteReader} reader
269
+ * @param {number} startOfst
270
+ * @param {number} endOfst
271
+ * @param {string[]} outLines
272
+ * @param {number} level
273
+ * @param {ASN1Names|null|undefined} names
274
+ */
236
275
  static pduToString(reader, startOfst, endOfst, outLines, level, names)
237
276
  {
277
+ let startOfstZ;
238
278
  while (startOfst < endOfst)
239
279
  {
240
280
  let type = reader.readUInt8(startOfst);
@@ -542,7 +582,7 @@ export class ASN1Util
542
582
  sb.push(" (");
543
583
  if (reader.isASCIIText(len.nextOfst, len.pduLen))
544
584
  {
545
- sb.push(reader.getUTF8(len.nextOfst, len.pduLen));
585
+ sb.push(reader.readUTF8(len.nextOfst, len.pduLen));
546
586
  }
547
587
  else
548
588
  {
@@ -564,19 +604,20 @@ export class ASN1Util
564
604
  {
565
605
  startOfst = len.nextOfst;
566
606
  if (names) names.readContainerBegin();
567
- startOfst = ASN1Util.pduToString(reader, startOfst, endOfst, outLines, level + 1, names);
568
- if (startOfst == null)
607
+ startOfstZ = ASN1Util.pduToString(reader, startOfst, endOfst, outLines, level + 1, names);
608
+ if (startOfstZ == null)
569
609
  {
570
610
  return null;
571
611
  }
612
+ startOfst = startOfstZ;
572
613
  if (names) names.readContainerEnd();
573
614
  }
574
615
  else
575
616
  {
576
617
  startOfst = len.nextOfst;
577
618
  if (names) names.readContainerBegin();
578
- startOfst = ASN1Util.pduToString(reader, startOfst, startOfst + len.pduLen, outLines, level + 1, names);
579
- if (startOfst == null)
619
+ startOfstZ = ASN1Util.pduToString(reader, startOfst, startOfst + len.pduLen, outLines, level + 1, names);
620
+ if (startOfstZ == null)
580
621
  {
581
622
  return null;
582
623
  }
@@ -595,19 +636,20 @@ export class ASN1Util
595
636
  {
596
637
  startOfst = len.nextOfst;
597
638
  if (names) names.readContainerBegin();
598
- startOfst = ASN1Util.pduToString(reader, startOfst, endOfst, outLines, level + 1, names);
599
- if (startOfst == null)
639
+ startOfstZ = ASN1Util.pduToString(reader, startOfst, endOfst, outLines, level + 1, names);
640
+ if (startOfstZ == null)
600
641
  {
601
642
  return null;
602
643
  }
644
+ startOfst = startOfstZ;
603
645
  if (names) names.readContainerEnd();
604
646
  }
605
647
  else
606
648
  {
607
649
  startOfst = len.nextOfst;
608
650
  if (names) names.readContainerBegin();
609
- startOfst = ASN1Util.pduToString(reader, startOfst, startOfst + len.pduLen, outLines, level + 1, names);
610
- if (startOfst == null)
651
+ startOfstZ = ASN1Util.pduToString(reader, startOfst, startOfst + len.pduLen, outLines, level + 1, names);
652
+ if (startOfstZ == null)
611
653
  {
612
654
  return null;
613
655
  }
@@ -635,11 +677,12 @@ export class ASN1Util
635
677
  sb.push("{");
636
678
  outLines.push(sb.join(""));
637
679
  if (names) names.readContainerBegin();
638
- startOfst = ASN1Util.pduToString(reader, len.nextOfst, len.nextOfst + len.pduLen, outLines, level + 1, names);
639
- if (startOfst == null)
680
+ startOfstZ = ASN1Util.pduToString(reader, len.nextOfst, len.nextOfst + len.pduLen, outLines, level + 1, names);
681
+ if (startOfstZ == null)
640
682
  {
641
- return false;
683
+ return null;
642
684
  }
685
+ startOfst = startOfstZ;
643
686
  if (names) names.readContainerEnd();
644
687
  outLines.push("\t".repeat(level)+"}");
645
688
  }
@@ -690,11 +733,12 @@ export class ASN1Util
690
733
  sb.push("{");
691
734
  outLines.push(sb.join(""));
692
735
  if (names) names.readContainerBegin();
693
- startOfst = ASN1Util.pduToString(reader, len.nextOfst, endOfst, outLines, level + 1, names);
694
- if (startOfst == null)
736
+ startOfstZ = ASN1Util.pduToString(reader, len.nextOfst, endOfst, outLines, level + 1, names);
737
+ if (startOfstZ == null)
695
738
  {
696
- return false;
739
+ return null;
697
740
  }
741
+ startOfst = startOfstZ;
698
742
  if (names) names.readContainerEnd();
699
743
  outLines.push("\t".repeat(level)+"}");
700
744
  }
@@ -731,8 +775,14 @@ export class ASN1Util
731
775
  return startOfst;
732
776
  }
733
777
 
778
+ /**
779
+ * @param {data.ByteReader} reader
780
+ * @param {number} startOfst
781
+ * @param {number} endOfst
782
+ */
734
783
  static pduDSizeEnd(reader, startOfst, endOfst)
735
784
  {
785
+ let startOfstZ;
736
786
  while (startOfst < endOfst)
737
787
  {
738
788
  let len = ASN1Util.pduParseLen(reader, startOfst + 1, endOfst);
@@ -751,11 +801,12 @@ export class ASN1Util
751
801
  }
752
802
  else if (reader.readUInt8(startOfst + 1) == 0x80)
753
803
  {
754
- startOfst = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
755
- if (startOfst == null)
804
+ startOfstZ = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
805
+ if (startOfstZ == null)
756
806
  {
757
807
  return null;
758
808
  }
809
+ startOfst = startOfstZ;
759
810
  }
760
811
  else
761
812
  {
@@ -765,8 +816,15 @@ export class ASN1Util
765
816
  return startOfst;
766
817
  }
767
818
 
819
+ /**
820
+ * @param {data.ByteReader} reader
821
+ * @param {number} startOfst
822
+ * @param {number} endOfst
823
+ * @param {string | null} path
824
+ */
768
825
  static pduGetItem(reader, startOfst, endOfst, path)
769
826
  {
827
+ let ofstZ;
770
828
  if (path == null || path == "")
771
829
  return null;
772
830
  let i = path.indexOf(".");
@@ -807,7 +865,10 @@ export class ASN1Util
807
865
  {
808
866
  if (reader.readUInt8(startOfst + 1) == 0x80)
809
867
  {
810
- let ret = new PDUInfo(startOfst, len.nextOfst - startOfst, ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst), reader.readUInt8(startOfst));
868
+ ofstZ = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
869
+ if (ofstZ == null)
870
+ return null;
871
+ let ret = new PDUInfo(startOfst, len.nextOfst - startOfst, ofstZ, reader.readUInt8(startOfst));
811
872
  if (ret.contLen == null)
812
873
  return null;
813
874
  return ret;
@@ -828,11 +889,12 @@ export class ASN1Util
828
889
  }
829
890
  else if (reader.readUInt8(startOfst + 1) == 0x80)
830
891
  {
831
- startOfst = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
832
- if (startOfst == null)
892
+ ofstZ = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
893
+ if (ofstZ == null)
833
894
  {
834
895
  return null;
835
896
  }
897
+ startOfst = ofstZ;
836
898
  }
837
899
  else
838
900
  {
@@ -842,6 +904,12 @@ export class ASN1Util
842
904
  return null;
843
905
  }
844
906
 
907
+ /**
908
+ * @param {any} reader
909
+ * @param {any} startOfst
910
+ * @param {any} endOfst
911
+ * @param {any} path
912
+ */
845
913
  static pduGetItemType(reader, startOfst, endOfst, path)
846
914
  {
847
915
  let item = ASN1Util.pduGetItem(reader, startOfst, endOfst, path);
@@ -851,8 +919,15 @@ export class ASN1Util
851
919
  return item.itemType;
852
920
  }
853
921
 
922
+ /**
923
+ * @param {data.ByteReader} reader
924
+ * @param {number} startOfst
925
+ * @param {number} endOfst
926
+ * @param {string | null} path
927
+ */
854
928
  static pduCountItem(reader, startOfst, endOfst, path)
855
929
  {
930
+ let startOfstZ;
856
931
  let cnt;
857
932
  let len;
858
933
  if (path == null || path == "")
@@ -935,11 +1010,12 @@ export class ASN1Util
935
1010
  }
936
1011
  else if (reader.readUInt8(startOfst + 1) == 0x80)
937
1012
  {
938
- startOfst = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
939
- if (startOfst == null)
1013
+ startOfstZ = ASN1Util.pduDSizeEnd(reader, len.nextOfst, endOfst);
1014
+ if (startOfstZ == null)
940
1015
  {
941
1016
  return 0;
942
1017
  }
1018
+ startOfst = startOfstZ;
943
1019
  }
944
1020
  else
945
1021
  {
@@ -949,6 +1025,11 @@ export class ASN1Util
949
1025
  return 0;
950
1026
  }
951
1027
 
1028
+ /**
1029
+ * @param {data.ByteReader} reader
1030
+ * @param {number} startOfst
1031
+ * @param {number} endOfst
1032
+ */
952
1033
  static pduIsValid(reader, startOfst, endOfst)
953
1034
  {
954
1035
  while (startOfst < endOfst)
@@ -975,6 +1056,10 @@ export class ASN1Util
975
1056
  return true;
976
1057
  }
977
1058
 
1059
+ /**
1060
+ * @param {Uint8Array | number[]} oid1
1061
+ * @param {Uint8Array | number[]} oid2
1062
+ */
978
1063
  static oidCompare(oid1, oid2)
979
1064
  {
980
1065
  let i = 0;
@@ -1006,12 +1091,21 @@ export class ASN1Util
1006
1091
  }
1007
1092
  }
1008
1093
 
1094
+ /**
1095
+ * @param {Uint8Array | number[]} oidPDU
1096
+ * @param {string} oidText
1097
+ */
1009
1098
  static oidEqualsText(oidPDU, oidText)
1010
1099
  {
1011
1100
  let oid2 = ASN1Util.oidText2PDU(oidText);
1101
+ if (oid2 == null)
1102
+ return false;
1012
1103
  return ASN1Util.oidCompare(oidPDU, oid2) == 0;
1013
1104
  }
1014
1105
 
1106
+ /**
1107
+ * @param {Uint8Array | number[]} oidPDU
1108
+ */
1015
1109
  static oidToString(oidPDU)
1016
1110
  {
1017
1111
  let sb = [];
@@ -1091,6 +1185,11 @@ export class ASN1Util
1091
1185
  return pduBuff;
1092
1186
  }
1093
1187
 
1188
+ /**
1189
+ * @param {data.ByteReader} reader
1190
+ * @param {number} ofst
1191
+ * @param {number} len
1192
+ */
1094
1193
  static booleanToString(reader, ofst, len)
1095
1194
  {
1096
1195
  if (len == 1)
@@ -1115,6 +1214,11 @@ export class ASN1Util
1115
1214
  }
1116
1215
  }
1117
1216
 
1217
+ /**
1218
+ * @param {data.ByteReader} reader
1219
+ * @param {number} ofst
1220
+ * @param {number} len
1221
+ */
1118
1222
  static integerToString(reader, ofst, len)
1119
1223
  {
1120
1224
  switch (len)
@@ -1132,6 +1236,11 @@ export class ASN1Util
1132
1236
  }
1133
1237
  }
1134
1238
 
1239
+ /**
1240
+ * @param {data.ByteReader} reader
1241
+ * @param {number} ofst
1242
+ * @param {number} len
1243
+ */
1135
1244
  static utcTimeToString(reader, ofst, len)
1136
1245
  {
1137
1246
  let ts = ASN1Util.pduParseUTCTimeCont(reader, ofst, ofst + len);
@@ -1142,6 +1251,9 @@ export class ASN1Util
1142
1251
  return "";
1143
1252
  }
1144
1253
 
1254
+ /**
1255
+ * @param {number} itemType
1256
+ */
1145
1257
  static itemTypeGetName(itemType)
1146
1258
  {
1147
1259
  switch (itemType)
@@ -1219,6 +1331,10 @@ export class ASN1Util
1219
1331
  }
1220
1332
  }
1221
1333
 
1334
+ /**
1335
+ * @param {data.ByteReader} reader
1336
+ * @param {number} ofst
1337
+ */
1222
1338
  static str2Digit(reader, ofst)
1223
1339
  {
1224
1340
  return Number.parseInt(reader.readUTF8(ofst, 2));
@@ -1239,6 +1355,9 @@ class RuleContainer
1239
1355
 
1240
1356
  export class ASN1Names
1241
1357
  {
1358
+ /**
1359
+ * @param {{ cond: number | undefined; itemType: any; condParam: any; name: any; contentFunc: any; enumVals: any; }} rule
1360
+ */
1242
1361
  addRule(rule)
1243
1362
  {
1244
1363
  if (this.readContainer)
@@ -1267,6 +1386,12 @@ export class ASN1Names
1267
1386
  this.readLastOIDLen = 0;
1268
1387
  }
1269
1388
 
1389
+ /**
1390
+ * @param {any} itemType
1391
+ * @param {any} len
1392
+ * @param {any} reader
1393
+ * @param {any} ofst
1394
+ */
1270
1395
  readName(itemType, len, reader, ofst)
1271
1396
  {
1272
1397
  let name = this.readNameNoDef(itemType, len, reader, ofst);
@@ -1275,6 +1400,12 @@ export class ASN1Names
1275
1400
  return ASN1Util.itemTypeGetName(itemType);
1276
1401
  }
1277
1402
 
1403
+ /**
1404
+ * @param {number} itemType
1405
+ * @param {number} len
1406
+ * @param {data.ByteReader} reader
1407
+ * @param {number} ofst
1408
+ */
1278
1409
  readNameNoDef(itemType, len, reader, ofst)
1279
1410
  {
1280
1411
  let anyMatch = false;
@@ -1334,7 +1465,7 @@ export class ASN1Names
1334
1465
  break;
1335
1466
  case RuleCond.LastOIDAndTypeIs:
1336
1467
  this.readIndex++;
1337
- if (itemType == rule.itemType && ASN1Util.oidEqualsText(this.readLastOID, rule.condParam))
1468
+ if (itemType == rule.itemType && this.readLastOID && ASN1Util.oidEqualsText(this.readLastOID, rule.condParam))
1338
1469
  return rule.name;
1339
1470
  break;
1340
1471
  case RuleCond.RepeatIfTypeIs:
@@ -1415,6 +1546,9 @@ export class ASN1Names
1415
1546
  return this;
1416
1547
  }
1417
1548
 
1549
+ /**
1550
+ * @param {any} itemType
1551
+ */
1418
1552
  typeIs(itemType)
1419
1553
  {
1420
1554
  this.currCond = RuleCond.TypeIsItemType;
@@ -1439,6 +1573,9 @@ export class ASN1Names
1439
1573
  return this;
1440
1574
  }
1441
1575
 
1576
+ /**
1577
+ * @param {any} index
1578
+ */
1442
1579
  typeIsOpt(index)
1443
1580
  {
1444
1581
  this.currCond = RuleCond.TypeIsOpt;
@@ -1447,6 +1584,9 @@ export class ASN1Names
1447
1584
  return this;
1448
1585
  }
1449
1586
 
1587
+ /**
1588
+ * @param {any} itemType
1589
+ */
1450
1590
  repeatIfTypeIs(itemType)
1451
1591
  {
1452
1592
  this.currCond = RuleCond.RepeatIfTypeIs;
@@ -1455,6 +1595,10 @@ export class ASN1Names
1455
1595
  return this;
1456
1596
  }
1457
1597
 
1598
+ /**
1599
+ * @param {any} oidText
1600
+ * @param {any} itemType
1601
+ */
1458
1602
  lastOIDAndTypeIs(oidText, itemType)
1459
1603
  {
1460
1604
  this.currCond = RuleCond.LastOIDAndTypeIs;
@@ -1471,6 +1615,10 @@ export class ASN1Names
1471
1615
  return this;
1472
1616
  }
1473
1617
 
1618
+ /**
1619
+ * @param {any} name
1620
+ * @param {any} contFunc
1621
+ */
1474
1622
  container(name, contFunc)
1475
1623
  {
1476
1624
  let rule = {
@@ -1484,6 +1632,9 @@ export class ASN1Names
1484
1632
  return this;
1485
1633
  }
1486
1634
 
1635
+ /**
1636
+ * @param {any} name
1637
+ */
1487
1638
  nextValue(name)
1488
1639
  {
1489
1640
  let rule = {
@@ -1497,6 +1648,10 @@ export class ASN1Names
1497
1648
  return this;
1498
1649
  }
1499
1650
 
1651
+ /**
1652
+ * @param {any} name
1653
+ * @param {any} enums
1654
+ */
1500
1655
  enum(name, enums)
1501
1656
  {
1502
1657
  let rule = {
@@ -1555,17 +1710,26 @@ export class ASN1Names
1555
1710
 
1556
1711
  class General
1557
1712
  {
1713
+ /**
1714
+ * @param {ASN1Names} names
1715
+ */
1558
1716
  static pbeParam(names)
1559
1717
  {
1560
1718
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("salt");
1561
1719
  names.typeIs(ASN1ItemType.INTEGER).nextValue("iterations");
1562
1720
  }
1563
1721
 
1722
+ /**
1723
+ * @param {ASN1Names} names
1724
+ */
1564
1725
  static extendedValidationCertificates(names)
1565
1726
  {
1566
1727
  names.repeatIfTypeIs(ASN1ItemType.OCTET_STRING).nextValue("signedCertTimestamp");
1567
1728
  }
1568
1729
 
1730
+ /**
1731
+ * @param {ASN1Names} names
1732
+ */
1569
1733
  static attributeOutlookExpress(names)
1570
1734
  {
1571
1735
  names.typeIs(ASN1ItemType.SEQUENCE).container("issuerAndSerialNumber", PKCS7.issuerAndSerialNumberCont);
@@ -1574,6 +1738,9 @@ class General
1574
1738
 
1575
1739
  class InformationFramework
1576
1740
  {
1741
+ /**
1742
+ * @param {ASN1Names} names
1743
+ */
1577
1744
  static attributeCont(names)
1578
1745
  {
1579
1746
  names.typeIs(ASN1ItemType.OID).nextValue("attrId");
@@ -1600,22 +1767,34 @@ class InformationFramework
1600
1767
 
1601
1768
  class PKCS1
1602
1769
  {
1770
+ /**
1771
+ * @param {ASN1Names} names
1772
+ */
1603
1773
  static rsaPublicKey(names)
1604
1774
  {
1605
1775
  names.typeIs(ASN1ItemType.SEQUENCE).container("RSAPublicKey", PKCS1.rsaPublicKeyCont);
1606
1776
  }
1607
1777
 
1778
+ /**
1779
+ * @param {ASN1Names} names
1780
+ */
1608
1781
  static rsaPublicKeyCont(names)
1609
1782
  {
1610
1783
  names.typeIs(ASN1ItemType.INTEGER).nextValue("modulus");
1611
1784
  names.typeIs(ASN1ItemType.INTEGER).nextValue("publicExponent");
1612
1785
  }
1613
1786
 
1787
+ /**
1788
+ * @param {ASN1Names} names
1789
+ */
1614
1790
  static rsaPrivateKey(names)
1615
1791
  {
1616
1792
  names.typeIs(ASN1ItemType.SEQUENCE).container("RSAPrivateKey", PKCS1.rsaPrivateKeyCont);
1617
1793
  }
1618
1794
 
1795
+ /**
1796
+ * @param {ASN1Names} names
1797
+ */
1619
1798
  static rsaPrivateKeyCont(names)
1620
1799
  {
1621
1800
  let version = ["two-prime", "multi"];
@@ -1631,6 +1810,9 @@ class PKCS1
1631
1810
  names.typeIs(ASN1ItemType.SEQUENCE).container("otherPrimeInfos", PKCS1.otherPrimeInfos);
1632
1811
  }
1633
1812
 
1813
+ /**
1814
+ * @param {ASN1Names} names
1815
+ */
1634
1816
  static otherPrimeInfos(names)
1635
1817
  {
1636
1818
  names.typeIs(ASN1ItemType.INTEGER).nextValue("prime");
@@ -1638,11 +1820,18 @@ class PKCS1
1638
1820
  names.typeIs(ASN1ItemType.INTEGER).nextValue("coefficient");
1639
1821
  }
1640
1822
 
1823
+ /**
1824
+ * @param {ASN1Names} names
1825
+ * @param {string} name
1826
+ */
1641
1827
  static addDigestInfo(names, name)
1642
1828
  {
1643
1829
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKCS1.digestInfoCont);
1644
1830
  }
1645
1831
 
1832
+ /**
1833
+ * @param {ASN1Names} names
1834
+ */
1646
1835
  static digestInfoCont(names)
1647
1836
  {
1648
1837
  PKIX1Explicit88.addAlgorithmIdentifier(names, "digestAlgorithm");
@@ -1653,16 +1842,26 @@ class PKCS1
1653
1842
 
1654
1843
  class PKCS7
1655
1844
  {
1845
+ /**
1846
+ * @param {ASN1Names} names
1847
+ * @param {string} name
1848
+ */
1656
1849
  static addContentInfo(names, name)
1657
1850
  {
1658
1851
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKCS7.contentInfoCont);
1659
1852
  }
1660
1853
 
1854
+ /**
1855
+ * @param {ASN1Names} names
1856
+ */
1661
1857
  static contentInfo(names)
1662
1858
  {
1663
1859
  names.typeIs(ASN1ItemType.SEQUENCE).container("ContentInfo", PKCS7.contentInfoCont);
1664
1860
  }
1665
1861
 
1862
+ /**
1863
+ * @param {ASN1Names} names
1864
+ */
1666
1865
  static contentInfoCont(names)
1667
1866
  {
1668
1867
  names.typeIs(ASN1ItemType.OID).nextValue("content-type");
@@ -1676,16 +1875,25 @@ class PKCS7
1676
1875
  names.nextValue("pkcs7-content"); ////////////////////////
1677
1876
  }
1678
1877
 
1878
+ /**
1879
+ * @param {ASN1Names} names
1880
+ */
1679
1881
  static data(names)
1680
1882
  {
1681
1883
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("data");
1682
1884
  }
1683
1885
 
1886
+ /**
1887
+ * @param {ASN1Names} names
1888
+ */
1684
1889
  static signedData(names)
1685
1890
  {
1686
1891
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.signedDataCont);
1687
1892
  }
1688
1893
 
1894
+ /**
1895
+ * @param {ASN1Names} names
1896
+ */
1689
1897
  static signedDataCont(names)
1690
1898
  {
1691
1899
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1696,11 +1904,17 @@ class PKCS7
1696
1904
  names.typeIs(ASN1ItemType.SET).container("signerInfos", PKCS7.signerInfos);
1697
1905
  }
1698
1906
 
1907
+ /**
1908
+ * @param {ASN1Names} names
1909
+ */
1699
1910
  static digestAlgorithmIdentifiers(names)
1700
1911
  {
1701
1912
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("DigestAlgorithmIdentifier", PKIX1Explicit88.algorithmIdentifierCont);
1702
1913
  }
1703
1914
 
1915
+ /**
1916
+ * @param {ASN1Names} names
1917
+ */
1704
1918
  static certificateSet(names)
1705
1919
  {
1706
1920
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("certificate", PKIX1Explicit88.certificateCont);
@@ -1708,16 +1922,25 @@ class PKCS7
1708
1922
  names.repeatIfTypeIs(ASN1ItemType.CHOICE_1).nextValue("attributeCertificate");//, AttributeCertificate);
1709
1923
  }
1710
1924
 
1925
+ /**
1926
+ * @param {ASN1Names} names
1927
+ */
1711
1928
  static certificateRevocationLists(names)
1712
1929
  {
1713
1930
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).nextValue("CertificateRevocationLists");//, CertificateListCont);
1714
1931
  }
1715
1932
 
1933
+ /**
1934
+ * @param {ASN1Names} names
1935
+ */
1716
1936
  static signerInfos(names)
1717
1937
  {
1718
1938
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("SignerInfo", PKCS7.signerInfoCont);
1719
1939
  }
1720
1940
 
1941
+ /**
1942
+ * @param {ASN1Names} names
1943
+ */
1721
1944
  static signerInfoCont(names)
1722
1945
  {
1723
1946
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1730,28 +1953,44 @@ class PKCS7
1730
1953
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_1).container("unauthenticatedAttributes", PKCS10.attributesCont);
1731
1954
  }
1732
1955
 
1956
+ /**
1957
+ * @param {ASN1Names} names
1958
+ */
1733
1959
  static issuerAndSerialNumberCont(names)
1734
1960
  {
1735
1961
  PKIX1Explicit88.addName(names, "issuer");
1736
1962
  names.typeIs(ASN1ItemType.INTEGER).nextValue("serialNumber");
1737
1963
  }
1738
1964
 
1965
+ /**
1966
+ * @param {ASN1Names} names
1967
+ * @param {string} name
1968
+ */
1739
1969
  static addDigestInfo(names, name)
1740
1970
  {
1741
1971
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKCS7.digestInfoCont);
1742
1972
  }
1743
1973
 
1974
+ /**
1975
+ * @param {ASN1Names} names
1976
+ */
1744
1977
  static digestInfoCont(names)
1745
1978
  {
1746
1979
  PKIX1Explicit88.addAlgorithmIdentifier(names, "digestAlgorithm");
1747
1980
  names.nextValue("digest"); ////////////////////////
1748
1981
  }
1749
1982
 
1983
+ /**
1984
+ * @param {ASN1Names} names
1985
+ */
1750
1986
  static envelopedData(names)
1751
1987
  {
1752
1988
  names.typeIs(ASN1ItemType.SEQUENCE).container("enveloped-data", PKCS7.envelopedDataCont);
1753
1989
  }
1754
1990
 
1991
+ /**
1992
+ * @param {ASN1Names} names
1993
+ */
1755
1994
  static envelopedDataCont(names)
1756
1995
  {
1757
1996
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1761,12 +2000,18 @@ class PKCS7
1761
2000
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_1).container("unprotectedAttributes", PKCS10.attributesCont);
1762
2001
  }
1763
2002
 
2003
+ /**
2004
+ * @param {ASN1Names} names
2005
+ */
1764
2006
  static originatorInfoCont(names)
1765
2007
  {
1766
2008
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("certificates", PKCS7.certificateSet);
1767
2009
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_1).container("crls", PKCS7.certificateRevocationLists);
1768
2010
  }
1769
2011
 
2012
+ /**
2013
+ * @param {ASN1Names} names
2014
+ */
1770
2015
  static recipientInfos(names)
1771
2016
  {
1772
2017
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("keyTransportRecipientInfo", PKCS7.keyTransportRecipientInfoCont);
@@ -1774,6 +2019,9 @@ class PKCS7
1774
2019
  names.repeatIfTypeIs(ASN1ItemType.CHOICE_1).nextValue("keyEncryptionKeyRecipientInfo");//, PKCS7.keyEncryptionKeyRecipientInfo);
1775
2020
  }
1776
2021
 
2022
+ /**
2023
+ * @param {ASN1Names} names
2024
+ */
1777
2025
  static keyTransportRecipientInfoCont(names)
1778
2026
  {
1779
2027
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1783,11 +2031,17 @@ class PKCS7
1783
2031
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("encryptedKey");
1784
2032
  }
1785
2033
 
2034
+ /**
2035
+ * @param {ASN1Names} names
2036
+ */
1786
2037
  static signedAndEnvelopedData(names)
1787
2038
  {
1788
2039
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.signedAndEnvelopedDataCont);
1789
2040
  }
1790
2041
 
2042
+ /**
2043
+ * @param {ASN1Names} names
2044
+ */
1791
2045
  static signedAndEnvelopedDataCont(names)
1792
2046
  {
1793
2047
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1799,21 +2053,33 @@ class PKCS7
1799
2053
  names.typeIs(ASN1ItemType.SET).container("signerInfos", PKCS7.signerInfos);
1800
2054
  }
1801
2055
 
2056
+ /**
2057
+ * @param {ASN1Names} names
2058
+ */
1802
2059
  static digestedData(names)
1803
2060
  {
1804
2061
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.digestedDataCont);
1805
2062
  }
1806
2063
 
2064
+ /**
2065
+ * @param {ASN1Names} names
2066
+ */
1807
2067
  static digestedDataCont(names)
1808
2068
  {
1809
2069
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.digestedDataCont);
1810
2070
  }
1811
2071
 
2072
+ /**
2073
+ * @param {ASN1Names} names
2074
+ */
1812
2075
  static encryptedData(names)
1813
2076
  {
1814
2077
  names.typeIs(ASN1ItemType.SEQUENCE).container("encrypted-data", PKCS7.encryptedDataCont);
1815
2078
  }
1816
2079
 
2080
+ /**
2081
+ * @param {ASN1Names} names
2082
+ */
1817
2083
  static encryptedDataCont(names)
1818
2084
  {
1819
2085
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1821,6 +2087,9 @@ class PKCS7
1821
2087
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_1).container("unprotectedAttributes", PKCS10.attributesCont);
1822
2088
  }
1823
2089
 
2090
+ /**
2091
+ * @param {ASN1Names} names
2092
+ */
1824
2093
  static encryptedContentInfoCont(names)
1825
2094
  {
1826
2095
  names.typeIs(ASN1ItemType.OID).nextValue("contentType");
@@ -1828,6 +2097,9 @@ class PKCS7
1828
2097
  names.typeIs(ASN1ItemType.CHOICE_0).nextValue("encryptedContent");
1829
2098
  }
1830
2099
 
2100
+ /**
2101
+ * @param {ASN1Names} names
2102
+ */
1831
2103
  static authenticatedData(names)
1832
2104
  {
1833
2105
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.authenticatedData);
@@ -1836,11 +2108,17 @@ class PKCS7
1836
2108
 
1837
2109
  class PKCS8
1838
2110
  {
2111
+ /**
2112
+ * @param {ASN1Names} names
2113
+ */
1839
2114
  static privateKeyInfo(names)
1840
2115
  {
1841
2116
  names.typeIs(ASN1ItemType.SEQUENCE).container("PrivateKeyInfo", PKCS8.privateKeyInfoCont);
1842
2117
  }
1843
2118
 
2119
+ /**
2120
+ * @param {ASN1Names} names
2121
+ */
1844
2122
  static privateKeyInfoCont(names)
1845
2123
  {
1846
2124
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1849,11 +2127,17 @@ class PKCS8
1849
2127
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("attributes", PKCS10.attributesCont);
1850
2128
  }
1851
2129
 
2130
+ /**
2131
+ * @param {ASN1Names} names
2132
+ */
1852
2133
  static encryptedPrivateKeyInfo(names)
1853
2134
  {
1854
2135
  names.typeIs(ASN1ItemType.SEQUENCE).container("EncryptedPrivateKeyInfo", PKCS8.encryptedPrivateKeyInfoCont);
1855
2136
  }
1856
2137
 
2138
+ /**
2139
+ * @param {ASN1Names} names
2140
+ */
1857
2141
  static encryptedPrivateKeyInfoCont(names)
1858
2142
  {
1859
2143
  names.typeIs(ASN1ItemType.SEQUENCE).container("encryptionAlgorithm", PKIX1Explicit88.algorithmIdentifierCont);
@@ -1863,41 +2147,65 @@ class PKCS8
1863
2147
 
1864
2148
  class PKCS9
1865
2149
  {
2150
+ /**
2151
+ * @param {ASN1Names} names
2152
+ */
1866
2153
  static attributeContentType(names)
1867
2154
  {
1868
2155
  names.typeIs(ASN1ItemType.OID).nextValue("contentType");
1869
2156
  }
1870
2157
 
2158
+ /**
2159
+ * @param {ASN1Names} names
2160
+ */
1871
2161
  static attributeMessageDigest(names)
1872
2162
  {
1873
2163
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("messageDigest");
1874
2164
  }
1875
2165
 
2166
+ /**
2167
+ * @param {ASN1Names} names
2168
+ */
1876
2169
  static attributeSigningTime(names)
1877
2170
  {
1878
2171
  names.typeIsTime().nextValue("signingTime");
1879
2172
  }
1880
2173
 
2174
+ /**
2175
+ * @param {ASN1Names} names
2176
+ */
1881
2177
  static attributeFriendlyName(names)
1882
2178
  {
1883
2179
  names.typeIs(ASN1ItemType.BMPSTRING).nextValue("friendlyName");
1884
2180
  }
1885
2181
 
2182
+ /**
2183
+ * @param {ASN1Names} names
2184
+ */
1886
2185
  static attributeSMIMECapabilities(names)
1887
2186
  {
1888
2187
  names.typeIs(ASN1ItemType.SEQUENCE).container("smimeCapabilities", PKCS9.smimeCapabilitiesCont);
1889
2188
  }
1890
2189
 
2190
+ /**
2191
+ * @param {ASN1Names} names
2192
+ */
1891
2193
  static attributeLocalKeyId(names)
1892
2194
  {
1893
2195
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("localKeyId");
1894
2196
  }
1895
2197
 
2198
+ /**
2199
+ * @param {ASN1Names} names
2200
+ */
1896
2201
  static smimeCapabilitiesCont(names)
1897
2202
  {
1898
2203
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("SMIMECapability", PKCS9.smimeCapabilityCont);
1899
2204
  }
1900
2205
 
2206
+ /**
2207
+ * @param {ASN1Names} names
2208
+ */
1901
2209
  static smimeCapabilityCont(names)
1902
2210
  {
1903
2211
  names.typeIs(ASN1ItemType.OID).nextValue("algorithm");
@@ -1907,11 +2215,18 @@ class PKCS9
1907
2215
 
1908
2216
  class PKCS10
1909
2217
  {
2218
+ /**
2219
+ * @param {ASN1Names} names
2220
+ * @param {string} name
2221
+ */
1910
2222
  static addCertificationRequestInfo(names, name)
1911
2223
  {
1912
2224
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKCS10.certificationRequestInfoCont);
1913
2225
  }
1914
2226
 
2227
+ /**
2228
+ * @param {ASN1Names} names
2229
+ */
1915
2230
  static certificationRequestInfoCont(names)
1916
2231
  {
1917
2232
  names.typeIs(ASN1ItemType.INTEGER).nextValue("version");
@@ -1920,16 +2235,25 @@ class PKCS10
1920
2235
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("attributes", PKCS10.attributesCont);
1921
2236
  }
1922
2237
 
2238
+ /**
2239
+ * @param {ASN1Names} names
2240
+ */
1923
2241
  static attributesCont(names)
1924
2242
  {
1925
2243
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("Attribute", InformationFramework.attributeCont);
1926
2244
  }
1927
2245
 
2246
+ /**
2247
+ * @param {ASN1Names} names
2248
+ */
1928
2249
  static certificationRequest(names)
1929
2250
  {
1930
2251
  names.typeIs(ASN1ItemType.SEQUENCE).container("CertificationRequest", PKCS10.certificationRequestCont);
1931
2252
  }
1932
2253
 
2254
+ /**
2255
+ * @param {ASN1Names} names
2256
+ */
1933
2257
  static certificationRequestCont(names)
1934
2258
  {
1935
2259
  PKCS10.addCertificationRequestInfo(names, "certificationRequestInfo");
@@ -1940,11 +2264,17 @@ class PKCS10
1940
2264
 
1941
2265
  class PKCS12
1942
2266
  {
2267
+ /**
2268
+ * @param {ASN1Names} names
2269
+ */
1943
2270
  static pfx(names)
1944
2271
  {
1945
2272
  names.typeIs(ASN1ItemType.SEQUENCE).container("PFX", PKCS12.pfxCont);
1946
2273
  }
1947
2274
 
2275
+ /**
2276
+ * @param {ASN1Names} names
2277
+ */
1948
2278
  static pfxCont(names)
1949
2279
  {
1950
2280
  names.typeIs(ASN1ItemType.INTEGER).nextValue("Version");
@@ -1952,11 +2282,18 @@ class PKCS12
1952
2282
  PKCS12.addMacData(names, "macData");
1953
2283
  }
1954
2284
 
2285
+ /**
2286
+ * @param {ASN1Names} names
2287
+ * @param {string} name
2288
+ */
1955
2289
  static addMacData(names, name)
1956
2290
  {
1957
2291
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKCS12.macDataCont);
1958
2292
  }
1959
2293
 
2294
+ /**
2295
+ * @param {ASN1Names} names
2296
+ */
1960
2297
  static macDataCont(names)
1961
2298
  {
1962
2299
  PKCS7.addDigestInfo(names, "mac");
@@ -1964,6 +2301,9 @@ class PKCS12
1964
2301
  names.typeIs(ASN1ItemType.INTEGER).nextValue("iterations");
1965
2302
  }
1966
2303
 
2304
+ /**
2305
+ * @param {ASN1Names} names
2306
+ */
1967
2307
  static authenticatedSafeContentInfoCont(names)
1968
2308
  {
1969
2309
  names.typeIs(ASN1ItemType.OID).nextValue("content-type");
@@ -1973,31 +2313,49 @@ class PKCS12
1973
2313
  names.nextValue("pkcs7-content"); ////////////////////////
1974
2314
  }
1975
2315
 
2316
+ /**
2317
+ * @param {ASN1Names} names
2318
+ */
1976
2319
  static authenticatedSafeData(names)
1977
2320
  {
1978
2321
  names.typeIs(ASN1ItemType.OCTET_STRING).container("data", PKCS12.authenticatedSafe);
1979
2322
  }
1980
2323
 
2324
+ /**
2325
+ * @param {ASN1Names} names
2326
+ */
1981
2327
  static authenticatedSafeEnvelopedData(names)
1982
2328
  {
1983
2329
  names.typeIs(ASN1ItemType.SEQUENCE).container("signed-data", PKCS7.envelopedDataCont);
1984
2330
  }
1985
2331
 
2332
+ /**
2333
+ * @param {ASN1Names} names
2334
+ */
1986
2335
  static authenticatedSafeEncryptedData(names)
1987
2336
  {
1988
2337
  names.typeIs(ASN1ItemType.SEQUENCE).container("encrypted-data", PKCS7.encryptedDataCont);
1989
2338
  }
1990
2339
 
2340
+ /**
2341
+ * @param {ASN1Names} names
2342
+ */
1991
2343
  static authenticatedSafe(names)
1992
2344
  {
1993
2345
  names.typeIs(ASN1ItemType.SEQUENCE).container("AuthenticatedSafe", PKCS12.authSafeContentInfo);
1994
2346
  }
1995
2347
 
2348
+ /**
2349
+ * @param {ASN1Names} names
2350
+ */
1996
2351
  static authSafeContentInfo(names)
1997
2352
  {
1998
2353
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("ContentInfo", PKCS12.authSafeContentInfoCont);
1999
2354
  }
2000
2355
 
2356
+ /**
2357
+ * @param {ASN1Names} names
2358
+ */
2001
2359
  static authSafeContentInfoCont(names)
2002
2360
  {
2003
2361
  names.typeIs(ASN1ItemType.OID).nextValue("content-type");
@@ -2011,21 +2369,33 @@ class PKCS12
2011
2369
  names.nextValue("pkcs7-content"); ////////////////////////
2012
2370
  }
2013
2371
 
2372
+ /**
2373
+ * @param {ASN1Names} names
2374
+ */
2014
2375
  static safeContentsData(names)
2015
2376
  {
2016
2377
  names.typeIs(ASN1ItemType.OCTET_STRING).container("data", PKCS12.safeContents);
2017
2378
  }
2018
2379
 
2380
+ /**
2381
+ * @param {ASN1Names} names
2382
+ */
2019
2383
  static safeContents(names)
2020
2384
  {
2021
2385
  names.typeIs(ASN1ItemType.SEQUENCE).container("SafeContents", PKCS12.safeContentsCont);
2022
2386
  }
2023
2387
 
2388
+ /**
2389
+ * @param {ASN1Names} names
2390
+ */
2024
2391
  static safeContentsCont(names)
2025
2392
  {
2026
2393
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("SafeBag", PKCS12.safeBagCont);
2027
2394
  }
2028
2395
 
2396
+ /**
2397
+ * @param {ASN1Names} names
2398
+ */
2029
2399
  static safeBagCont(names)
2030
2400
  {
2031
2401
  names.typeIs(ASN1ItemType.OID).nextValue("bagId");
@@ -2038,11 +2408,17 @@ class PKCS12
2038
2408
  names.typeIs(ASN1ItemType.SET).container("bagAttributes", PKCS12.pkcs12Attributes);
2039
2409
  }
2040
2410
 
2411
+ /**
2412
+ * @param {ASN1Names} names
2413
+ */
2041
2414
  static certBag(names)
2042
2415
  {
2043
2416
  names.typeIs(ASN1ItemType.SEQUENCE).container("CertBag", PKCS12.certBagCont);
2044
2417
  }
2045
2418
 
2419
+ /**
2420
+ * @param {ASN1Names} names
2421
+ */
2046
2422
  static certBagCont(names)
2047
2423
  {
2048
2424
  names.typeIs(ASN1ItemType.OID).nextValue("certId");
@@ -2050,43 +2426,67 @@ class PKCS12
2050
2426
  names.lastOIDAndTypeIs("1.2.840.113549.1.9.22.2", ASN1ItemType.CONTEXT_SPECIFIC_0).container("certValue", PKCS12.sdsiCertificate);
2051
2427
  }
2052
2428
 
2429
+ /**
2430
+ * @param {ASN1Names} names
2431
+ */
2053
2432
  static x509Certificate(names)
2054
2433
  {
2055
2434
  names.typeIs(ASN1ItemType.OCTET_STRING).container("x509Certificate", PKIX1Explicit88.certificate);
2056
2435
  }
2057
2436
 
2437
+ /**
2438
+ * @param {ASN1Names} names
2439
+ */
2058
2440
  static sdsiCertificate(names)
2059
2441
  {
2060
2442
  names.typeIs(ASN1ItemType.IA5STRING).nextValue("sdsiCertificate");
2061
2443
  }
2062
2444
 
2445
+ /**
2446
+ * @param {ASN1Names} names
2447
+ */
2063
2448
  static crlBag(names)
2064
2449
  {
2065
2450
  names.typeIs(ASN1ItemType.SEQUENCE).container("CRLBag", PKCS12.crlBagCont);
2066
2451
  }
2067
2452
 
2453
+ /**
2454
+ * @param {ASN1Names} names
2455
+ */
2068
2456
  static crlBagCont(names)
2069
2457
  {
2070
2458
  names.typeIs(ASN1ItemType.OID).nextValue("crlId");
2071
2459
  names.lastOIDAndTypeIs("1.2.840.113549.1.9.23.1", ASN1ItemType.CONTEXT_SPECIFIC_0).container("crlValue", PKCS12.x509CRL);
2072
2460
  }
2073
2461
 
2462
+ /**
2463
+ * @param {ASN1Names} names
2464
+ */
2074
2465
  static x509CRL(names)
2075
2466
  {
2076
2467
  names.typeIs(ASN1ItemType.OCTET_STRING).container("x509CRL", PKIX1Explicit88.certificateList);
2077
2468
  }
2078
2469
 
2470
+ /**
2471
+ * @param {ASN1Names} names
2472
+ */
2079
2473
  static secretBag(names)
2080
2474
  {
2081
2475
  names.typeIs(ASN1ItemType.SEQUENCE).container("SecretBag", PKCS12.secretBagCont);
2082
2476
  }
2083
2477
 
2478
+ /**
2479
+ * @param {ASN1Names} names
2480
+ */
2084
2481
  static secretBagCont(names)
2085
2482
  {
2086
2483
  names.typeIs(ASN1ItemType.OID).nextValue("secretTypeId");
2087
2484
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).nextValue("secretValue");
2088
2485
  }
2089
2486
 
2487
+ /**
2488
+ * @param {ASN1Names} names
2489
+ */
2090
2490
  static pkcs12Attributes(names)
2091
2491
  {
2092
2492
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("PKCS12Attribute", InformationFramework.attributeCont);
@@ -2095,42 +2495,68 @@ class PKCS12
2095
2495
 
2096
2496
  class PKIX1Explicit88
2097
2497
  {
2498
+ /**
2499
+ * @param {ASN1Names} names
2500
+ * @param {string} name
2501
+ */
2098
2502
  static addAttributeTypeAndValue(names, name)
2099
2503
  {
2100
2504
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.attributeTypeAndValueCont);
2101
2505
  }
2102
2506
 
2507
+ /**
2508
+ * @param {ASN1Names} names
2509
+ */
2103
2510
  static attributeTypeAndValueCont(names)
2104
2511
  {
2105
2512
  names.typeIs(ASN1ItemType.OID).nextValue("type");
2106
2513
  names.nextValue("value");
2107
2514
  }
2108
2515
 
2516
+ /**
2517
+ * @param {ASN1Names} names
2518
+ * @param {string} name
2519
+ */
2109
2520
  static addName(names, name)
2110
2521
  {
2111
2522
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.rdnSequenceCont);
2112
2523
  }
2113
2524
 
2525
+ /**
2526
+ * @param {ASN1Names} names
2527
+ */
2114
2528
  static rdnSequenceCont(names)
2115
2529
  {
2116
2530
  names.repeatIfTypeIs(ASN1ItemType.SET).container("rdnSequence", PKIX1Explicit88.relativeDistinguishedNameCont);
2117
2531
  }
2118
2532
 
2533
+ /**
2534
+ * @param {ASN1Names} names
2535
+ */
2119
2536
  static relativeDistinguishedName(names)
2120
2537
  {
2121
2538
  names.typeIs(ASN1ItemType.SET).container("RelativeDistinguishedName", PKIX1Explicit88.relativeDistinguishedNameCont);
2122
2539
  }
2123
2540
 
2541
+ /**
2542
+ * @param {ASN1Names} names
2543
+ */
2124
2544
  static relativeDistinguishedNameCont(names)
2125
2545
  {
2126
2546
  PKIX1Explicit88.addAttributeTypeAndValue(names, "AttributeTypeAndValue");
2127
2547
  }
2128
2548
 
2549
+ /**
2550
+ * @param {ASN1Names} names
2551
+ */
2129
2552
  static certificate(names)
2130
2553
  {
2131
2554
  names.typeIs(ASN1ItemType.SEQUENCE).container("Certificate", PKIX1Explicit88.certificateCont);
2132
2555
  }
2133
2556
 
2557
+ /**
2558
+ * @param {ASN1Names} names
2559
+ */
2134
2560
  static certificateCont(names)
2135
2561
  {
2136
2562
  PKIX1Explicit88.addTBSCertificate(names, "tbsCertificate");
@@ -2138,11 +2564,18 @@ class PKIX1Explicit88
2138
2564
  names.typeIs(ASN1ItemType.BIT_STRING).nextValue("signature");
2139
2565
  }
2140
2566
 
2567
+ /**
2568
+ * @param {ASN1Names} names
2569
+ * @param {string} name
2570
+ */
2141
2571
  static addTBSCertificate(names, name)
2142
2572
  {
2143
2573
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.tbsCertificateCont);
2144
2574
  }
2145
2575
 
2576
+ /**
2577
+ * @param {ASN1Names} names
2578
+ */
2146
2579
  static tbsCertificateCont(names)
2147
2580
  {
2148
2581
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("version", PKIX1Explicit88.version);
@@ -2157,28 +2590,45 @@ class PKIX1Explicit88
2157
2590
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_3).container("extensions", PKIX1Explicit88.extensions);
2158
2591
  }
2159
2592
 
2593
+ /**
2594
+ * @param {ASN1Names} names
2595
+ */
2160
2596
  static version(names)
2161
2597
  {
2162
2598
  let versions = ["v1", "v2", "v3"];
2163
2599
  names.typeIs(ASN1ItemType.INTEGER).enum("Version", versions);
2164
2600
  }
2165
2601
 
2602
+ /**
2603
+ * @param {ASN1Names} names
2604
+ * @param {string} name
2605
+ */
2166
2606
  static addValidity(names, name)
2167
2607
  {
2168
2608
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.validityCont);
2169
2609
  }
2170
2610
 
2611
+ /**
2612
+ * @param {ASN1Names} names
2613
+ */
2171
2614
  static validityCont(names)
2172
2615
  {
2173
2616
  names.typeIsTime().nextValue("notBefore");
2174
2617
  names.typeIsTime().nextValue("notAfter");
2175
2618
  }
2176
2619
 
2620
+ /**
2621
+ * @param {ASN1Names} names
2622
+ * @param {string} name
2623
+ */
2177
2624
  static addSubjectPublicKeyInfo(names, name)
2178
2625
  {
2179
2626
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.subjectPublicKeyInfoCont);
2180
2627
  }
2181
2628
 
2629
+ /**
2630
+ * @param {ASN1Names} names
2631
+ */
2182
2632
  static subjectPublicKeyInfoCont(names)
2183
2633
  {
2184
2634
  PKIX1Explicit88.addAlgorithmIdentifier(names, "algorithm");
@@ -2186,21 +2636,34 @@ class PKIX1Explicit88
2186
2636
  names.typeIs(ASN1ItemType.BIT_STRING).nextValue("subjectPublicKey");
2187
2637
  }
2188
2638
 
2639
+ /**
2640
+ * @param {ASN1Names} names
2641
+ * @param {string} name
2642
+ */
2189
2643
  static addExtensions(names, name)
2190
2644
  {
2191
2645
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.extensionsCont);
2192
2646
  }
2193
2647
 
2648
+ /**
2649
+ * @param {ASN1Names} names
2650
+ */
2194
2651
  static extensions(names)
2195
2652
  {
2196
2653
  names.typeIs(ASN1ItemType.SEQUENCE).container("Extensions", PKIX1Explicit88.extensionsCont);
2197
2654
  }
2198
2655
 
2656
+ /**
2657
+ * @param {ASN1Names} names
2658
+ */
2199
2659
  static extensionsCont(names)
2200
2660
  {
2201
2661
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("Extension", PKIX1Explicit88.extensionCont);
2202
2662
  }
2203
2663
 
2664
+ /**
2665
+ * @param {ASN1Names} names
2666
+ */
2204
2667
  static extensionCont(names)
2205
2668
  {
2206
2669
  names.typeIs(ASN1ItemType.OID).nextValue("extnID");
@@ -2218,11 +2681,17 @@ class PKIX1Explicit88
2218
2681
  names.nextValue("extnValue");//////////////////////////////
2219
2682
  }
2220
2683
 
2684
+ /**
2685
+ * @param {ASN1Names} names
2686
+ */
2221
2687
  static certificateList(names)
2222
2688
  {
2223
2689
  names.typeIs(ASN1ItemType.SEQUENCE).container("CertificateList", PKIX1Explicit88.certificateListCont);
2224
2690
  }
2225
2691
 
2692
+ /**
2693
+ * @param {ASN1Names} names
2694
+ */
2226
2695
  static certificateListCont(names)
2227
2696
  {
2228
2697
  PKIX1Explicit88.addTBSCertList(names, "tbsCertList");
@@ -2230,11 +2699,18 @@ class PKIX1Explicit88
2230
2699
  names.typeIs(ASN1ItemType.BIT_STRING).nextValue("signature");
2231
2700
  }
2232
2701
 
2702
+ /**
2703
+ * @param {ASN1Names} names
2704
+ * @param {string} name
2705
+ */
2233
2706
  static addTBSCertList(names, name)
2234
2707
  {
2235
2708
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.tbsCertListCont);
2236
2709
  }
2237
2710
 
2711
+ /**
2712
+ * @param {ASN1Names} names
2713
+ */
2238
2714
  static tbsCertListCont(names)
2239
2715
  {
2240
2716
  names.typeIs(ASN1ItemType.INTEGER).nextValue("Version");
@@ -2246,11 +2722,17 @@ class PKIX1Explicit88
2246
2722
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("crlExtensions", PKIX1Explicit88.extensions);
2247
2723
  }
2248
2724
 
2725
+ /**
2726
+ * @param {ASN1Names} names
2727
+ */
2249
2728
  static revokedCertificates(names)
2250
2729
  {
2251
2730
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("revokedCertificate", PKIX1Explicit88.revokedCertificateCont);
2252
2731
  }
2253
2732
 
2733
+ /**
2734
+ * @param {ASN1Names} names
2735
+ */
2254
2736
  static revokedCertificateCont(names)
2255
2737
  {
2256
2738
  names.typeIs(ASN1ItemType.INTEGER).nextValue("userCertificate");
@@ -2258,11 +2740,18 @@ class PKIX1Explicit88
2258
2740
  names.typeIs(ASN1ItemType.SEQUENCE).container("crlEntryExtensions", PKIX1Explicit88.extensionsCont);
2259
2741
  }
2260
2742
 
2743
+ /**
2744
+ * @param {ASN1Names} names
2745
+ * @param {string} name
2746
+ */
2261
2747
  static addAlgorithmIdentifier(names, name)
2262
2748
  {
2263
2749
  names.typeIs(ASN1ItemType.SEQUENCE).container(name, PKIX1Explicit88.algorithmIdentifierCont);
2264
2750
  }
2265
2751
 
2752
+ /**
2753
+ * @param {ASN1Names} names
2754
+ */
2266
2755
  static algorithmIdentifierCont(names)
2267
2756
  {
2268
2757
  names.typeIs(ASN1ItemType.OID).nextValue("algorithm");
@@ -2274,11 +2763,17 @@ class PKIX1Explicit88
2274
2763
 
2275
2764
  class PKIX1Implicit88
2276
2765
  {
2766
+ /**
2767
+ * @param {ASN1Names} names
2768
+ */
2277
2769
  static authorityKeyIdentifier(names)
2278
2770
  {
2279
2771
  names.typeIs(ASN1ItemType.SEQUENCE).container("AuthorityKeyIdentifier", PKIX1Implicit88.authorityKeyIdentifierCont);
2280
2772
  }
2281
2773
 
2774
+ /**
2775
+ * @param {ASN1Names} names
2776
+ */
2282
2777
  static authorityKeyIdentifierCont(names)
2283
2778
  {
2284
2779
  names.typeIsOpt(0).nextValue("keyIdentifier");
@@ -2286,48 +2781,75 @@ class PKIX1Implicit88
2286
2781
  names.typeIsOpt(2).nextValue("authorityCertSerialNumber");
2287
2782
  }
2288
2783
 
2784
+ /**
2785
+ * @param {ASN1Names} names
2786
+ */
2289
2787
  static subjectKeyIdentifier(names)
2290
2788
  {
2291
2789
  names.typeIs(ASN1ItemType.OCTET_STRING).nextValue("SubjectKeyIdentifier");
2292
2790
  }
2293
2791
 
2792
+ /**
2793
+ * @param {ASN1Names} names
2794
+ */
2294
2795
  static keyUsage(names)
2295
2796
  {
2296
2797
  names.typeIs(ASN1ItemType.BIT_STRING).nextValue("KeyUsage");
2297
2798
  }
2298
2799
 
2800
+ /**
2801
+ * @param {ASN1Names} names
2802
+ */
2299
2803
  static certificatePolicies(names)
2300
2804
  {
2301
2805
  names.typeIs(ASN1ItemType.SEQUENCE).container("CertificatePolicies", PKIX1Implicit88.certificatePoliciesCont);
2302
2806
  }
2303
2807
 
2808
+ /**
2809
+ * @param {ASN1Names} names
2810
+ */
2304
2811
  static certificatePoliciesCont(names)
2305
2812
  {
2306
2813
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("PolicyInformation", PKIX1Implicit88.policyInformationCont);
2307
2814
  }
2308
2815
 
2816
+ /**
2817
+ * @param {ASN1Names} names
2818
+ */
2309
2819
  static policyInformationCont(names)
2310
2820
  {
2311
2821
  names.typeIs(ASN1ItemType.OID).nextValue("policyIdentifier");
2312
2822
  names.typeIs(ASN1ItemType.SEQUENCE).container("policyQualifiers", PKIX1Implicit88.policyQualifiers);
2313
2823
  }
2314
2824
 
2825
+ /**
2826
+ * @param {ASN1Names} names
2827
+ */
2315
2828
  static policyQualifiers(names)
2316
2829
  {
2317
2830
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("PolicyQualifierInfo", PKIX1Implicit88.policyQualifierInfoCont);
2318
2831
  }
2319
2832
 
2833
+ /**
2834
+ * @param {ASN1Names} names
2835
+ */
2320
2836
  static policyQualifierInfoCont(names)
2321
2837
  {
2322
2838
  names.typeIs(ASN1ItemType.OID).nextValue("policyQualifierId");
2323
2839
  names.nextValue("qualifier");
2324
2840
  }
2325
2841
 
2842
+ /**
2843
+ * @param {ASN1Names} names
2844
+ */
2326
2845
  static generalNames(names)
2327
2846
  {
2328
2847
  names.typeIs(ASN1ItemType.SEQUENCE).container("GeneralName", PKIX1Implicit88.generalNameCont);
2329
2848
  }
2330
2849
 
2850
+ /**
2851
+ * @param {ASN1Names} names
2852
+ */
2331
2853
  static generalNameCont(names)
2332
2854
  {
2333
2855
  names.typeIsOpt(0).nextValue("otherName");
@@ -2342,27 +2864,42 @@ class PKIX1Implicit88
2342
2864
  names.allNotMatch().nextValue("unknown");
2343
2865
  }
2344
2866
 
2867
+ /**
2868
+ * @param {ASN1Names} names
2869
+ */
2345
2870
  static basicConstraints(names)
2346
2871
  {
2347
2872
  names.typeIs(ASN1ItemType.SEQUENCE).container("BasicConstraints", PKIX1Implicit88.basicConstraintsCont);
2348
2873
  }
2349
2874
 
2875
+ /**
2876
+ * @param {ASN1Names} names
2877
+ */
2350
2878
  static basicConstraintsCont(names)
2351
2879
  {
2352
2880
  names.typeIs(ASN1ItemType.BOOLEAN).nextValue("cA");
2353
2881
  names.typeIs(ASN1ItemType.INTEGER).nextValue("pathLenConstraint");
2354
2882
  }
2355
2883
 
2884
+ /**
2885
+ * @param {ASN1Names} names
2886
+ */
2356
2887
  static crlDistributionPoints(names)
2357
2888
  {
2358
2889
  names.typeIs(ASN1ItemType.SEQUENCE).container("CRLDistributionPoints", PKIX1Implicit88.crlDistributionPointsCont);
2359
2890
  }
2360
2891
 
2892
+ /**
2893
+ * @param {ASN1Names} names
2894
+ */
2361
2895
  static crlDistributionPointsCont(names)
2362
2896
  {
2363
2897
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("DistributionPoint", PKIX1Implicit88.distributionPointCont);
2364
2898
  }
2365
2899
 
2900
+ /**
2901
+ * @param {ASN1Names} names
2902
+ */
2366
2903
  static distributionPointCont(names)
2367
2904
  {
2368
2905
  names.typeIsOpt(0).container("distributionPoint", PKIX1Implicit88.distributionPointName);
@@ -2370,22 +2907,34 @@ class PKIX1Implicit88
2370
2907
  names.typeIsOpt(2).container("cRLIssuer", PKIX1Implicit88.generalNames);
2371
2908
  }
2372
2909
 
2910
+ /**
2911
+ * @param {ASN1Names} names
2912
+ */
2373
2913
  static distributionPointName(names)
2374
2914
  {
2375
2915
  names.typeIsOpt(0).container("fullName", PKIX1Implicit88.generalNameCont);
2376
2916
  names.typeIsOpt(1).container("nameRelativeToCRLIssuer", PKIX1Explicit88.relativeDistinguishedNameCont);
2377
2917
  }
2378
2918
 
2919
+ /**
2920
+ * @param {ASN1Names} names
2921
+ */
2379
2922
  static reasonFlags(names)
2380
2923
  {
2381
2924
  names.typeIs(ASN1ItemType.BIT_STRING).nextValue("ReasonFlags");
2382
2925
  }
2383
2926
 
2927
+ /**
2928
+ * @param {ASN1Names} names
2929
+ */
2384
2930
  static extKeyUsageSyntax(names)
2385
2931
  {
2386
2932
  names.typeIs(ASN1ItemType.SEQUENCE).container("ExtKeyUsageSyntax", PKIX1Implicit88.extKeyUsageSyntaxCont);
2387
2933
  }
2388
2934
 
2935
+ /**
2936
+ * @param {ASN1Names} names
2937
+ */
2389
2938
  static extKeyUsageSyntaxCont(names)
2390
2939
  {
2391
2940
  names.repeatIfTypeIs(ASN1ItemType.OID).nextValue("KeyPurposeId");
@@ -2394,16 +2943,25 @@ class PKIX1Implicit88
2394
2943
 
2395
2944
  class RFC2459
2396
2945
  {
2946
+ /**
2947
+ * @param {ASN1Names} names
2948
+ */
2397
2949
  static authorityInfoAccessSyntax(names)
2398
2950
  {
2399
2951
  names.typeIs(ASN1ItemType.SEQUENCE).container("AuthorityInfoAccessSyntax", RFC2459.authorityInfoAccessSyntaxCont);
2400
2952
  }
2401
2953
 
2954
+ /**
2955
+ * @param {ASN1Names} names
2956
+ */
2402
2957
  static authorityInfoAccessSyntaxCont(names)
2403
2958
  {
2404
2959
  names.repeatIfTypeIs(ASN1ItemType.SEQUENCE).container("AccessDescription", RFC2459.accessDescriptionCont);
2405
2960
  }
2406
2961
 
2962
+ /**
2963
+ * @param {ASN1Names} names
2964
+ */
2407
2965
  static accessDescriptionCont(names)
2408
2966
  {
2409
2967
  names.typeIs(ASN1ItemType.OID).nextValue("accessMethod");
@@ -2413,6 +2971,9 @@ class RFC2459
2413
2971
 
2414
2972
  class RFC8551
2415
2973
  {
2974
+ /**
2975
+ * @param {ASN1Names} names
2976
+ */
2416
2977
  static smimeEncryptionKeyPreference(names)
2417
2978
  {
2418
2979
  names.typeIs(ASN1ItemType.CONTEXT_SPECIFIC_0).container("issuerAndSerialNumber", PKCS7.issuerAndSerialNumberCont);
@@ -2429,6 +2990,9 @@ export class ASN1PDUBuilder
2429
2990
  this.buff = [];
2430
2991
  }
2431
2992
 
2993
+ /**
2994
+ * @param {number} type
2995
+ */
2432
2996
  beginOther(type)
2433
2997
  {
2434
2998
  this.buff.push(type);
@@ -2446,6 +3010,9 @@ export class ASN1PDUBuilder
2446
3010
  this.beginOther(0x31);
2447
3011
  }
2448
3012
 
3013
+ /**
3014
+ * @param {number} n
3015
+ */
2449
3016
  beginContentSpecific(n)
2450
3017
  {
2451
3018
  this.beginOther(0xa0 + n);
@@ -2487,6 +3054,9 @@ export class ASN1PDUBuilder
2487
3054
  }
2488
3055
  }
2489
3056
 
3057
+ /**
3058
+ * @param {boolean} v
3059
+ */
2490
3060
  appendBool(v)
2491
3061
  {
2492
3062
  this.buff.push(1);
@@ -2494,6 +3064,9 @@ export class ASN1PDUBuilder
2494
3064
  this.buff.push(v?0xFF:0);
2495
3065
  }
2496
3066
 
3067
+ /**
3068
+ * @param {number} v
3069
+ */
2497
3070
  appendInt32(v)
2498
3071
  {
2499
3072
  this.buff.push(2);
@@ -2525,6 +3098,10 @@ export class ASN1PDUBuilder
2525
3098
  }
2526
3099
  }
2527
3100
 
3101
+ /**
3102
+ * @param {number} bitLeft
3103
+ * @param {ArrayBuffer} buff
3104
+ */
2528
3105
  appendBitString(bitLeft, buff)
2529
3106
  {
2530
3107
  this.appendTypeLen(3, buff.byteLength + 1);
@@ -2532,6 +3109,9 @@ export class ASN1PDUBuilder
2532
3109
  this.appendArrayBuffer(buff);
2533
3110
  }
2534
3111
 
3112
+ /**
3113
+ * @param {string | ArrayBuffer} buff
3114
+ */
2535
3115
  appendOctetString(buff)
2536
3116
  {
2537
3117
  if (buff instanceof ArrayBuffer)
@@ -2556,12 +3136,18 @@ export class ASN1PDUBuilder
2556
3136
  this.appendTypeLen(5, 0);
2557
3137
  }
2558
3138
 
3139
+ /**
3140
+ * @param {ArrayBufferLike} buff
3141
+ */
2559
3142
  appendOID(buff)
2560
3143
  {
2561
3144
  this.appendTypeLen(6, buff.byteLength);
2562
3145
  this.appendArrayBuffer(buff);
2563
3146
  }
2564
3147
 
3148
+ /**
3149
+ * @param {string} oidStr
3150
+ */
2565
3151
  appendOIDString(oidStr)
2566
3152
  {
2567
3153
  let buff = ASN1Util.oidText2PDU(oidStr);
@@ -2570,6 +3156,9 @@ export class ASN1PDUBuilder
2570
3156
  this.appendOID(new Uint8Array(buff).buffer);
2571
3157
  }
2572
3158
 
3159
+ /**
3160
+ * @param {number} v
3161
+ */
2573
3162
  appendChoice(v)
2574
3163
  {
2575
3164
  this.buff.push(10);
@@ -2601,43 +3190,69 @@ export class ASN1PDUBuilder
2601
3190
  }
2602
3191
  }
2603
3192
 
3193
+ /**
3194
+ * @param {string} s
3195
+ */
2604
3196
  appendPrintableString(s)
2605
3197
  {
2606
3198
  this.appendOther(0x13, new TextEncoder().encode(s).buffer);
2607
3199
  }
2608
3200
 
3201
+ /**
3202
+ * @param {string} s
3203
+ */
2609
3204
  appendUTF8String(s)
2610
3205
  {
2611
3206
  this.appendOther(0xc, new TextEncoder().encode(s).buffer);
2612
3207
  }
2613
3208
 
3209
+ /**
3210
+ * @param {string} s
3211
+ */
2614
3212
  appendIA5String(s)
2615
3213
  {
2616
3214
  this.appendOther(0x16, new TextEncoder().encode(s).buffer);
2617
3215
  }
2618
3216
 
3217
+ /**
3218
+ * @param {data.Timestamp} t
3219
+ */
2619
3220
  appendUTCTime(t)
2620
3221
  {
2621
3222
  let s = t.toUTCTime().toString("yyMMddHHmmss")+"Z";
2622
3223
  this.appendOther(0x17, new TextEncoder().encode(s).buffer);
2623
3224
  }
2624
3225
 
3226
+ /**
3227
+ * @param {number} type
3228
+ * @param {ArrayBufferLike} buff
3229
+ */
2625
3230
  appendOther(type, buff)
2626
3231
  {
2627
3232
  this.appendTypeLen(type, buff.byteLength);
2628
3233
  this.appendArrayBuffer(buff);
2629
3234
  }
2630
3235
 
3236
+ /**
3237
+ * @param {number} n
3238
+ * @param {ArrayBuffer} buff
3239
+ */
2631
3240
  appendContentSpecific(n, buff)
2632
3241
  {
2633
3242
  this.appendOther(0xa0 + n, buff);
2634
3243
  }
2635
3244
 
3245
+ /**
3246
+ * @param {ArrayBuffer} buff
3247
+ */
2636
3248
  appendSequence(buff)
2637
3249
  {
2638
3250
  this.appendOther(0x30, buff);
2639
3251
  }
2640
3252
 
3253
+ /**
3254
+ * @param {ArrayBuffer} buff
3255
+ */
2641
3256
  appendInteger(buff)
2642
3257
  {
2643
3258
  this.appendOther(2, buff);
@@ -2649,6 +3264,10 @@ export class ASN1PDUBuilder
2649
3264
  return new Uint8Array(this.buff).buffer;
2650
3265
  }
2651
3266
 
3267
+ /**
3268
+ * @param {number} type
3269
+ * @param {number} len
3270
+ */
2652
3271
  appendTypeLen(type, len)
2653
3272
  {
2654
3273
  this.buff.push(type);
@@ -2684,6 +3303,9 @@ export class ASN1PDUBuilder
2684
3303
  }
2685
3304
  }
2686
3305
 
3306
+ /**
3307
+ * @param {ArrayBuffer} buff
3308
+ */
2687
3309
  appendArrayBuffer(buff)
2688
3310
  {
2689
3311
  let arr = new Uint8Array(buff);