edockit 0.4.0-dev.0 → 0.4.0-dev.1

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 (49) hide show
  1. package/dist/{certificate-c46e14a0.js → certificate-3c9dcdac.js} +16 -27
  2. package/dist/certificate-3c9dcdac.js.map +1 -0
  3. package/dist/{certificate-fc0e06f7.js → certificate-c7123a37.js} +37 -27
  4. package/dist/certificate-c7123a37.js.map +1 -0
  5. package/dist/identity-c9e5052e.js +410 -0
  6. package/dist/identity-c9e5052e.js.map +1 -0
  7. package/dist/identity-fca881b1.js +406 -0
  8. package/dist/identity-fca881b1.js.map +1 -0
  9. package/dist/index.cjs.js +40 -1244
  10. package/dist/index.cjs.js.map +1 -1
  11. package/dist/index.esm.js +36 -1240
  12. package/dist/index.esm.js.map +1 -1
  13. package/dist/index.umd.js +23 -17
  14. package/dist/index.umd.js.map +1 -1
  15. package/dist/{loader-43d8e17a.js → loader-7a0f771f.js} +2 -2
  16. package/dist/{loader-43d8e17a.js.map → loader-7a0f771f.js.map} +1 -1
  17. package/dist/{loader-1ac52e12.js → loader-ad1a5051.js} +2 -2
  18. package/dist/{loader-1ac52e12.js.map → loader-ad1a5051.js.map} +1 -1
  19. package/dist/normalize-50862581.js +456 -0
  20. package/dist/normalize-50862581.js.map +1 -0
  21. package/dist/normalize-9626be7c.js +479 -0
  22. package/dist/normalize-9626be7c.js.map +1 -0
  23. package/dist/{reference-provider-1cd85b7b.js → reference-provider-3838ebfb.js} +4 -4
  24. package/dist/{reference-provider-1cd85b7b.js.map → reference-provider-3838ebfb.js.map} +1 -1
  25. package/dist/{reference-provider-53240217.js → reference-provider-9bbbaab8.js} +4 -4
  26. package/dist/{reference-provider-53240217.js.map → reference-provider-9bbbaab8.js.map} +1 -1
  27. package/dist/trusted-list-build.cjs.js +8 -3
  28. package/dist/trusted-list-build.cjs.js.map +1 -1
  29. package/dist/trusted-list-build.esm.js +8 -3
  30. package/dist/trusted-list-build.esm.js.map +1 -1
  31. package/dist/trusted-list-bundled.cjs.js +7 -4
  32. package/dist/trusted-list-bundled.cjs.js.map +1 -1
  33. package/dist/trusted-list-bundled.esm.js +7 -4
  34. package/dist/trusted-list-bundled.esm.js.map +1 -1
  35. package/dist/trusted-list.cjs.js +7 -4
  36. package/dist/trusted-list.cjs.js.map +1 -1
  37. package/dist/trusted-list.esm.js +7 -4
  38. package/dist/trusted-list.esm.js.map +1 -1
  39. package/package.json +1 -1
  40. package/dist/certificate-c46e14a0.js.map +0 -1
  41. package/dist/certificate-fc0e06f7.js.map +0 -1
  42. package/dist/identity-1a3dddc3.js +0 -902
  43. package/dist/identity-1a3dddc3.js.map +0 -1
  44. package/dist/identity-b3a70fc1.js +0 -897
  45. package/dist/identity-b3a70fc1.js.map +0 -1
  46. package/dist/normalize-60f2d7e6.js +0 -6270
  47. package/dist/normalize-60f2d7e6.js.map +0 -1
  48. package/dist/normalize-70da6516.js +0 -6214
  49. package/dist/normalize-70da6516.js.map +0 -1
package/dist/index.esm.js CHANGED
@@ -4,10 +4,17 @@
4
4
  */
5
5
  import { unzipSync } from 'fflate';
6
6
  import { X509Certificate, X509Crl } from '@peculiar/x509';
7
- import { c as createXMLParser, q as querySelectorAll, a as querySelector, s as serializeToXML, e as extractSignerInfo, b as checkCertificateValidity, p as parseCertificate } from './certificate-c46e14a0.js';
8
- export { f as formatValidityPeriod, g as getSignerDisplayName, p as parseCertificate } from './certificate-c46e14a0.js';
9
- import { c as checkOCSP, A as AsnConvert, e as extractIssuerIdentityFromCertificate, a as extractCertificateIdentityFromCertificate } from './identity-b3a70fc1.js';
10
- import { K as KeyIdentifier, f as fetchCRL, a as arrayBufferToBase64, _ as __decorate, A as AsnProp, b as AsnPropTypes, c as AsnIntegerArrayBufferConverter, N as Name, d as AsnType, e as AsnTypeTypes, g as AlgorithmIdentifier, O as OctetString, h as AsnArray, T as Time, G as GeneralName, i as Attribute$1, j as GeneralNames, E as Extensions, B as BitString, C as Certificate, k as AsnConstructedOctetStringConverter, l as base64ToArrayBuffer, m as arrayBufferToPEM, n as arrayBufferToHex, o as base64ToUint8Array } from './normalize-70da6516.js';
7
+ import { c as createXMLParser, q as querySelectorAll, a as querySelector, s as serializeToXML, e as extractSignerInfo, b as checkCertificateValidity, p as parseCertificate } from './certificate-3c9dcdac.js';
8
+ export { f as formatValidityPeriod, g as getSignerDisplayName, p as parseCertificate } from './certificate-3c9dcdac.js';
9
+ import { c as checkOCSP, e as extractIssuerIdentityFromCertificate, a as extractCertificateIdentityFromCertificate } from './identity-fca881b1.js';
10
+ import { f as fetchCRL, a as arrayBufferToBase64, b as base64ToArrayBuffer, c as arrayBufferToPEM, d as arrayBufferToHex, e as base64ToUint8Array } from './normalize-50862581.js';
11
+ import { AsnConvert } from '@peculiar/asn1-schema';
12
+ import { ContentInfo, SignedData } from '@peculiar/asn1-cms';
13
+ import { TSTInfo } from '@peculiar/asn1-tsp';
14
+ import '@xmldom/xmldom';
15
+ import 'xpath';
16
+ import '@peculiar/asn1-ocsp';
17
+ import '@peculiar/asn1-x509';
11
18
 
12
19
  // Canonicalization method URIs
