@peculiar/certificates-viewer 3.3.0 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/cjs/{certification_request-e1997ebf.js → certification_request-b5fe8a57.js} +129 -151
  2. package/dist/cjs/{crl-f1ee43bc.js → crl-a1ac7534.js} +11 -2
  3. package/dist/cjs/l10n-17c96aba.js +169 -0
  4. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +23 -8
  5. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +4 -4
  6. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +1 -1
  7. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
  8. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
  9. package/dist/cjs/{public_key-ba538d77.js → public_key-3d4ae164.js} +2 -2
  10. package/dist/cjs/{x509_certificate-42b478d2.js → x509_certificate-29a3636a.js} +2 -2
  11. package/dist/collection/components/crl-viewer/crl-viewer.js +1 -1
  12. package/dist/collection/components/crl-viewer/revoked_certificates.js +20 -3
  13. package/dist/collection/crypto/crl.js +9 -0
  14. package/dist/collection/crypto/utils.js +5 -4
  15. package/dist/collection/locales/en.json +3 -2
  16. package/dist/esm/{certification_request-5d982d92.js → certification_request-35ade000.js} +125 -147
  17. package/dist/esm/{crl-f2110716.js → crl-42d5e233.js} +11 -2
  18. package/dist/esm/l10n-a68d5748.js +165 -0
  19. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +23 -8
  20. package/dist/esm/peculiar-certificate-decoder.entry.js +4 -4
  21. package/dist/esm/peculiar-certificate-summary_3.entry.js +1 -1
  22. package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
  23. package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
  24. package/dist/esm/{public_key-0a3091a5.js → public_key-b2dba162.js} +2 -2
  25. package/dist/esm/{x509_certificate-6b243207.js → x509_certificate-2503dcc1.js} +2 -2
  26. package/dist/peculiar/locales/en.json +3 -2
  27. package/dist/peculiar/p-1a8379f0.entry.js +26 -0
  28. package/dist/peculiar/{p-e535a666.entry.js → p-3d0fdbd5.entry.js} +1 -1
  29. package/dist/peculiar/{p-f8dc3232.js → p-54171e39.js} +3 -3
  30. package/dist/peculiar/{p-3aea9dde.js → p-6cd6e6da.js} +5 -5
  31. package/dist/peculiar/{p-86116b1f.entry.js → p-7a0fb5a8.entry.js} +1 -1
  32. package/dist/peculiar/{p-49ab6f8c.entry.js → p-870c3592.entry.js} +1 -1
  33. package/dist/peculiar/{p-bce2bbe0.js → p-a5d07697.js} +7 -7
  34. package/dist/peculiar/{p-db6e24c6.js → p-b7045733.js} +1 -1
  35. package/dist/peculiar/{p-34e2d6be.entry.js → p-cb9b9f9c.entry.js} +1 -1
  36. package/dist/peculiar/p-fec9d812.js +12 -0
  37. package/dist/peculiar/peculiar.esm.js +1 -1
  38. package/dist/types/components/crl-viewer/revoked_certificates.d.ts +2 -2
  39. package/dist/types/crypto/crl.d.ts +7 -1
  40. package/dist/types/utils/l10n.d.ts +2 -1
  41. package/package.json +19 -19
  42. package/dist/cjs/l10n-638a7577.js +0 -167
  43. package/dist/esm/l10n-da0dd100.js +0 -163
  44. package/dist/peculiar/p-35e7a514.js +0 -12
  45. package/dist/peculiar/p-ca0c34ca.entry.js +0 -26
@@ -6,11 +6,11 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-064e95c7.js');
9
- const x509_certificate = require('./x509_certificate-42b478d2.js');
10
- require('./certification_request-e1997ebf.js');
9
+ const x509_certificate = require('./x509_certificate-29a3636a.js');
10
+ require('./certification_request-b5fe8a57.js');
11
11
  require('./download-a97f4cb2.js');
12
- require('./l10n-638a7577.js');
13
- const public_key = require('./public_key-ba538d77.js');
12
+ require('./l10n-17c96aba.js');
13
+ const public_key = require('./public_key-3d4ae164.js');
14
14
 
15
15
  const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
16
16
 
@@ -6,10 +6,10 @@
6
6
  Object.defineProperty(exports, '__esModule', { value: true });
7
7
 
8
8
  const index = require('./index-064e95c7.js');
9
- const x509_certificate = require('./x509_certificate-42b478d2.js');
10
- const certification_request = require('./certification_request-e1997ebf.js');
9
+ const x509_certificate = require('./x509_certificate-29a3636a.js');
10
+ const certification_request = require('./certification_request-b5fe8a57.js');
11
11
  require('./download-a97f4cb2.js');
12
- const l10n = require('./l10n-638a7577.js');
12
+ const l10n = require('./l10n-17c96aba.js');
13
13
 