13
20
  const CANONICALIZATION_METHODS = {
@@ -1177,9 +1184,6 @@ const DEFAULT_REVOCATION_OPTIONS = {
1177
1184
  crlTimeout: 10000,
1178
1185
  };
1179
1186
 
1180
- class SubjectKeyIdentifier extends KeyIdentifier {
1181
- }
1182
-
1183
1187
  // src/core/revocation/crl.ts
1184
1188
  /**
1185
1189
  * OID for CRL Distribution Points extension
@@ -1413,1238 +1417,6 @@ async function checkCertificateRevocation(cert, options = {}) {
1413
1417
  };
1414
1418
  }
1415
1419
 
1416
- class IssuerAndSerialNumber {
1417
- constructor(params = {}) {
1418
- this.issuer = new Name();
1419
- this.serialNumber = new ArrayBuffer(0);
1420
- Object.assign(this, params);
1421
- }
1422
- }
1423
- __decorate([
1424
- AsnProp({ type: Name })
1425
- ], IssuerAndSerialNumber.prototype, "issuer", void 0);
1426
- __decorate([
1427
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
1428
- ], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
1429
-
1430
- let SignerIdentifier = class SignerIdentifier {
1431
- constructor(params = {}) {
1432
- Object.assign(this, params);
1433
- }
1434
- };
1435
- __decorate([
1436
- AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
1437
- ], SignerIdentifier.prototype, "subjectKeyIdentifier", void 0);
1438
- __decorate([
1439
- AsnProp({ type: IssuerAndSerialNumber })
1440
- ], SignerIdentifier.prototype, "issuerAndSerialNumber", void 0);
1441
- SignerIdentifier = __decorate([
1442
- AsnType({ type: AsnTypeTypes.Choice })
1443
- ], SignerIdentifier);
1444
-
1445
- var CMSVersion;
1446
- (function (CMSVersion) {
1447
- CMSVersion[CMSVersion["v0"] = 0] = "v0";
1448
- CMSVersion[CMSVersion["v1"] = 1] = "v1";
1449
- CMSVersion[CMSVersion["v2"] = 2] = "v2";
1450
- CMSVersion[CMSVersion["v3"] = 3] = "v3";
1451
- CMSVersion[CMSVersion["v4"] = 4] = "v4";
1452
- CMSVersion[CMSVersion["v5"] = 5] = "v5";
1453
- })(CMSVersion || (CMSVersion = {}));
1454
- let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
1455
- };
1456
- DigestAlgorithmIdentifier = __decorate([
1457
- AsnType({ type: AsnTypeTypes.Sequence })
1458
- ], DigestAlgorithmIdentifier);
1459
- let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
1460
- };
1461
- SignatureAlgorithmIdentifier = __decorate([
1462
- AsnType({ type: AsnTypeTypes.Sequence })
1463
- ], SignatureAlgorithmIdentifier);
1464
- let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
1465
- };
1466
- KeyEncryptionAlgorithmIdentifier = __decorate([
1467
- AsnType({ type: AsnTypeTypes.Sequence })
1468
- ], KeyEncryptionAlgorithmIdentifier);
1469
- let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
1470
- };
1471
- ContentEncryptionAlgorithmIdentifier = __decorate([
1472
- AsnType({ type: AsnTypeTypes.Sequence })
1473
- ], ContentEncryptionAlgorithmIdentifier);
1474
- let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
1475
- };
1476
- MessageAuthenticationCodeAlgorithm = __decorate([
1477
- AsnType({ type: AsnTypeTypes.Sequence })
1478
- ], MessageAuthenticationCodeAlgorithm);
1479
- let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
1480
- };
1481
- KeyDerivationAlgorithmIdentifier = __decorate([
1482
- AsnType({ type: AsnTypeTypes.Sequence })
1483
- ], KeyDerivationAlgorithmIdentifier);
1484
-
1485
- class Attribute {
1486
- constructor(params = {}) {
1487
- this.attrType = "";
1488
- this.attrValues = [];
1489
- Object.assign(this, params);
1490
- }
1491
- }
1492
- __decorate([
1493
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
1494
- ], Attribute.prototype, "attrType", void 0);
1495
- __decorate([
1496
- AsnProp({ type: AsnPropTypes.Any, repeated: "set" })
1497
- ], Attribute.prototype, "attrValues", void 0);
1498
-
1499
- var SignerInfos_1;
1500
- class SignerInfo {
1501
- constructor(params = {}) {
1502
- this.version = CMSVersion.v0;
1503
- this.sid = new SignerIdentifier();
1504
- this.digestAlgorithm = new DigestAlgorithmIdentifier();
1505
- this.signatureAlgorithm = new SignatureAlgorithmIdentifier();
1506
- this.signature = new OctetString();
1507
- Object.assign(this, params);
1508
- }
1509
- }
1510
- __decorate([
1511
- AsnProp({ type: AsnPropTypes.Integer })
1512
- ], SignerInfo.prototype, "version", void 0);
1513
- __decorate([
1514
- AsnProp({ type: SignerIdentifier })
1515
- ], SignerInfo.prototype, "sid", void 0);
1516
- __decorate([
1517
- AsnProp({ type: DigestAlgorithmIdentifier })
1518
- ], SignerInfo.prototype, "digestAlgorithm", void 0);
1519
- __decorate([
1520
- AsnProp({
1521
- type: Attribute,
1522
- repeated: "set",
1523
- context: 0,
1524
- implicit: true,
1525
- optional: true,
1526
- raw: true,
1527
- })
1528
- ], SignerInfo.prototype, "signedAttrs", void 0);
1529
- __decorate([
1530
- AsnProp({ type: SignatureAlgorithmIdentifier })
1531
- ], SignerInfo.prototype, "signatureAlgorithm", void 0);
1532
- __decorate([
1533
- AsnProp({ type: OctetString })
1534
- ], SignerInfo.prototype, "signature", void 0);
1535
- __decorate([
1536
- AsnProp({ type: Attribute, repeated: "set", context: 1, implicit: true, optional: true })
1537
- ], SignerInfo.prototype, "unsignedAttrs", void 0);
1538
- let SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {
1539
- constructor(items) {
1540
- super(items);
1541
- Object.setPrototypeOf(this, SignerInfos_1.prototype);
1542
- }
1543
- };
1544
- SignerInfos = SignerInfos_1 = __decorate([
1545
- AsnType({ type: AsnTypeTypes.Set, itemType: SignerInfo })
1546
- ], SignerInfos);
1547
-
1548
- let CounterSignature = class CounterSignature extends SignerInfo {
1549
- };
1550
- CounterSignature = __decorate([
1551
- AsnType({ type: AsnTypeTypes.Sequence })
1552
- ], CounterSignature);
1553
-
1554
- let SigningTime = class SigningTime extends Time {
1555
- };
1556
- SigningTime = __decorate([
1557
- AsnType({ type: AsnTypeTypes.Choice })
1558
- ], SigningTime);
1559
-
1560
- class ACClearAttrs {
1561
- constructor(params = {}) {
1562
- this.acIssuer = new GeneralName();
1563
- this.acSerial = 0;
1564
- this.attrs = [];
1565
- Object.assign(this, params);
1566
- }
1567
- }
1568
- __decorate([
1569
- AsnProp({ type: GeneralName })
1570
- ], ACClearAttrs.prototype, "acIssuer", void 0);
1571
- __decorate([
1572
- AsnProp({ type: AsnPropTypes.Integer })
1573
- ], ACClearAttrs.prototype, "acSerial", void 0);
1574
- __decorate([
1575
- AsnProp({ type: Attribute$1, repeated: "sequence" })
1576
- ], ACClearAttrs.prototype, "attrs", void 0);
1577
-
1578
- var AttrSpec_1;
1579
- let AttrSpec = AttrSpec_1 = class AttrSpec extends AsnArray {
1580
- constructor(items) {
1581
- super(items);
1582
- Object.setPrototypeOf(this, AttrSpec_1.prototype);
1583
- }
1584
- };
1585
- AttrSpec = AttrSpec_1 = __decorate([
1586
- AsnType({ type: AsnTypeTypes.Sequence, itemType: AsnPropTypes.ObjectIdentifier })
1587
- ], AttrSpec);
1588
-
1589
- class AAControls {
1590
- constructor(params = {}) {
1591
- this.permitUnSpecified = true;
1592
- Object.assign(this, params);
1593
- }
1594
- }
1595
- __decorate([
1596
- AsnProp({ type: AsnPropTypes.Integer, optional: true })
1597
- ], AAControls.prototype, "pathLenConstraint", void 0);
1598
- __decorate([
1599
- AsnProp({ type: AttrSpec, implicit: true, context: 0, optional: true })
1600
- ], AAControls.prototype, "permittedAttrs", void 0);
1601
- __decorate([
1602
- AsnProp({ type: AttrSpec, implicit: true, context: 1, optional: true })
1603
- ], AAControls.prototype, "excludedAttrs", void 0);
1604
- __decorate([
1605
- AsnProp({ type: AsnPropTypes.Boolean, defaultValue: true })
1606
- ], AAControls.prototype, "permitUnSpecified", void 0);
1607
-
1608
- class IssuerSerial {
1609
- constructor(params = {}) {
1610
- this.issuer = new GeneralNames();
1611
- this.serial = new ArrayBuffer(0);
1612
- this.issuerUID = new ArrayBuffer(0);
1613
- Object.assign(this, params);
1614
- }
1615
- }
1616
- __decorate([
1617
- AsnProp({ type: GeneralNames })
1618
- ], IssuerSerial.prototype, "issuer", void 0);
1619
- __decorate([
1620
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
1621
- ], IssuerSerial.prototype, "serial", void 0);
1622
- __decorate([
1623
- AsnProp({ type: AsnPropTypes.BitString, optional: true })
1624
- ], IssuerSerial.prototype, "issuerUID", void 0);
1625
-
1626
- var DigestedObjectType;
1627
- (function (DigestedObjectType) {
1628
- DigestedObjectType[DigestedObjectType["publicKey"] = 0] = "publicKey";
1629
- DigestedObjectType[DigestedObjectType["publicKeyCert"] = 1] = "publicKeyCert";
1630
- DigestedObjectType[DigestedObjectType["otherObjectTypes"] = 2] = "otherObjectTypes";
1631
- })(DigestedObjectType || (DigestedObjectType = {}));
1632
- class ObjectDigestInfo {
1633
- constructor(params = {}) {
1634
- this.digestedObjectType = DigestedObjectType.publicKey;
1635
- this.digestAlgorithm = new AlgorithmIdentifier();
1636
- this.objectDigest = new ArrayBuffer(0);
1637
- Object.assign(this, params);
1638
- }
1639
- }
1640
- __decorate([
1641
- AsnProp({ type: AsnPropTypes.Enumerated })
1642
- ], ObjectDigestInfo.prototype, "digestedObjectType", void 0);
1643
- __decorate([
1644
- AsnProp({ type: AsnPropTypes.ObjectIdentifier, optional: true })
1645
- ], ObjectDigestInfo.prototype, "otherObjectTypeID", void 0);
1646
- __decorate([
1647
- AsnProp({ type: AlgorithmIdentifier })
1648
- ], ObjectDigestInfo.prototype, "digestAlgorithm", void 0);
1649
- __decorate([
1650
- AsnProp({ type: AsnPropTypes.BitString })
1651
- ], ObjectDigestInfo.prototype, "objectDigest", void 0);
1652
-
1653
- class V2Form {
1654
- constructor(params = {}) {
1655
- Object.assign(this, params);
1656
- }
1657
- }
1658
- __decorate([
1659
- AsnProp({ type: GeneralNames, optional: true })
1660
- ], V2Form.prototype, "issuerName", void 0);
1661
- __decorate([
1662
- AsnProp({ type: IssuerSerial, context: 0, implicit: true, optional: true })
1663
- ], V2Form.prototype, "baseCertificateID", void 0);
1664
- __decorate([
1665
- AsnProp({ type: ObjectDigestInfo, context: 1, implicit: true, optional: true })
1666
- ], V2Form.prototype, "objectDigestInfo", void 0);
1667
-
1668
- let AttCertIssuer = class AttCertIssuer {
1669
- constructor(params = {}) {
1670
- Object.assign(this, params);
1671
- }
1672
- };
1673
- __decorate([
1674
- AsnProp({ type: GeneralName, repeated: "sequence" })
1675
- ], AttCertIssuer.prototype, "v1Form", void 0);
1676
- __decorate([
1677
- AsnProp({ type: V2Form, context: 0, implicit: true })
1678
- ], AttCertIssuer.prototype, "v2Form", void 0);
1679
- AttCertIssuer = __decorate([
1680
- AsnType({ type: AsnTypeTypes.Choice })
1681
- ], AttCertIssuer);
1682
-
1683
- class AttCertValidityPeriod {
1684
- constructor(params = {}) {
1685
- this.notBeforeTime = new Date();
1686
- this.notAfterTime = new Date();
1687
- Object.assign(this, params);
1688
- }
1689
- }
1690
- __decorate([
1691
- AsnProp({ type: AsnPropTypes.GeneralizedTime })
1692
- ], AttCertValidityPeriod.prototype, "notBeforeTime", void 0);
1693
- __decorate([
1694
- AsnProp({ type: AsnPropTypes.GeneralizedTime })
1695
- ], AttCertValidityPeriod.prototype, "notAfterTime", void 0);
1696
-
1697
- class Holder {
1698
- constructor(params = {}) {
1699
- Object.assign(this, params);
1700
- }
1701
- }
1702
- __decorate([
1703
- AsnProp({ type: IssuerSerial, implicit: true, context: 0, optional: true })
1704
- ], Holder.prototype, "baseCertificateID", void 0);
1705
- __decorate([
1706
- AsnProp({ type: GeneralNames, implicit: true, context: 1, optional: true })
1707
- ], Holder.prototype, "entityName", void 0);
1708
- __decorate([
1709
- AsnProp({ type: ObjectDigestInfo, implicit: true, context: 2, optional: true })
1710
- ], Holder.prototype, "objectDigestInfo", void 0);
1711
-
1712
- var AttCertVersion;
1713
- (function (AttCertVersion) {
1714
- AttCertVersion[AttCertVersion["v2"] = 1] = "v2";
1715
- })(AttCertVersion || (AttCertVersion = {}));
1716
- class AttributeCertificateInfo {
1717
- constructor(params = {}) {
1718
- this.version = AttCertVersion.v2;
1719
- this.holder = new Holder();
1720
- this.issuer = new AttCertIssuer();
1721
- this.signature = new AlgorithmIdentifier();
1722
- this.serialNumber = new ArrayBuffer(0);
1723
- this.attrCertValidityPeriod = new AttCertValidityPeriod();
1724
- this.attributes = [];
1725
- Object.assign(this, params);
1726
- }
1727
- }
1728
- __decorate([
1729
- AsnProp({ type: AsnPropTypes.Integer })
1730
- ], AttributeCertificateInfo.prototype, "version", void 0);
1731
- __decorate([
1732
- AsnProp({ type: Holder })
1733
- ], AttributeCertificateInfo.prototype, "holder", void 0);
1734
- __decorate([
1735
- AsnProp({ type: AttCertIssuer })
1736
- ], AttributeCertificateInfo.prototype, "issuer", void 0);
1737
- __decorate([
1738
- AsnProp({ type: AlgorithmIdentifier })
1739
- ], AttributeCertificateInfo.prototype, "signature", void 0);
1740
- __decorate([
1741
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
1742
- ], AttributeCertificateInfo.prototype, "serialNumber", void 0);
1743
- __decorate([
1744
- AsnProp({ type: AttCertValidityPeriod })
1745
- ], AttributeCertificateInfo.prototype, "attrCertValidityPeriod", void 0);
1746
- __decorate([
1747
- AsnProp({ type: Attribute$1, repeated: "sequence" })
1748
- ], AttributeCertificateInfo.prototype, "attributes", void 0);
1749
- __decorate([
1750
- AsnProp({ type: AsnPropTypes.BitString, optional: true })
1751
- ], AttributeCertificateInfo.prototype, "issuerUniqueID", void 0);
1752
- __decorate([
1753
- AsnProp({ type: Extensions, optional: true })
1754
- ], AttributeCertificateInfo.prototype, "extensions", void 0);
1755
-
1756
- class AttributeCertificate {
1757
- constructor(params = {}) {
1758
- this.acinfo = new AttributeCertificateInfo();
1759
- this.signatureAlgorithm = new AlgorithmIdentifier();
1760
- this.signatureValue = new ArrayBuffer(0);
1761
- Object.assign(this, params);
1762
- }
1763
- }
1764
- __decorate([
1765
- AsnProp({ type: AttributeCertificateInfo })
1766
- ], AttributeCertificate.prototype, "acinfo", void 0);
1767
- __decorate([
1768
- AsnProp({ type: AlgorithmIdentifier })
1769
- ], AttributeCertificate.prototype, "signatureAlgorithm", void 0);
1770
- __decorate([
1771
- AsnProp({ type: AsnPropTypes.BitString })
1772
- ], AttributeCertificate.prototype, "signatureValue", void 0);
1773
-
1774
- var ClassListFlags;
1775
- (function (ClassListFlags) {
1776
- ClassListFlags[ClassListFlags["unmarked"] = 1] = "unmarked";
1777
- ClassListFlags[ClassListFlags["unclassified"] = 2] = "unclassified";
1778
- ClassListFlags[ClassListFlags["restricted"] = 4] = "restricted";
1779
- ClassListFlags[ClassListFlags["confidential"] = 8] = "confidential";
1780
- ClassListFlags[ClassListFlags["secret"] = 16] = "secret";
1781
- ClassListFlags[ClassListFlags["topSecret"] = 32] = "topSecret";
1782
- })(ClassListFlags || (ClassListFlags = {}));
1783
- class ClassList extends BitString {
1784
- }
1785
-
1786
- class SecurityCategory {
1787
- constructor(params = {}) {
1788
- this.type = "";
1789
- this.value = new ArrayBuffer(0);
1790
- Object.assign(this, params);
1791
- }
1792
- }
1793
- __decorate([
1794
- AsnProp({ type: AsnPropTypes.ObjectIdentifier, implicit: true, context: 0 })
1795
- ], SecurityCategory.prototype, "type", void 0);
1796
- __decorate([
1797
- AsnProp({ type: AsnPropTypes.Any, implicit: true, context: 1 })
1798
- ], SecurityCategory.prototype, "value", void 0);
1799
-
1800
- class Clearance {
1801
- constructor(params = {}) {
1802
- this.policyId = "";
1803
- this.classList = new ClassList(ClassListFlags.unclassified);
1804
- Object.assign(this, params);
1805
- }
1806
- }
1807
- __decorate([
1808
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
1809
- ], Clearance.prototype, "policyId", void 0);
1810
- __decorate([
1811
- AsnProp({ type: ClassList, defaultValue: new ClassList(ClassListFlags.unclassified) })
1812
- ], Clearance.prototype, "classList", void 0);
1813
- __decorate([
1814
- AsnProp({ type: SecurityCategory, repeated: "set" })
1815
- ], Clearance.prototype, "securityCategories", void 0);
1816
-
1817
- class IetfAttrSyntaxValueChoices {
1818
- constructor(params = {}) {
1819
- Object.assign(this, params);
1820
- }
1821
- }
1822
- __decorate([
1823
- AsnProp({ type: OctetString })
1824
- ], IetfAttrSyntaxValueChoices.prototype, "cotets", void 0);
1825
- __decorate([
1826
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
1827
- ], IetfAttrSyntaxValueChoices.prototype, "oid", void 0);
1828
- __decorate([
1829
- AsnProp({ type: AsnPropTypes.Utf8String })
1830
- ], IetfAttrSyntaxValueChoices.prototype, "string", void 0);
1831
- class IetfAttrSyntax {
1832
- constructor(params = {}) {
1833
- this.values = [];
1834
- Object.assign(this, params);
1835
- }
1836
- }
1837
- __decorate([
1838
- AsnProp({ type: GeneralNames, implicit: true, context: 0, optional: true })
1839
- ], IetfAttrSyntax.prototype, "policyAuthority", void 0);
1840
- __decorate([
1841
- AsnProp({ type: IetfAttrSyntaxValueChoices, repeated: "sequence" })
1842
- ], IetfAttrSyntax.prototype, "values", void 0);
1843
-
1844
- var Targets_1;
1845
- class TargetCert {
1846
- constructor(params = {}) {
1847
- this.targetCertificate = new IssuerSerial();
1848
- Object.assign(this, params);
1849
- }
1850
- }
1851
- __decorate([
1852
- AsnProp({ type: IssuerSerial })
1853
- ], TargetCert.prototype, "targetCertificate", void 0);
1854
- __decorate([
1855
- AsnProp({ type: GeneralName, optional: true })
1856
- ], TargetCert.prototype, "targetName", void 0);
1857
- __decorate([
1858
- AsnProp({ type: ObjectDigestInfo, optional: true })
1859
- ], TargetCert.prototype, "certDigestInfo", void 0);
1860
- let Target = class Target {
1861
- constructor(params = {}) {
1862
- Object.assign(this, params);
1863
- }
1864
- };
1865
- __decorate([
1866
- AsnProp({ type: GeneralName, context: 0, implicit: true })
1867
- ], Target.prototype, "targetName", void 0);
1868
- __decorate([
1869
- AsnProp({ type: GeneralName, context: 1, implicit: true })
1870
- ], Target.prototype, "targetGroup", void 0);
1871
- __decorate([
1872
- AsnProp({ type: TargetCert, context: 2, implicit: true })
1873
- ], Target.prototype, "targetCert", void 0);
1874
- Target = __decorate([
1875
- AsnType({ type: AsnTypeTypes.Choice })
1876
- ], Target);
1877
- let Targets = Targets_1 = class Targets extends AsnArray {
1878
- constructor(items) {
1879
- super(items);
1880
- Object.setPrototypeOf(this, Targets_1.prototype);
1881
- }
1882
- };
1883
- Targets = Targets_1 = __decorate([
1884
- AsnType({ type: AsnTypeTypes.Sequence, itemType: Target })
1885
- ], Targets);
1886
-
1887
- var ProxyInfo_1;
1888
- let ProxyInfo = ProxyInfo_1 = class ProxyInfo extends AsnArray {
1889
- constructor(items) {
1890
- super(items);
1891
- Object.setPrototypeOf(this, ProxyInfo_1.prototype);
1892
- }
1893
- };
1894
- ProxyInfo = ProxyInfo_1 = __decorate([
1895
- AsnType({ type: AsnTypeTypes.Sequence, itemType: Targets })
1896
- ], ProxyInfo);
1897
-
1898
- class RoleSyntax {
1899
- constructor(params = {}) {
1900
- Object.assign(this, params);
1901
- }
1902
- }
1903
- __decorate([
1904
- AsnProp({ type: GeneralNames, implicit: true, context: 0, optional: true })
1905
- ], RoleSyntax.prototype, "roleAuthority", void 0);
1906
- __decorate([
1907
- AsnProp({ type: GeneralName, implicit: true, context: 1 })
1908
- ], RoleSyntax.prototype, "roleName", void 0);
1909
-
1910
- class SvceAuthInfo {
1911
- constructor(params = {}) {
1912
- this.service = new GeneralName();
1913
- this.ident = new GeneralName();
1914
- Object.assign(this, params);
1915
- }
1916
- }
1917
- __decorate([
1918
- AsnProp({ type: GeneralName })
1919
- ], SvceAuthInfo.prototype, "service", void 0);
1920
- __decorate([
1921
- AsnProp({ type: GeneralName })
1922
- ], SvceAuthInfo.prototype, "ident", void 0);
1923
- __decorate([
1924
- AsnProp({ type: OctetString, optional: true })
1925
- ], SvceAuthInfo.prototype, "authInfo", void 0);
1926
-
1927
- var CertificateSet_1;
1928
- class OtherCertificateFormat {
1929
- constructor(params = {}) {
1930
- this.otherCertFormat = "";
1931
- this.otherCert = new ArrayBuffer(0);
1932
- Object.assign(this, params);
1933
- }
1934
- }
1935
- __decorate([
1936
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
1937
- ], OtherCertificateFormat.prototype, "otherCertFormat", void 0);
1938
- __decorate([
1939
- AsnProp({ type: AsnPropTypes.Any })
1940
- ], OtherCertificateFormat.prototype, "otherCert", void 0);
1941
- let CertificateChoices = class CertificateChoices {
1942
- constructor(params = {}) {
1943
- Object.assign(this, params);
1944
- }
1945
- };
1946
- __decorate([
1947
- AsnProp({ type: Certificate })
1948
- ], CertificateChoices.prototype, "certificate", void 0);
1949
- __decorate([
1950
- AsnProp({ type: AttributeCertificate, context: 2, implicit: true })
1951
- ], CertificateChoices.prototype, "v2AttrCert", void 0);
1952
- __decorate([
1953
- AsnProp({ type: OtherCertificateFormat, context: 3, implicit: true })
1954
- ], CertificateChoices.prototype, "other", void 0);
1955
- CertificateChoices = __decorate([
1956
- AsnType({ type: AsnTypeTypes.Choice })
1957
- ], CertificateChoices);
1958
- let CertificateSet = CertificateSet_1 = class CertificateSet extends AsnArray {
1959
- constructor(items) {
1960
- super(items);
1961
- Object.setPrototypeOf(this, CertificateSet_1.prototype);
1962
- }
1963
- };
1964
- CertificateSet = CertificateSet_1 = __decorate([
1965
- AsnType({ type: AsnTypeTypes.Set, itemType: CertificateChoices })
1966
- ], CertificateSet);
1967
-
1968
- class ContentInfo {
1969
- constructor(params = {}) {
1970
- this.contentType = "";
1971
- this.content = new ArrayBuffer(0);
1972
- Object.assign(this, params);
1973
- }
1974
- }
1975
- __decorate([
1976
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
1977
- ], ContentInfo.prototype, "contentType", void 0);
1978
- __decorate([
1979
- AsnProp({ type: AsnPropTypes.Any, context: 0 })
1980
- ], ContentInfo.prototype, "content", void 0);
1981
-
1982
- let EncapsulatedContent = class EncapsulatedContent {
1983
- constructor(params = {}) {
1984
- Object.assign(this, params);
1985
- }
1986
- };
1987
- __decorate([
1988
- AsnProp({ type: OctetString })
1989
- ], EncapsulatedContent.prototype, "single", void 0);
1990
- __decorate([
1991
- AsnProp({ type: AsnPropTypes.Any })
1992
- ], EncapsulatedContent.prototype, "any", void 0);
1993
- EncapsulatedContent = __decorate([
1994
- AsnType({ type: AsnTypeTypes.Choice })
1995
- ], EncapsulatedContent);
1996
- class EncapsulatedContentInfo {
1997
- constructor(params = {}) {
1998
- this.eContentType = "";
1999
- Object.assign(this, params);
2000
- }
2001
- }
2002
- __decorate([
2003
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2004
- ], EncapsulatedContentInfo.prototype, "eContentType", void 0);
2005
- __decorate([
2006
- AsnProp({ type: EncapsulatedContent, context: 0, optional: true })
2007
- ], EncapsulatedContentInfo.prototype, "eContent", void 0);
2008
-
2009
- let EncryptedContent = class EncryptedContent {
2010
- constructor(params = {}) {
2011
- Object.assign(this, params);
2012
- }
2013
- };
2014
- __decorate([
2015
- AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
2016
- ], EncryptedContent.prototype, "value", void 0);
2017
- __decorate([
2018
- AsnProp({
2019
- type: OctetString,
2020
- converter: AsnConstructedOctetStringConverter,
2021
- context: 0,
2022
- implicit: true,
2023
- optional: true,
2024
- repeated: "sequence",
2025
- })
2026
- ], EncryptedContent.prototype, "constructedValue", void 0);
2027
- EncryptedContent = __decorate([
2028
- AsnType({ type: AsnTypeTypes.Choice })
2029
- ], EncryptedContent);
2030
- class EncryptedContentInfo {
2031
- constructor(params = {}) {
2032
- this.contentType = "";
2033
- this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
2034
- Object.assign(this, params);
2035
- }
2036
- }
2037
- __decorate([
2038
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2039
- ], EncryptedContentInfo.prototype, "contentType", void 0);
2040
- __decorate([
2041
- AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
2042
- ], EncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
2043
- __decorate([
2044
- AsnProp({ type: EncryptedContent, optional: true })
2045
- ], EncryptedContentInfo.prototype, "encryptedContent", void 0);
2046
-
2047
- class OtherKeyAttribute {
2048
- constructor(params = {}) {
2049
- this.keyAttrId = "";
2050
- Object.assign(this, params);
2051
- }
2052
- }
2053
- __decorate([
2054
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2055
- ], OtherKeyAttribute.prototype, "keyAttrId", void 0);
2056
- __decorate([
2057
- AsnProp({ type: AsnPropTypes.Any, optional: true })
2058
- ], OtherKeyAttribute.prototype, "keyAttr", void 0);
2059
-
2060
- var RecipientEncryptedKeys_1;
2061
- class RecipientKeyIdentifier {
2062
- constructor(params = {}) {
2063
- this.subjectKeyIdentifier = new SubjectKeyIdentifier();
2064
- Object.assign(this, params);
2065
- }
2066
- }
2067
- __decorate([
2068
- AsnProp({ type: SubjectKeyIdentifier })
2069
- ], RecipientKeyIdentifier.prototype, "subjectKeyIdentifier", void 0);
2070
- __decorate([
2071
- AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
2072
- ], RecipientKeyIdentifier.prototype, "date", void 0);
2073
- __decorate([
2074
- AsnProp({ type: OtherKeyAttribute, optional: true })
2075
- ], RecipientKeyIdentifier.prototype, "other", void 0);
2076
- let KeyAgreeRecipientIdentifier = class KeyAgreeRecipientIdentifier {
2077
- constructor(params = {}) {
2078
- Object.assign(this, params);
2079
- }
2080
- };
2081
- __decorate([
2082
- AsnProp({ type: RecipientKeyIdentifier, context: 0, implicit: true, optional: true })
2083
- ], KeyAgreeRecipientIdentifier.prototype, "rKeyId", void 0);
2084
- __decorate([
2085
- AsnProp({ type: IssuerAndSerialNumber, optional: true })
2086
- ], KeyAgreeRecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
2087
- KeyAgreeRecipientIdentifier = __decorate([
2088
- AsnType({ type: AsnTypeTypes.Choice })
2089
- ], KeyAgreeRecipientIdentifier);
2090
- class RecipientEncryptedKey {
2091
- constructor(params = {}) {
2092
- this.rid = new KeyAgreeRecipientIdentifier();
2093
- this.encryptedKey = new OctetString();
2094
- Object.assign(this, params);
2095
- }
2096
- }
2097
- __decorate([
2098
- AsnProp({ type: KeyAgreeRecipientIdentifier })
2099
- ], RecipientEncryptedKey.prototype, "rid", void 0);
2100
- __decorate([
2101
- AsnProp({ type: OctetString })
2102
- ], RecipientEncryptedKey.prototype, "encryptedKey", void 0);
2103
- let RecipientEncryptedKeys = RecipientEncryptedKeys_1 = class RecipientEncryptedKeys extends AsnArray {
2104
- constructor(items) {
2105
- super(items);
2106
- Object.setPrototypeOf(this, RecipientEncryptedKeys_1.prototype);
2107
- }
2108
- };
2109
- RecipientEncryptedKeys = RecipientEncryptedKeys_1 = __decorate([
2110
- AsnType({ type: AsnTypeTypes.Sequence, itemType: RecipientEncryptedKey })
2111
- ], RecipientEncryptedKeys);
2112
- class OriginatorPublicKey {
2113
- constructor(params = {}) {
2114
- this.algorithm = new AlgorithmIdentifier();
2115
- this.publicKey = new ArrayBuffer(0);
2116
- Object.assign(this, params);
2117
- }
2118
- }
2119
- __decorate([
2120
- AsnProp({ type: AlgorithmIdentifier })
2121
- ], OriginatorPublicKey.prototype, "algorithm", void 0);
2122
- __decorate([
2123
- AsnProp({ type: AsnPropTypes.BitString })
2124
- ], OriginatorPublicKey.prototype, "publicKey", void 0);
2125
- let OriginatorIdentifierOrKey = class OriginatorIdentifierOrKey {
2126
- constructor(params = {}) {
2127
- Object.assign(this, params);
2128
- }
2129
- };
2130
- __decorate([
2131
- AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true, optional: true })
2132
- ], OriginatorIdentifierOrKey.prototype, "subjectKeyIdentifier", void 0);
2133
- __decorate([
2134
- AsnProp({ type: OriginatorPublicKey, context: 1, implicit: true, optional: true })
2135
- ], OriginatorIdentifierOrKey.prototype, "originatorKey", void 0);
2136
- __decorate([
2137
- AsnProp({ type: IssuerAndSerialNumber, optional: true })
2138
- ], OriginatorIdentifierOrKey.prototype, "issuerAndSerialNumber", void 0);
2139
- OriginatorIdentifierOrKey = __decorate([
2140
- AsnType({ type: AsnTypeTypes.Choice })
2141
- ], OriginatorIdentifierOrKey);
2142
- class KeyAgreeRecipientInfo {
2143
- constructor(params = {}) {
2144
- this.version = CMSVersion.v3;
2145
- this.originator = new OriginatorIdentifierOrKey();
2146
- this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
2147
- this.recipientEncryptedKeys = new RecipientEncryptedKeys();
2148
- Object.assign(this, params);
2149
- }
2150
- }
2151
- __decorate([
2152
- AsnProp({ type: AsnPropTypes.Integer })
2153
- ], KeyAgreeRecipientInfo.prototype, "version", void 0);
2154
- __decorate([
2155
- AsnProp({ type: OriginatorIdentifierOrKey, context: 0 })
2156
- ], KeyAgreeRecipientInfo.prototype, "originator", void 0);
2157
- __decorate([
2158
- AsnProp({ type: OctetString, context: 1, optional: true })
2159
- ], KeyAgreeRecipientInfo.prototype, "ukm", void 0);
2160
- __decorate([
2161
- AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
2162
- ], KeyAgreeRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
2163
- __decorate([
2164
- AsnProp({ type: RecipientEncryptedKeys })
2165
- ], KeyAgreeRecipientInfo.prototype, "recipientEncryptedKeys", void 0);
2166
-
2167
- let RecipientIdentifier = class RecipientIdentifier {
2168
- constructor(params = {}) {
2169
- Object.assign(this, params);
2170
- }
2171
- };
2172
- __decorate([
2173
- AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
2174
- ], RecipientIdentifier.prototype, "subjectKeyIdentifier", void 0);
2175
- __decorate([
2176
- AsnProp({ type: IssuerAndSerialNumber })
2177
- ], RecipientIdentifier.prototype, "issuerAndSerialNumber", void 0);
2178
- RecipientIdentifier = __decorate([
2179
- AsnType({ type: AsnTypeTypes.Choice })
2180
- ], RecipientIdentifier);
2181
- class KeyTransRecipientInfo {
2182
- constructor(params = {}) {
2183
- this.version = CMSVersion.v0;
2184
- this.rid = new RecipientIdentifier();
2185
- this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
2186
- this.encryptedKey = new OctetString();
2187
- Object.assign(this, params);
2188
- }
2189
- }
2190
- __decorate([
2191
- AsnProp({ type: AsnPropTypes.Integer })
2192
- ], KeyTransRecipientInfo.prototype, "version", void 0);
2193
- __decorate([
2194
- AsnProp({ type: RecipientIdentifier })
2195
- ], KeyTransRecipientInfo.prototype, "rid", void 0);
2196
- __decorate([
2197
- AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
2198
- ], KeyTransRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
2199
- __decorate([
2200
- AsnProp({ type: OctetString })
2201
- ], KeyTransRecipientInfo.prototype, "encryptedKey", void 0);
2202
-
2203
- class KEKIdentifier {
2204
- constructor(params = {}) {
2205
- this.keyIdentifier = new OctetString();
2206
- Object.assign(this, params);
2207
- }
2208
- }
2209
- __decorate([
2210
- AsnProp({ type: OctetString })
2211
- ], KEKIdentifier.prototype, "keyIdentifier", void 0);
2212
- __decorate([
2213
- AsnProp({ type: AsnPropTypes.GeneralizedTime, optional: true })
2214
- ], KEKIdentifier.prototype, "date", void 0);
2215
- __decorate([
2216
- AsnProp({ type: OtherKeyAttribute, optional: true })
2217
- ], KEKIdentifier.prototype, "other", void 0);
2218
- class KEKRecipientInfo {
2219
- constructor(params = {}) {
2220
- this.version = CMSVersion.v4;
2221
- this.kekid = new KEKIdentifier();
2222
- this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
2223
- this.encryptedKey = new OctetString();
2224
- Object.assign(this, params);
2225
- }
2226
- }
2227
- __decorate([
2228
- AsnProp({ type: AsnPropTypes.Integer })
2229
- ], KEKRecipientInfo.prototype, "version", void 0);
2230
- __decorate([
2231
- AsnProp({ type: KEKIdentifier })
2232
- ], KEKRecipientInfo.prototype, "kekid", void 0);
2233
- __decorate([
2234
- AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
2235
- ], KEKRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
2236
- __decorate([
2237
- AsnProp({ type: OctetString })
2238
- ], KEKRecipientInfo.prototype, "encryptedKey", void 0);
2239
-
2240
- class PasswordRecipientInfo {
2241
- constructor(params = {}) {
2242
- this.version = CMSVersion.v0;
2243
- this.keyEncryptionAlgorithm = new KeyEncryptionAlgorithmIdentifier();
2244
- this.encryptedKey = new OctetString();
2245
- Object.assign(this, params);
2246
- }
2247
- }
2248
- __decorate([
2249
- AsnProp({ type: AsnPropTypes.Integer })
2250
- ], PasswordRecipientInfo.prototype, "version", void 0);
2251
- __decorate([
2252
- AsnProp({ type: KeyDerivationAlgorithmIdentifier, context: 0, optional: true })
2253
- ], PasswordRecipientInfo.prototype, "keyDerivationAlgorithm", void 0);
2254
- __decorate([
2255
- AsnProp({ type: KeyEncryptionAlgorithmIdentifier })
2256
- ], PasswordRecipientInfo.prototype, "keyEncryptionAlgorithm", void 0);
2257
- __decorate([
2258
- AsnProp({ type: OctetString })
2259
- ], PasswordRecipientInfo.prototype, "encryptedKey", void 0);
2260
-
2261
- class OtherRecipientInfo {
2262
- constructor(params = {}) {
2263
- this.oriType = "";
2264
- this.oriValue = new ArrayBuffer(0);
2265
- Object.assign(this, params);
2266
- }
2267
- }
2268
- __decorate([
2269
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2270
- ], OtherRecipientInfo.prototype, "oriType", void 0);
2271
- __decorate([
2272
- AsnProp({ type: AsnPropTypes.Any })
2273
- ], OtherRecipientInfo.prototype, "oriValue", void 0);
2274
- let RecipientInfo = class RecipientInfo {
2275
- constructor(params = {}) {
2276
- Object.assign(this, params);
2277
- }
2278
- };
2279
- __decorate([
2280
- AsnProp({ type: KeyTransRecipientInfo, optional: true })
2281
- ], RecipientInfo.prototype, "ktri", void 0);
2282
- __decorate([
2283
- AsnProp({ type: KeyAgreeRecipientInfo, context: 1, implicit: true, optional: true })
2284
- ], RecipientInfo.prototype, "kari", void 0);
2285
- __decorate([
2286
- AsnProp({ type: KEKRecipientInfo, context: 2, implicit: true, optional: true })
2287
- ], RecipientInfo.prototype, "kekri", void 0);
2288
- __decorate([
2289
- AsnProp({ type: PasswordRecipientInfo, context: 3, implicit: true, optional: true })
2290
- ], RecipientInfo.prototype, "pwri", void 0);
2291
- __decorate([
2292
- AsnProp({ type: OtherRecipientInfo, context: 4, implicit: true, optional: true })
2293
- ], RecipientInfo.prototype, "ori", void 0);
2294
- RecipientInfo = __decorate([
2295
- AsnType({ type: AsnTypeTypes.Choice })
2296
- ], RecipientInfo);
2297
-
2298
- var RecipientInfos_1;
2299
- let RecipientInfos = RecipientInfos_1 = class RecipientInfos extends AsnArray {
2300
- constructor(items) {
2301
- super(items);
2302
- Object.setPrototypeOf(this, RecipientInfos_1.prototype);
2303
- }
2304
- };
2305
- RecipientInfos = RecipientInfos_1 = __decorate([
2306
- AsnType({ type: AsnTypeTypes.Set, itemType: RecipientInfo })
2307
- ], RecipientInfos);
2308
-
2309
- var RevocationInfoChoices_1;
2310
- class OtherRevocationInfoFormat {
2311
- constructor(params = {}) {
2312
- this.otherRevInfoFormat = "";
2313
- this.otherRevInfo = new ArrayBuffer(0);
2314
- Object.assign(this, params);
2315
- }
2316
- }
2317
- __decorate([
2318
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2319
- ], OtherRevocationInfoFormat.prototype, "otherRevInfoFormat", void 0);
2320
- __decorate([
2321
- AsnProp({ type: AsnPropTypes.Any })
2322
- ], OtherRevocationInfoFormat.prototype, "otherRevInfo", void 0);
2323
- let RevocationInfoChoice = class RevocationInfoChoice {
2324
- constructor(params = {}) {
2325
- this.other = new OtherRevocationInfoFormat();
2326
- Object.assign(this, params);
2327
- }
2328
- };
2329
- __decorate([
2330
- AsnProp({ type: OtherRevocationInfoFormat, context: 1, implicit: true })
2331
- ], RevocationInfoChoice.prototype, "other", void 0);
2332
- RevocationInfoChoice = __decorate([
2333
- AsnType({ type: AsnTypeTypes.Choice })
2334
- ], RevocationInfoChoice);
2335
- let RevocationInfoChoices = RevocationInfoChoices_1 = class RevocationInfoChoices extends AsnArray {
2336
- constructor(items) {
2337
- super(items);
2338
- Object.setPrototypeOf(this, RevocationInfoChoices_1.prototype);
2339
- }
2340
- };
2341
- RevocationInfoChoices = RevocationInfoChoices_1 = __decorate([
2342
- AsnType({ type: AsnTypeTypes.Set, itemType: RevocationInfoChoice })
2343
- ], RevocationInfoChoices);
2344
-
2345
- class OriginatorInfo {
2346
- constructor(params = {}) {
2347
- Object.assign(this, params);
2348
- }
2349
- }
2350
- __decorate([
2351
- AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
2352
- ], OriginatorInfo.prototype, "certs", void 0);
2353
- __decorate([
2354
- AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
2355
- ], OriginatorInfo.prototype, "crls", void 0);
2356
-
2357
- var UnprotectedAttributes_1;
2358
- let UnprotectedAttributes = UnprotectedAttributes_1 = class UnprotectedAttributes extends AsnArray {
2359
- constructor(items) {
2360
- super(items);
2361
- Object.setPrototypeOf(this, UnprotectedAttributes_1.prototype);
2362
- }
2363
- };
2364
- UnprotectedAttributes = UnprotectedAttributes_1 = __decorate([
2365
- AsnType({ type: AsnTypeTypes.Set, itemType: Attribute })
2366
- ], UnprotectedAttributes);
2367
- class EnvelopedData {
2368
- constructor(params = {}) {
2369
- this.version = CMSVersion.v0;
2370
- this.recipientInfos = new RecipientInfos();
2371
- this.encryptedContentInfo = new EncryptedContentInfo();
2372
- Object.assign(this, params);
2373
- }
2374
- }
2375
- __decorate([
2376
- AsnProp({ type: AsnPropTypes.Integer })
2377
- ], EnvelopedData.prototype, "version", void 0);
2378
- __decorate([
2379
- AsnProp({ type: OriginatorInfo, context: 0, implicit: true, optional: true })
2380
- ], EnvelopedData.prototype, "originatorInfo", void 0);
2381
- __decorate([
2382
- AsnProp({ type: RecipientInfos })
2383
- ], EnvelopedData.prototype, "recipientInfos", void 0);
2384
- __decorate([
2385
- AsnProp({ type: EncryptedContentInfo })
2386
- ], EnvelopedData.prototype, "encryptedContentInfo", void 0);
2387
- __decorate([
2388
- AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
2389
- ], EnvelopedData.prototype, "unprotectedAttrs", void 0);
2390
-
2391
- var DigestAlgorithmIdentifiers_1;
2392
- let DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends AsnArray {
2393
- constructor(items) {
2394
- super(items);
2395
- Object.setPrototypeOf(this, DigestAlgorithmIdentifiers_1.prototype);
2396
- }
2397
- };
2398
- DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = __decorate([
2399
- AsnType({ type: AsnTypeTypes.Set, itemType: DigestAlgorithmIdentifier })
2400
- ], DigestAlgorithmIdentifiers);
2401
- class SignedData {
2402
- constructor(params = {}) {
2403
- this.version = CMSVersion.v0;
2404
- this.digestAlgorithms = new DigestAlgorithmIdentifiers();
2405
- this.encapContentInfo = new EncapsulatedContentInfo();
2406
- this.signerInfos = new SignerInfos();
2407
- Object.assign(this, params);
2408
- }
2409
- }
2410
- __decorate([
2411
- AsnProp({ type: AsnPropTypes.Integer })
2412
- ], SignedData.prototype, "version", void 0);
2413
- __decorate([
2414
- AsnProp({ type: DigestAlgorithmIdentifiers })
2415
- ], SignedData.prototype, "digestAlgorithms", void 0);
2416
- __decorate([
2417
- AsnProp({ type: EncapsulatedContentInfo })
2418
- ], SignedData.prototype, "encapContentInfo", void 0);
2419
- __decorate([
2420
- AsnProp({ type: CertificateSet, context: 0, implicit: true, optional: true })
2421
- ], SignedData.prototype, "certificates", void 0);
2422
- __decorate([
2423
- AsnProp({ type: RevocationInfoChoices, context: 1, implicit: true, optional: true })
2424
- ], SignedData.prototype, "crls", void 0);
2425
- __decorate([
2426
- AsnProp({ type: SignerInfos })
2427
- ], SignedData.prototype, "signerInfos", void 0);
2428
-
2429
- class Accuracy {
2430
- constructor(params = {}) {
2431
- this.seconds = 0;
2432
- Object.assign(this, params);
2433
- }
2434
- }
2435
- __decorate([
2436
- AsnProp({ type: AsnPropTypes.Integer, optional: true })
2437
- ], Accuracy.prototype, "seconds", void 0);
2438
- __decorate([
2439
- AsnProp({ type: AsnPropTypes.Integer, context: 0, implicit: true, optional: true })
2440
- ], Accuracy.prototype, "millis", void 0);
2441
- __decorate([
2442
- AsnProp({ type: AsnPropTypes.Integer, context: 1, implicit: true, optional: true })
2443
- ], Accuracy.prototype, "micros", void 0);
2444
-
2445
- class MessageImprint {
2446
- constructor(params = {}) {
2447
- this.hashAlgorithm = new AlgorithmIdentifier();
2448
- this.hashedMessage = new OctetString();
2449
- Object.assign(this, params);
2450
- }
2451
- }
2452
- __decorate([
2453
- AsnProp({ type: AlgorithmIdentifier })
2454
- ], MessageImprint.prototype, "hashAlgorithm", void 0);
2455
- __decorate([
2456
- AsnProp({ type: OctetString })
2457
- ], MessageImprint.prototype, "hashedMessage", void 0);
2458
-
2459
- var PKIFailureInfoFlags;
2460
- (function (PKIFailureInfoFlags) {
2461
- PKIFailureInfoFlags[PKIFailureInfoFlags["badAlg"] = 1] = "badAlg";
2462
- PKIFailureInfoFlags[PKIFailureInfoFlags["badRequest"] = 2] = "badRequest";
2463
- PKIFailureInfoFlags[PKIFailureInfoFlags["badDataFormat"] = 16] = "badDataFormat";
2464
- PKIFailureInfoFlags[PKIFailureInfoFlags["timeNotAvailable"] = 8192] = "timeNotAvailable";
2465
- PKIFailureInfoFlags[PKIFailureInfoFlags["unacceptedPolicy"] = 16384] = "unacceptedPolicy";
2466
- PKIFailureInfoFlags[PKIFailureInfoFlags["unacceptedExtension"] = 32768] = "unacceptedExtension";
2467
- PKIFailureInfoFlags[PKIFailureInfoFlags["addInfoNotAvailable"] = 65536] = "addInfoNotAvailable";
2468
- PKIFailureInfoFlags[PKIFailureInfoFlags["systemFailure"] = 16777216] = "systemFailure";
2469
- })(PKIFailureInfoFlags || (PKIFailureInfoFlags = {}));
2470
- class PKIFailureInfo extends BitString {
2471
- toJSON() {
2472
- const flag = this.toNumber();
2473
- const res = [];
2474
- if (flag & PKIFailureInfoFlags.addInfoNotAvailable) {
2475
- res.push("addInfoNotAvailable");
2476
- }
2477
- if (flag & PKIFailureInfoFlags.badAlg) {
2478
- res.push("badAlg");
2479
- }
2480
- if (flag & PKIFailureInfoFlags.badDataFormat) {
2481
- res.push("badDataFormat");
2482
- }
2483
- if (flag & PKIFailureInfoFlags.badRequest) {
2484
- res.push("badRequest");
2485
- }
2486
- if (flag & PKIFailureInfoFlags.systemFailure) {
2487
- res.push("systemFailure");
2488
- }
2489
- if (flag & PKIFailureInfoFlags.systemFailure) {
2490
- res.push("systemFailure");
2491
- }
2492
- if (flag & PKIFailureInfoFlags.timeNotAvailable) {
2493
- res.push("timeNotAvailable");
2494
- }
2495
- if (flag & PKIFailureInfoFlags.unacceptedExtension) {
2496
- res.push("unacceptedExtension");
2497
- }
2498
- if (flag & PKIFailureInfoFlags.unacceptedPolicy) {
2499
- res.push("unacceptedPolicy");
2500
- }
2501
- return res;
2502
- }
2503
- toString() {
2504
- return `[${this.toJSON().join(", ")}]`;
2505
- }
2506
- }
2507
-
2508
- var PKIStatus;
2509
- (function (PKIStatus) {
2510
- PKIStatus[PKIStatus["granted"] = 0] = "granted";
2511
- PKIStatus[PKIStatus["grantedWithMods"] = 1] = "grantedWithMods";
2512
- PKIStatus[PKIStatus["rejection"] = 2] = "rejection";
2513
- PKIStatus[PKIStatus["waiting"] = 3] = "waiting";
2514
- PKIStatus[PKIStatus["revocationWarning"] = 4] = "revocationWarning";
2515
- PKIStatus[PKIStatus["revocationNotification"] = 5] = "revocationNotification";
2516
- })(PKIStatus || (PKIStatus = {}));
2517
-
2518
- var PKIFreeText_1;
2519
- let PKIFreeText = PKIFreeText_1 = class PKIFreeText extends AsnArray {
2520
- constructor(items) {
2521
- super(items);
2522
- Object.setPrototypeOf(this, PKIFreeText_1.prototype);
2523
- }
2524
- };
2525
- PKIFreeText = PKIFreeText_1 = __decorate([
2526
- AsnType({ type: AsnTypeTypes.Sequence, itemType: AsnPropTypes.Utf8String })
2527
- ], PKIFreeText);
2528
- class PKIStatusInfo {
2529
- constructor(params = {}) {
2530
- this.status = PKIStatus.granted;
2531
- Object.assign(this, params);
2532
- }
2533
- }
2534
- __decorate([
2535
- AsnProp({ type: AsnPropTypes.Integer })
2536
- ], PKIStatusInfo.prototype, "status", void 0);
2537
- __decorate([
2538
- AsnProp({ type: PKIFreeText, optional: true })
2539
- ], PKIStatusInfo.prototype, "statusString", void 0);
2540
- __decorate([
2541
- AsnProp({ type: PKIFailureInfo, optional: true })
2542
- ], PKIStatusInfo.prototype, "failInfo", void 0);
2543
-
2544
- var TimeStampReqVersion;
2545
- (function (TimeStampReqVersion) {
2546
- TimeStampReqVersion[TimeStampReqVersion["v1"] = 1] = "v1";
2547
- })(TimeStampReqVersion || (TimeStampReqVersion = {}));
2548
- class TimeStampReq {
2549
- constructor(params = {}) {
2550
- this.version = TimeStampReqVersion.v1;
2551
- this.messageImprint = new MessageImprint();
2552
- this.certReq = false;
2553
- Object.assign(this, params);
2554
- }
2555
- }
2556
- __decorate([
2557
- AsnProp({ type: AsnPropTypes.Integer })
2558
- ], TimeStampReq.prototype, "version", void 0);
2559
- __decorate([
2560
- AsnProp({ type: MessageImprint })
2561
- ], TimeStampReq.prototype, "messageImprint", void 0);
2562
- __decorate([
2563
- AsnProp({ type: AsnPropTypes.ObjectIdentifier, optional: true })
2564
- ], TimeStampReq.prototype, "reqPolicy", void 0);
2565
- __decorate([
2566
- AsnProp({
2567
- type: AsnPropTypes.Integer,
2568
- converter: AsnIntegerArrayBufferConverter,
2569
- optional: true,
2570
- })
2571
- ], TimeStampReq.prototype, "nonce", void 0);
2572
- __decorate([
2573
- AsnProp({ type: AsnPropTypes.Boolean, defaultValue: false })
2574
- ], TimeStampReq.prototype, "certReq", void 0);
2575
- __decorate([
2576
- AsnProp({ type: Extensions, optional: true, context: 0, implicit: true })
2577
- ], TimeStampReq.prototype, "extensions", void 0);
2578
-
2579
- let TimeStampToken = class TimeStampToken extends ContentInfo {
2580
- };
2581
- TimeStampToken = __decorate([
2582
- AsnType({ type: AsnTypeTypes.Sequence })
2583
- ], TimeStampToken);
2584
-
2585
- class TimeStampResp {
2586
- constructor(params = {}) {
2587
- this.status = new PKIStatusInfo();
2588
- Object.assign(this, params);
2589
- }
2590
- }
2591
- __decorate([
2592
- AsnProp({ type: PKIStatusInfo })
2593
- ], TimeStampResp.prototype, "status", void 0);
2594
- __decorate([
2595
- AsnProp({ type: TimeStampToken, optional: true })
2596
- ], TimeStampResp.prototype, "timeStampToken", void 0);
2597
-
2598
- var TSTInfoVersion;
2599
- (function (TSTInfoVersion) {
2600
- TSTInfoVersion[TSTInfoVersion["v1"] = 1] = "v1";
2601
- })(TSTInfoVersion || (TSTInfoVersion = {}));
2602
- class TSTInfo {
2603
- constructor(params = {}) {
2604
- this.version = TSTInfoVersion.v1;
2605
- this.policy = "";
2606
- this.messageImprint = new MessageImprint();
2607
- this.serialNumber = new ArrayBuffer(0);
2608
- this.genTime = new Date();
2609
- this.ordering = false;
2610
- Object.assign(this, params);
2611
- }
2612
- }
2613
- __decorate([
2614
- AsnProp({ type: AsnPropTypes.Integer })
2615
- ], TSTInfo.prototype, "version", void 0);
2616
- __decorate([
2617
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
2618
- ], TSTInfo.prototype, "policy", void 0);
2619
- __decorate([
2620
- AsnProp({ type: MessageImprint })
2621
- ], TSTInfo.prototype, "messageImprint", void 0);
2622
- __decorate([
2623
- AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
2624
- ], TSTInfo.prototype, "serialNumber", void 0);
2625
- __decorate([
2626
- AsnProp({ type: AsnPropTypes.GeneralizedTime })
2627
- ], TSTInfo.prototype, "genTime", void 0);
2628
- __decorate([
2629
- AsnProp({ type: Accuracy, optional: true })
2630
- ], TSTInfo.prototype, "accuracy", void 0);
2631
- __decorate([
2632
- AsnProp({ type: AsnPropTypes.Boolean, defaultValue: false })
2633
- ], TSTInfo.prototype, "ordering", void 0);
2634
- __decorate([
2635
- AsnProp({
2636
- type: AsnPropTypes.Integer,
2637
- converter: AsnIntegerArrayBufferConverter,
2638
- optional: true,
2639
- })
2640
- ], TSTInfo.prototype, "nonce", void 0);
2641
- __decorate([
2642
- AsnProp({ type: GeneralName, context: 0, optional: true })
2643
- ], TSTInfo.prototype, "tsa", void 0);
2644
- __decorate([
2645
- AsnProp({ type: Extensions, context: 1, implicit: true, optional: true })
2646
- ], TSTInfo.prototype, "extensions", void 0);
2647
-
2648
1420
  // src/core/timestamp/verify.ts
2649
1421
  /**
2650
1422
  * OID for SignedData content type
@@ -4144,7 +2916,7 @@ async function verifySignature(signatureInfo, files, options = {}) {
4144
2916
  const timestampValid = !signatureInfo.signatureTimestamp ||
4145
2917
  options.verifyTimestamps === false ||
4146
2918
  (timestampResult?.isValid ?? true);
4147
- const isValid = certResult.isValid && checksumResult.isValid && signatureResult.isValid && timestampValid;
2919
+ let isValid = certResult.isValid && checksumResult.isValid && signatureResult.isValid && timestampValid;
4148
2920
  // Determine validation status and limitations
4149
2921
  let status = "VALID";
4150
2922
  let statusMessage;
@@ -4214,6 +2986,30 @@ async function verifySignature(signatureInfo, files, options = {}) {
4214
2986
  statusMessage = errors[0] || "Verification failed";
4215
2987
  }
4216
2988
  }
2989
+ // If everything else is valid but the issuer is not on the trusted list,
2990
+ // downgrade from VALID to INDETERMINATE — crypto is sound but trust is unconfirmed
2991
+ if (status === "VALID" && options.trustListProvider) {
2992
+ if (trustListMatch && (!trustListMatch.found || trustListMatch.trustedAtTime === false)) {
2993
+ status = "INDETERMINATE";
2994
+ isValid = false;
2995
+ statusMessage = trustListMatch.found
2996
+ ? "Signer issuer found in trusted list but was not trusted at signing time"
2997
+ : "Signer issuer not found in trusted list";
2998
+ limitations.push({
2999
+ code: "ISSUER_NOT_TRUSTED",
3000
+ description: statusMessage,
3001
+ });
3002
+ }
3003
+ else if (!trustListMatch && trustListError) {
3004
+ status = "INDETERMINATE";
3005
+ isValid = false;
3006
+ statusMessage = "Trusted list check failed";
3007
+ limitations.push({
3008
+ code: "TRUST_LIST_CHECK_FAILED",
3009
+ description: trustListError,
3010
+ });
3011
+ }
3012
+ }
4217
3013
  const checklist = options.includeChecklist
4218
3014
  ? buildVerificationChecklist({
4219
3015
  options,