14
14
  const certificatesViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative;background:white;background:rgba(var(--pv-color-light-rgb), 1)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table thead{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07)}table tr td{vertical-align:middle}table tbody tr:not(.expanded_summary){cursor:pointer}table tr{border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table th{padding:15px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table td{padding:8px 10px;border-width:1px;border-style:solid;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1)}table .col_issuer,table .col_name,table .col_public_key{width:16%}table .col_actions,table .col_tests{width:18%}table.m_extra .col_issuer,table.m_extra .col_name,table.m_extra .col_public_key{width:12%}table.m_extra .col_actions,table.m_extra .col_tests{width:17%}table tr.expanded td:not(:last-child){border-right-color:transparent}table tr.expanded td{border-bottom-color:transparent}.expanded{border-bottom-color:transparent;background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}table tr.expanded_summary td{vertical-align:top;padding:10px 20px 26px}@-webkit-keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}@keyframes fadeIn{0%{opacity:0.001}100%{opacity:1}}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;overflow:auto;text-align:center;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;padding:30px 10px}.modal_wrapper:before{display:inline-block;vertical-align:middle;width:0;height:100%;content:\"\"}.modal_backdrop{background:rgba(42, 49, 52, 0.5);background:rgba(var(--pv-color-dark-rgb), 0.5);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0}.modal_container{position:relative;display:inline-block;vertical-align:middle;width:100%;max-width:900px;text-align:left;border-radius:3px;overflow:hidden;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);height:100%}.modal_title{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);border-bottom-width:1px;border-bottom-style:solid;padding:20px 60px 16px 20px;position:relative;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:60px}.modal_content{height:calc(100% - 60px);overflow-y:auto}.modal_close{cursor:pointer;border:none;background-color:transparent;position:absolute;top:0;bottom:0;right:0;padding:0 12px;-webkit-transition:opacity 100ms;transition:opacity 100ms;outline:none}.modal_close:hover{opacity:0.6}.modal_close svg{fill:#2a3134;fill:rgba(var(--pv-color-dark-rgb), 1)}.button_table_action{margin:2px}.mobile_title{display:none}.status_wrapper{height:85px;text-align:center;pointer-events:none}.search_section{background-color:rgba(53, 132, 247, 0.07);background-color:rgba(var(--pv-color-primary-rgb), 0.07);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);height:50px;padding:10px;border-width:1px 1px 0 1px;border-style:solid}.input_search{height:100%;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:0 14px;font-size:12px;outline:none;border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.input_search::-webkit-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-moz-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search:-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::-ms-input-placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.input_search::placeholder{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.loading_container{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(42, 49, 52, 0.3);background:rgba(var(--pv-color-dark-rgb), 0.3);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.align_center{text-align:center}@media (hover: hover){table tbody tr:not(.expanded_summary):hover{background-color:rgba(53, 132, 247, 0.04);background-color:rgba(var(--pv-color-primary-rgb), 0.04)}}@media (max-width: 900px){table,tbody,tr,td{display:block}thead{display:none}tr{padding:0 15px;border-width:1px;border-style:solid}tr:not(:first-child){margin-top:-1px}tr:not(.expanded_summary) td:first-child{border:none !important}table td{padding-left:0;padding-right:0;border-width:1px 0 0 0 !important;border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr.expanded_summary td{padding:15px 0}.mobile_title{display:inline-block;width:90px;vertical-align:middle}.modal_title{padding:17px 60px 17px 15px}.content{display:inline-block;width:calc(100% - 90px);vertical-align:middle;text-align:left}.expanded_summary{border-top-color:transparent;padding-bottom:10px}.expanded_summary td:before{content:none}.status_wrapper{height:266px;display:table-cell}.search_section{height:60px;padding:15px}.align_center{text-align:inherit}}";
15
15
 
@@ -5,8 +5,8 @@
5
5
 
6
6
  const index = require('./index-064e95c7.js');
7
7
  const download = require('./download-a97f4cb2.js');
8
- const l10n = require('./l10n-638a7577.js');
9
- const certification_request = require('./certification_request-e1997ebf.js');
8
+ const l10n = require('./l10n-17c96aba.js');
9
+ const certification_request = require('./certification_request-b5fe8a57.js');
10
10
 
11
11
  /**
12
12
  * @license
@@ -3,9 +3,9 @@
3
3
  */
4
4
  'use strict';
5
5
 
6
- const certification_request = require('./certification_request-e1997ebf.js');
6
+ const certification_request = require('./certification_request-b5fe8a57.js');
7
7
  const download = require('./download-a97f4cb2.js');
8
- const l10n = require('./l10n-638a7577.js');
8
+ const l10n = require('./l10n-17c96aba.js');
9
9
 
10
10
  /**
11
11
  * @license
@@ -99,7 +99,7 @@ export class CrlViewer {
99
99
  h(Signature, { signature: this.certificateDecoded.signature }),
100
100
  h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }),
101
101
  h(Extensions, { extensions: this.certificateDecoded.extensions, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink }),
102
- this.certificateDecoded.asn.tbsCertList.revokedCertificates && (h(RevokedCertificates, { certificates: this.certificateDecoded.asn.tbsCertList.revokedCertificates })),
102
+ h(RevokedCertificates, { revokedCertificates: this.certificateDecoded.revokedCertificates }),
103
103
  this.download && (h(Miscellaneous, { certificate: this.certificateDecoded })))));
104
104
  }
105
105
  static get is() { return "peculiar-crl-viewer"; }
@@ -9,16 +9,33 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  import { h } from '@stencil/core';
12
+ import { CRLReason, InvalidityDate } from '@peculiar/asn1-x509';
12
13
  import { Convert } from 'pvtsutils';
13
14
  import { dateShort, l10n } from '../../utils';
15
+ import { getStringByOID } from '../certificate-viewer/get_string_by_oid';
14
16
  import { RowTitle, RowValue } from '../certificate-viewer/row';
15
17
  export const RevokedCertificates = (props) => {
16
- const { certificates, } = props;
18
+ const { revokedCertificates, } = props;
19
+ if (!revokedCertificates || !revokedCertificates.length) {
20
+ return null;
21
+ }
17
22
  return [
18
23
  h(RowTitle, { value: l10n.getString('revokedCertificates') }),
19
- certificates.map((certificate) => ([
24
+ revokedCertificates.map((certificate) => ([
20
25
  h(RowValue, { name: l10n.getString('serialNumber'), value: Convert.ToHex(certificate.userCertificate), monospace: true }),
21
- h(RowValue, { name: l10n.getString('revocation'), value: dateShort(certificate.revocationDate.getTime()) }),
26
+ h(RowValue, { name: l10n.getString('revocationDate'), value: dateShort(certificate.revocationDate.getTime()) }),
27
+ (certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([
28
+ h(RowValue, { name: `${l10n.getString('crlEntryExtensions')}:`, value: "" }),
29
+ certificate.crlEntryExtensions.map((extension) => {
30
+ if (extension.value instanceof CRLReason) {
31
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: extension.value.toJSON() || extension.value.reason }));
32
+ }
33
+ if (extension.value instanceof InvalidityDate) {
34
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: extension.value.value.getTime() }));
35
+ }
36
+ return (h(RowValue, { name: getStringByOID(extension.asn.extnID), value: Convert.ToHex(extension.asn.extnValue), monospace: true }));
37
+ }),
38
+ ])),
22
39
  h("tr", null,
23
40
  h("td", { colSpan: 2, class: "divider" },
24
41
  h("span", { class: "bg_fill" }))),
@@ -26,6 +26,15 @@ export class CRL extends AsnData {
26
26
  this.version = tbsCertList.version + 1;
27
27
  this.lastUpdate = tbsCertList.thisUpdate.getTime();
28
28
  this.nextUpdate = tbsCertList.nextUpdate.getTime();
29
+ this.revokedCertificates = (tbsCertList.revokedCertificates || [])
30
+ .map((revokedCertificate) => {
31
+ var _a;
32
+ return ({
33
+ revocationDate: revokedCertificate.revocationDate,
34
+ userCertificate: revokedCertificate.userCertificate,
35
+ crlEntryExtensions: (_a = revokedCertificate.crlEntryExtensions) === null || _a === void 0 ? void 0 : _a.map((e) => new Extension(AsnConvert.serialize(e))),
36
+ });
37
+ });
29
38
  }
30
39
  async getThumbprint(algorithm = 'SHA-1') {
31
40
  try {
@@ -4,10 +4,11 @@
4
4
  import { Convert } from 'pvtsutils';
5
5
  import { validator } from '../utils';
6
6
  import { cryptoProvider } from './provider';
7
- export const base64Clarify = (base64) => (base64
8
- .replace(/.*base64,/, '')
9
- .replace(/-----.+-----/g, '')
10
- .replace(/[\s\r\n]/g, ''));
7
+ const base64Re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====/;
8
+ export const base64Clarify = (base64) => {
9
+ const execArray = base64Re.exec(base64);
10
+ return execArray ? (execArray[1] || execArray[2]) : base64;
11
+ };
11
12
  export const hexFormat = (hex) => (hex
12
13
  .replace(/(.{32})/g, '$1\n')
13
14
  .replace(/(.{4})/g, '$1 ')
@@ -36,12 +36,13 @@
36
36
  "digestInfo": "Digest Info",
37
37
  "type": "Type",
38
38
  "revokedCertificates": "Revoked Certificates",
39
- "revocation": "Revocation",
39
+ "revocationDate": "Revocation Date",
40
40
  "yes": "Yes",
41
41
  "no": "No",
42
42
  "onlyUserCertificates": "Only User Certificates",
43
43
  "onlyAttributeCertificates": "Only Attribute Certificates",
44
44
  "onlyCACertificates": "Only CA Certificates",
45
45
  "indirectCRL": "Indirect CRL",
46
- "onlyReasons": "Only Reasons"
46
+ "onlyReasons": "Only Reasons",
47
+ "crlEntryExtensions": "CRL Entry Extensions"
47
48
  }
@@ -2,7 +2,7 @@
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
4
  import { b as build, c as createCommonjsModule, a as commonjsGlobal } from './download-67ac9120.js';
5
- import './l10n-da0dd100.js';
5
+ import './l10n-a68d5748.js';
6
6
 
7
7
  /**
8
8
  * @license
@@ -3383,6 +3383,102 @@ var AsnPropTypes;
3383
3383
  AsnPropTypes[AsnPropTypes["Null"] = 27] = "Null";
3384
3384
  })(AsnPropTypes || (AsnPropTypes = {}));
3385
3385
 
3386
+ class BitString {
3387
+ constructor(params, unusedBits = 0) {
3388
+ this.unusedBits = 0;
3389
+ this.value = new ArrayBuffer(0);
3390
+ if (params) {
3391
+ if (typeof params === "number") {
3392
+ this.fromNumber(params);
3393
+ }
3394
+ else if (build.BufferSourceConverter.isBufferSource(params)) {
3395
+ this.unusedBits = unusedBits;
3396
+ this.value = build.BufferSourceConverter.toArrayBuffer(params);
3397
+ }
3398
+ else {
3399
+ throw TypeError("Unsupported type of 'params' argument for BitString");
3400
+ }
3401
+ }
3402
+ }
3403
+ fromASN(asn) {
3404
+ if (!(asn instanceof BitString$1)) {
3405
+ throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
3406
+ }
3407
+ this.unusedBits = asn.valueBlock.unusedBits;
3408
+ this.value = asn.valueBlock.valueHex;
3409
+ return this;
3410
+ }
3411
+ toASN() {
3412
+ return new BitString$1({ unusedBits: this.unusedBits, valueHex: this.value });
3413
+ }
3414
+ toSchema(name) {
3415
+ return new BitString$1({ name });
3416
+ }
3417
+ toNumber() {
3418
+ let res = "";
3419
+ const uintArray = new Uint8Array(this.value);
3420
+ for (const octet of uintArray) {
3421
+ res += octet.toString(2).padStart(8, "0");
3422
+ }
3423
+ res = res.split("").reverse().join("");
3424
+ if (this.unusedBits) {
3425
+ res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
3426
+ }
3427
+ return parseInt(res, 2);
3428
+ }
3429
+ fromNumber(value) {
3430
+ let bits = value.toString(2);
3431
+ const octetSize = (bits.length + 7) >> 3;
3432
+ this.unusedBits = (octetSize << 3) - bits.length;
3433
+ const octets = new Uint8Array(octetSize);
3434
+ bits = bits.padStart(octetSize << 3, "0").split("").reverse().join("");
3435
+ let index = 0;
3436
+ while (index < octetSize) {
3437
+ octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
3438
+ index++;
3439
+ }
3440
+ this.value = octets.buffer;
3441
+ }
3442
+ }
3443
+
3444
+ class OctetString {
3445
+ constructor(param) {
3446
+ if (typeof param === "number") {
3447
+ this.buffer = new ArrayBuffer(param);
3448
+ }
3449
+ else {
3450
+ if (build.BufferSourceConverter.isBufferSource(param)) {
3451
+ this.buffer = build.BufferSourceConverter.toArrayBuffer(param);
3452
+ }
3453
+ else if (Array.isArray(param)) {
3454
+ this.buffer = new Uint8Array(param);
3455
+ }
3456
+ else {
3457
+ this.buffer = new ArrayBuffer(0);
3458
+ }
3459
+ }
3460
+ }
3461
+ get byteLength() {
3462
+ return this.buffer.byteLength;
3463
+ }
3464
+ get byteOffset() {
3465
+ return 0;
3466
+ }
3467
+ fromASN(asn) {
3468
+ if (!(asn instanceof OctetString$1)) {
3469
+ throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
3470
+ }
3471
+ this.buffer = asn.valueBlock.valueHex;
3472
+ return this;
3473
+ }
3474
+ toASN() {
3475
+ return new OctetString$1({ valueHex: this.buffer });
3476
+ }
3477
+ toSchema(name) {
3478
+ return new OctetString$1({ name });
3479
+ }
3480
+ }
3481
+
3386
3482
  const AsnAnyConverter = {
3387
3483
  fromASN: (value) => value instanceof Null ? null : value.valueBeforeDecodeView,
3388
3484
  toASN: (value) => {
@@ -3426,6 +3522,10 @@ const AsnOctetStringConverter = {
3426
3522
  fromASN: (value) => value.valueBlock.valueHexView,
3427
3523
  toASN: (value) => new OctetString$1({ valueHex: value }),
3428
3524
  };
3525
+ const AsnConstructedOctetStringConverter = {
3526
+ fromASN: (value) => new OctetString(value.getValue()),
3527
+ toASN: (value) => value.toASN(),
3528
+ };
3429
3529
  function createStringConverter(Asn1Type) {
3430
3530
  return {
3431
3531
  fromASN: (value) => value.valueBlock.value,
@@ -3509,102 +3609,6 @@ function defaultConverter(type) {
3509
3609
  }
3510
3610
  }
3511
3611
 
3512
- class BitString {
3513
- constructor(params, unusedBits = 0) {
3514
- this.unusedBits = 0;
3515
- this.value = new ArrayBuffer(0);
3516
- if (params) {
3517
- if (typeof params === "number") {
3518
- this.fromNumber(params);
3519
- }
3520
- else if (build.BufferSourceConverter.isBufferSource(params)) {
3521
- this.unusedBits = unusedBits;
3522
- this.value = build.BufferSourceConverter.toArrayBuffer(params);
3523
- }
3524
- else {
3525
- throw TypeError("Unsupported type of 'params' argument for BitString");
3526
- }
3527
- }
3528
- }
3529
- fromASN(asn) {
3530
- if (!(asn instanceof BitString$1)) {
3531
- throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");
3532
- }
3533
- this.unusedBits = asn.valueBlock.unusedBits;
3534
- this.value = asn.valueBlock.valueHex;
3535
- return this;
3536
- }
3537
- toASN() {
3538
- return new BitString$1({ unusedBits: this.unusedBits, valueHex: this.value });
3539
- }
3540
- toSchema(name) {
3541
- return new BitString$1({ name });
3542
- }
3543
- toNumber() {
3544
- let res = "";
3545
- const uintArray = new Uint8Array(this.value);
3546
- for (const octet of uintArray) {
3547
- res += octet.toString(2).padStart(8, "0");
3548
- }
3549
- res = res.split("").reverse().join("");
3550
- if (this.unusedBits) {
3551
- res = res.slice(this.unusedBits).padStart(this.unusedBits, "0");
3552
- }
3553
- return parseInt(res, 2);
3554
- }
3555
- fromNumber(value) {
3556
- let bits = value.toString(2);
3557
- const octetSize = (bits.length + 7) >> 3;
3558
- this.unusedBits = (octetSize << 3) - bits.length;
3559
- const octets = new Uint8Array(octetSize);
3560
- bits = bits.padStart(octetSize << 3, "0").split("").reverse().join("");
3561
- let index = 0;
3562
- while (index < octetSize) {
3563
- octets[index] = parseInt(bits.slice(index << 3, (index << 3) + 8), 2);
3564
- index++;
3565
- }
3566
- this.value = octets.buffer;
3567
- }
3568
- }
3569
-
3570
- class OctetString {
3571
- constructor(param) {
3572
- if (typeof param === "number") {
3573
- this.buffer = new ArrayBuffer(param);
3574
- }
3575
- else {
3576
- if (build.BufferSourceConverter.isBufferSource(param)) {
3577
- this.buffer = build.BufferSourceConverter.toArrayBuffer(param);
3578
- }
3579
- else if (Array.isArray(param)) {
3580
- this.buffer = new Uint8Array(param);
3581
- }
3582
- else {
3583
- this.buffer = new ArrayBuffer(0);
3584
- }
3585
- }
3586
- }
3587
- get byteLength() {
3588
- return this.buffer.byteLength;
3589
- }
3590
- get byteOffset() {
3591
- return 0;
3592
- }
3593
- fromASN(asn) {
3594
- if (!(asn instanceof OctetString$1)) {
3595
- throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
3596
- }
3597
- this.buffer = asn.valueBlock.valueHex;
3598
- return this;
3599
- }
3600
- toASN() {
3601
- return new OctetString$1({ valueHex: this.buffer });
3602
- }
3603
- toSchema(name) {
3604
- return new OctetString$1({ name });
3605
- }
3606
- }
3607
-
3608
3612
  function isConvertible(target) {
3609
3613
  if (typeof target === "function" && target.prototype) {
3610
3614
  if (target.prototype.toASN && target.prototype.fromASN) {
@@ -3794,7 +3798,7 @@ class AsnSchemaStorage {
3794
3798
  return this;
3795
3799
  }
3796
3800
  findParentSchema(target) {
3797
- const parent = target.__proto__;
3801
+ const parent = Object.getPrototypeOf(target);
3798
3802
  if (parent) {
3799
3803
  const schema = this.items.get(parent);
3800
3804
  return schema || this.findParentSchema(parent);
@@ -6070,11 +6074,14 @@ __decorate([
6070
6074
  let Time = class Time {
6071
6075
  constructor(time) {
6072
6076
  if (time) {
6073
- if (typeof time === "string" || typeof time === "number") {
6074
- this.utcTime = new Date(time);
6075
- }
6076
- else if (time instanceof Date) {
6077
- this.utcTime = time;
6077
+ if (typeof time === "string" || typeof time === "number" || time instanceof Date) {
6078
+ const date = new Date(time);
6079
+ if (date.getUTCFullYear() > 2049) {
6080
+ this.generalTime = date;
6081
+ }
6082
+ else {
6083
+ this.utcTime = date;
6084
+ }
6078
6085
  }
6079
6086
  else {
6080
6087
  Object.assign(this, time);
@@ -10235,10 +10242,11 @@ class CryptoProvider {
10235
10242
  CryptoProvider.DEFAULT = 'default';
10236
10243
  const cryptoProvider = new CryptoProvider();
10237
10244
 
10238
- const base64Clarify = (base64) => (base64
10239
- .replace(/.*base64,/, '')
10240
- .replace(/-----.+-----/g, '')
10241
- .replace(/[\s\r\n]/g, ''));
10245
+ const base64Re = /-----BEGIN [^-]+-----([A-Za-z0-9+/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+/=\s]+)====/;
10246
+ const base64Clarify = (base64) => {
10247
+ const execArray = base64Re.exec(base64);
10248
+ return execArray ? (execArray[1] || execArray[2]) : base64;
10249
+ };
10242
10250
  const hexFormat = (hex) => (hex
10243
10251
  .replace(/(.{32})/g, '$1\n')
10244
10252
  .replace(/(.{4})/g, '$1 ')
@@ -10965,15 +10973,15 @@ let EncryptedContent = class EncryptedContent {
10965
10973
  }
10966
10974
  };
10967
10975
  __decorate([
10968
- AsnProp({ type: OctetString })
10969
- ], EncryptedContent.prototype, "single", void 0);
10976
+ AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
10977
+ ], EncryptedContent.prototype, "value", void 0);
10970
10978
  __decorate([
10971
- AsnProp({ type: AsnPropTypes.Any })
10972
- ], EncryptedContent.prototype, "any", void 0);
10979
+ AsnProp({ type: OctetString, converter: AsnConstructedOctetStringConverter, context: 0, implicit: true, optional: true, repeated: "sequence" })
10980
+ ], EncryptedContent.prototype, "constructedValue", void 0);
10973
10981
  EncryptedContent = __decorate([
10974
10982
  AsnType({ type: AsnTypeTypes.Choice })
10975
10983
  ], EncryptedContent);
10976
- class ImplicitEncryptedContentInfo {
10984
+ class EncryptedContentInfo {
10977
10985
  constructor(params = {}) {
10978
10986
  this.contentType = "";
10979
10987
  this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
@@ -10982,43 +10990,13 @@ class ImplicitEncryptedContentInfo {
10982
10990
  }
10983
10991
  __decorate([
10984
10992
  AsnProp({ type: AsnPropTypes.ObjectIdentifier })
10985
- ], ImplicitEncryptedContentInfo.prototype, "contentType", void 0);
10993
+ ], EncryptedContentInfo.prototype, "contentType", void 0);
10986
10994
  __decorate([
10987
10995
  AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
10988
- ], ImplicitEncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
10996
+ ], EncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
10989
10997
  __decorate([
10990
- AsnProp({ type: OctetString, context: 0, implicit: true, optional: true })
10991
- ], ImplicitEncryptedContentInfo.prototype, "encryptedContent", void 0);
10992
- class ExplicitEncryptedContentInfo {
10993
- constructor(params = {}) {
10994
- this.contentType = "";
10995
- this.contentEncryptionAlgorithm = new ContentEncryptionAlgorithmIdentifier();
10996
- Object.assign(this, params);
10997
- }
10998
- }
10999
- __decorate([
11000
- AsnProp({ type: AsnPropTypes.ObjectIdentifier })
11001
- ], ExplicitEncryptedContentInfo.prototype, "contentType", void 0);
11002
- __decorate([
11003
- AsnProp({ type: ContentEncryptionAlgorithmIdentifier })
11004
- ], ExplicitEncryptedContentInfo.prototype, "contentEncryptionAlgorithm", void 0);
11005
- __decorate([
11006
- AsnProp({ type: EncryptedContent, context: 0, optional: true })
11007
- ], ExplicitEncryptedContentInfo.prototype, "encryptedContent", void 0);
11008
- let EncryptedContentInfo = class EncryptedContentInfo {
11009
- constructor(params = {}) {
11010
- Object.assign(this, params);
11011
- }
11012
- };
11013
- __decorate([
11014
- AsnProp({ type: ImplicitEncryptedContentInfo, optional: true })
11015
- ], EncryptedContentInfo.prototype, "implicitEncryptedContentInfo", void 0);
11016
- __decorate([
11017
- AsnProp({ type: ExplicitEncryptedContentInfo, optional: true })
11018
- ], EncryptedContentInfo.prototype, "explicitEncryptedContentInfo", void 0);
11019
- EncryptedContentInfo = __decorate([
11020
- AsnType({ type: AsnTypeTypes.Choice })
11021
- ], EncryptedContentInfo);
10998
+ AsnProp({ type: EncryptedContent, optional: true })
10999
+ ], EncryptedContentInfo.prototype, "encryptedContent", void 0);
11022
11000
 
11023
11001
  class IssuerAndSerialNumber {
11024
11002
  constructor(params = {}) {
@@ -11933,4 +11911,4 @@ __decorate([
11933
11911
  AsnProp({ type: AsnPropTypes.BitString })
11934
11912
  ], CertificationRequest.prototype, "signature", void 0);
11935
11913
 
11936
- export { AsnIntegerArrayBufferConverter as $, AsnData as A, id_DomainNameTechnicalOperator as B, Certificate as C, DomainNameTechnicalOperator as D, Extension as E, id_DomainNameOwner as F, DomainNameOwner as G, id_DomainNameLegalRepresentative as H, InsuranceValue as I, DomainNameLegalRepresentative as J, id_DomainNameBeneficiary as K, DomainNameBeneficiary as L, AttributeCertificate as M, Name as N, CertificationRequest as O, CertificateList as P, OIDs as Q, RSAPublicKey as R, Name$1 as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, OtherName as X, DisplayText as Y, UserNotice as Z, EDIPartyName as _, isX509Pem as a, KeyUsage as a0, BasicConstraints as a1, ExtendedKeyUsage as a2, SubjectKeyIdentifier as a3, AuthorityKeyIdentifier as a4, CRLDistributionPoints as a5, AuthorityInfoAccessSyntax as a6, SubjectInfoAccessSyntax as a7, SubjectAlternativeName as a8, CertificatePolicies as a9, CertificateTransparency as aa, NameConstraints as ab, CertificateTemplate as ac, EnrollCertTypeChoice as ad, CaVersion as ae, QCStatements as af, NetscapeComment as ag, NetscapeCertType as ah, LeiRole as ai, LeiChoice as aj, Timestamp as ak, ArchiveRevInfo as al, CRLReason as am, SubjectDirectoryAttributes as an, PrivateKeyUsagePeriod as ao, EntrustVersionInfo as ap, BiometricSyntax as aq, LogotypeExtn as ar, TNAuthorizationList as as, PolicyConstraints as at, PolicyMappings as au, CRLNumber as av, IssuingDistributionPoint as aw, isPkcs10Pem as b, isX509AttributePem as c, isX509CRLPem as d, certificateRawToBuffer as e, AsnConvert as f, id_ecPublicKey as g, ECParameters as h, isPem as i, id_rsaEncryption as j, hexFormat as k, base64Format as l, getCertificateThumbprint as m, Attribute$1 as n, id_pkcs9_at_extensionRequest as o, AsnParser as p, ExtensionRequest as q, id_pkcs9_at_unstructuredName as r, id_pkcs9_at_challengePassword as s, ChallengePassword as t, id_ValuationRanking as u, id_InsuranceValue as v, id_WebGDPR as w, id_ActivityDescription as x, ActivityDescription as y, id_TypeRelationship as z };
11914
+ export { UserNotice as $, AsnData as A, id_DomainNameTechnicalOperator as B, Certificate as C, DomainNameTechnicalOperator as D, Extension as E, id_DomainNameOwner as F, DomainNameOwner as G, id_DomainNameLegalRepresentative as H, InsuranceValue as I, DomainNameLegalRepresentative as J, id_DomainNameBeneficiary as K, DomainNameBeneficiary as L, AttributeCertificate as M, Name as N, CertificationRequest as O, CertificateList as P, OIDs as Q, RSAPublicKey as R, Name$1 as S, TypeRelationship as T, UnstructuredName as U, ValuationRanking as V, WebGDPR as W, CRLReason as X, InvalidityDate as Y, OtherName as Z, DisplayText as _, isX509Pem as a, EDIPartyName as a0, AsnIntegerArrayBufferConverter as a1, KeyUsage as a2, BasicConstraints as a3, ExtendedKeyUsage as a4, SubjectKeyIdentifier as a5, AuthorityKeyIdentifier as a6, CRLDistributionPoints as a7, AuthorityInfoAccessSyntax as a8, SubjectInfoAccessSyntax as a9, SubjectAlternativeName as aa, CertificatePolicies as ab, CertificateTransparency as ac, NameConstraints as ad, CertificateTemplate as ae, EnrollCertTypeChoice as af, CaVersion as ag, QCStatements as ah, NetscapeComment as ai, NetscapeCertType as aj, LeiRole as ak, LeiChoice as al, Timestamp as am, ArchiveRevInfo as an, SubjectDirectoryAttributes as ao, PrivateKeyUsagePeriod as ap, EntrustVersionInfo as aq, BiometricSyntax as ar, LogotypeExtn as as, TNAuthorizationList as at, PolicyConstraints as au, PolicyMappings as av, CRLNumber as aw, IssuingDistributionPoint as ax, isPkcs10Pem as b, isX509AttributePem as c, isX509CRLPem as d, certificateRawToBuffer as e, AsnConvert as f, id_ecPublicKey as g, ECParameters as h, isPem as i, id_rsaEncryption as j, hexFormat as k, base64Format as l, getCertificateThumbprint as m, Attribute$1 as n, id_pkcs9_at_extensionRequest as o, AsnParser as p, ExtensionRequest as q, id_pkcs9_at_unstructuredName as r, id_pkcs9_at_challengePassword as s, ChallengePassword as t, id_ValuationRanking as u, id_InsuranceValue as v, id_WebGDPR as w, id_ActivityDescription as x, ActivityDescription as y, id_TypeRelationship as z };
@@ -1,9 +1,9 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import { A as AsnData, n as Attribute$1, o as id_pkcs9_at_extensionRequest, p as AsnParser, q as ExtensionRequest, E as Extension, f as AsnConvert, r as id_pkcs9_at_unstructuredName, U as UnstructuredName, s as id_pkcs9_at_challengePassword, t as ChallengePassword, u as id_ValuationRanking, V as ValuationRanking, v as id_InsuranceValue, I as InsuranceValue, w as id_WebGDPR, W as WebGDPR, x as id_ActivityDescription, y as ActivityDescription, z as id_TypeRelationship, T as TypeRelationship, B as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, F as id_DomainNameOwner, G as DomainNameOwner, H as id_DomainNameLegalRepresentative, J as DomainNameLegalRepresentative, K as id_DomainNameBeneficiary, L as DomainNameBeneficiary, e as certificateRawToBuffer, M as AttributeCertificate, m as getCertificateThumbprint, k as hexFormat, l as base64Format, O as CertificationRequest, N as Name, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, P as CertificateList } from './certification_request-5d982d92.js';
4
+ import { A as AsnData, n as Attribute$1, o as id_pkcs9_at_extensionRequest, p as AsnParser, q as ExtensionRequest, E as Extension, f as AsnConvert, r as id_pkcs9_at_unstructuredName, U as UnstructuredName, s as id_pkcs9_at_challengePassword, t as ChallengePassword, u as id_ValuationRanking, V as ValuationRanking, v as id_InsuranceValue, I as InsuranceValue, w as id_WebGDPR, W as WebGDPR, x as id_ActivityDescription, y as ActivityDescription, z as id_TypeRelationship, T as TypeRelationship, B as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, F as id_DomainNameOwner, G as DomainNameOwner, H as id_DomainNameLegalRepresentative, J as DomainNameLegalRepresentative, K as id_DomainNameBeneficiary, L as DomainNameBeneficiary, e as certificateRawToBuffer, M as AttributeCertificate, m as getCertificateThumbprint, k as hexFormat, l as base64Format, O as CertificationRequest, N as Name, g as id_ecPublicKey, h as ECParameters, j as id_rsaEncryption, R as RSAPublicKey, P as CertificateList } from './certification_request-35ade000.js';
5
5
  import { b as build, D as Download } from './download-67ac9120.js';
6
- import { d as dateDiff } from './l10n-da0dd100.js';
6
+ import { d as dateDiff } from './l10n-a68d5748.js';
7
7
 
8
8
  /**
9
9
  * @license
@@ -250,6 +250,15 @@ class CRL extends AsnData {
250
250
  this.version = tbsCertList.version + 1;
251
251
  this.lastUpdate = tbsCertList.thisUpdate.getTime();
252
252
  this.nextUpdate = tbsCertList.nextUpdate.getTime();
253
+ this.revokedCertificates = (tbsCertList.revokedCertificates || [])
254
+ .map((revokedCertificate) => {
255
+ var _a;
256
+ return ({
257
+ revocationDate: revokedCertificate.revocationDate,
258
+ userCertificate: revokedCertificate.userCertificate,
259
+ crlEntryExtensions: (_a = revokedCertificate.crlEntryExtensions) === null || _a === void 0 ? void 0 : _a.map((e) => new Extension(AsnConvert.serialize(e))),
260
+ });
261
+ });
253
262
  }
254
263
  async getThumbprint(algorithm = 'SHA-1') {
255
264
  try {