@peculiar/certificates-viewer 3.2.1 → 3.3.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 (108) hide show
  1. package/dist/cjs/{certification_request-cde57123.js → certification_request-50ce61b3.js} +643 -235
  2. package/dist/cjs/crl-0c15e04a.js +312 -0
  3. package/dist/cjs/{index-ff818d4d.js → download-a97f4cb2.js} +106 -2
  4. package/dist/cjs/index.cjs.js +1 -3
  5. package/dist/cjs/l10n-4eaa5263.js +167 -0
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{peculiar-attribute-certificate-viewer_2.cjs.entry.js → peculiar-attribute-certificate-viewer_3.cjs.entry.js} +123 -21
  8. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -15
  9. package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +2 -2
  10. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +6 -25
  11. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +6 -8
  12. package/dist/cjs/peculiar.cjs.js +1 -1
  13. package/dist/cjs/{public_key-2f5bd471.js → public_key-2b73778a.js} +80 -40
  14. package/dist/cjs/{x509_certificate-51a97033.js → x509_certificate-c94ce29e.js} +13 -7
  15. package/dist/collection/collection-manifest.json +1 -0
  16. package/dist/collection/components/certificate-decoder/certificate-decoder.js +19 -6
  17. package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +2 -1
  18. package/dist/collection/components/certificate-viewer/basic_information.js +3 -1
  19. package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +2 -1
  20. package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +2 -1
  21. package/dist/collection/components/certificate-viewer/extensions/crl_number_extension.js +19 -0
  22. package/dist/collection/components/certificate-viewer/extensions/index.js +9 -1
  23. package/dist/collection/components/certificate-viewer/extensions/issuing_distribution_point_extension.js +27 -0
  24. package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +2 -1
  25. package/dist/collection/components/certificate-viewer/miscellaneous.js +2 -20
  26. package/dist/collection/components/certificates-viewer/certificates-viewer.js +2 -3
  27. package/dist/collection/components/crl-viewer/crl-viewer.js +234 -0
  28. package/dist/collection/components/crl-viewer/revoked_certificates.js +27 -0
  29. package/dist/collection/crypto/crl.js +82 -0
  30. package/dist/collection/crypto/csr.js +7 -0
  31. package/dist/collection/crypto/extension.js +10 -1
  32. package/dist/collection/crypto/index.js +1 -0
  33. package/dist/collection/crypto/utils.js +5 -4
  34. package/dist/collection/crypto/x509_attribute_certificate.js +7 -1
  35. package/dist/collection/crypto/x509_certificate.js +7 -1
  36. package/dist/collection/locales/en.json +12 -1
  37. package/dist/collection/utils/download.js +18 -2
  38. package/dist/collection/utils/index.js +1 -0
  39. package/dist/collection/utils/validator.js +2 -0
  40. package/dist/esm/{certification_request-c0674647.js → certification_request-5b5c2fa2.js} +577 -172
  41. package/dist/esm/crl-10d4db54.js +308 -0
  42. package/dist/esm/{index-0ba131b0.js → download-67ac9120.js} +102 -2
  43. package/dist/esm/index.js +1 -3
  44. package/dist/esm/l10n-116c79fa.js +163 -0
  45. package/dist/esm/loader.js +1 -1
  46. package/dist/esm/{peculiar-attribute-certificate-viewer_2.entry.js → peculiar-attribute-certificate-viewer_3.entry.js} +113 -12
  47. package/dist/esm/peculiar-certificate-decoder.entry.js +21 -11
  48. package/dist/esm/peculiar-certificate-summary_3.entry.js +2 -2
  49. package/dist/esm/peculiar-certificate-viewer.entry.js +6 -25
  50. package/dist/esm/peculiar-certificates-viewer.entry.js +6 -8
  51. package/dist/esm/peculiar.js +1 -1
  52. package/dist/esm/{public_key-38c9ddc8.js → public_key-c1e6801e.js} +67 -28
  53. package/dist/esm/{x509_certificate-12f6d344.js → x509_certificate-61126913.js} +9 -3
  54. package/dist/peculiar/index.esm.js +1 -1
  55. package/dist/peculiar/locales/en.json +12 -1
  56. package/dist/peculiar/p-10aa0b03.entry.js +11 -0
  57. package/dist/peculiar/{p-17c4da7b.js → p-309fdd02.js} +2 -2
  58. package/dist/peculiar/p-318a1e9f.entry.js +4 -0
  59. package/dist/peculiar/p-53aac672.js +63 -0
  60. package/dist/peculiar/p-5a898f51.js +32 -0
  61. package/dist/peculiar/{p-38635919.entry.js → p-652f77d0.entry.js} +1 -1
  62. package/dist/peculiar/p-7ef69178.entry.js +4 -0
  63. package/dist/peculiar/{p-464e0943.js → p-bbf0fd6c.js} +9 -9
  64. package/dist/peculiar/p-cff9655c.js +18 -0
  65. package/dist/peculiar/p-ed58acd0.js +12 -0
  66. package/dist/peculiar/p-ff867be1.entry.js +26 -0
  67. package/dist/peculiar/peculiar.esm.js +1 -1
  68. package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +3 -3
  69. package/dist/types/components/certificate-viewer/basic_information.d.ts +2 -0
  70. package/dist/types/components/certificate-viewer/extensions/crl_number_extension.d.ts +15 -0
  71. package/dist/types/components/certificate-viewer/extensions/issuing_distribution_point_extension.d.ts +15 -0
  72. package/dist/types/components/certificate-viewer/miscellaneous.d.ts +2 -2
  73. package/dist/types/components/certificate-viewer/row.d.ts +1 -1
  74. package/dist/types/components/crl-viewer/crl-viewer.d.ts +59 -0
  75. package/dist/types/components/crl-viewer/revoked_certificates.d.ts +14 -0
  76. package/dist/types/components.d.ts +66 -0
  77. package/dist/types/crypto/crl.d.ts +28 -0
  78. package/dist/types/crypto/csr.d.ts +2 -0
  79. package/dist/types/crypto/extension.d.ts +2 -2
  80. package/dist/types/crypto/index.d.ts +1 -0
  81. package/dist/types/crypto/x509_attribute_certificate.d.ts +2 -0
  82. package/dist/types/crypto/x509_certificate.d.ts +2 -0
  83. package/dist/types/utils/download.d.ts +10 -2
  84. package/dist/types/utils/index.d.ts +1 -0
  85. package/dist/types/utils/l10n.d.ts +11 -0
  86. package/dist/types/utils/validator.d.ts +1 -0
  87. package/package.json +19 -19
  88. package/dist/cjs/_commonjsHelpers-cb1f949a.js +0 -23
  89. package/dist/cjs/csr-78378ed0.js +0 -150
  90. package/dist/cjs/download-6724f3a7.js +0 -79
  91. package/dist/cjs/l10n-a048a686.js +0 -145
  92. package/dist/cjs/x509_attribute_certificate-cc325b70.js +0 -87
  93. package/dist/esm/_commonjsHelpers-bfbd2ad8.js +0 -20
  94. package/dist/esm/csr-c1b6a176.js +0 -147
  95. package/dist/esm/download-735fb2eb.js +0 -76
  96. package/dist/esm/l10n-ac28fa92.js +0 -141
  97. package/dist/esm/x509_attribute_certificate-a6d4aa15.js +0 -85
  98. package/dist/peculiar/p-006865d7.js +0 -4
  99. package/dist/peculiar/p-3f8d1008.entry.js +0 -4
  100. package/dist/peculiar/p-42da7f97.js +0 -11
  101. package/dist/peculiar/p-4f4c1d30.js +0 -12
  102. package/dist/peculiar/p-6011646e.entry.js +0 -11
  103. package/dist/peculiar/p-6bfd077c.entry.js +0 -18
  104. package/dist/peculiar/p-6c510523.js +0 -18
  105. package/dist/peculiar/p-986cc770.entry.js +0 -11
  106. package/dist/peculiar/p-b765873e.js +0 -78
  107. package/dist/peculiar/p-d0b55fbb.js +0 -4
  108. package/dist/peculiar/p-d7a13cb4.js +0 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peculiar/certificates-viewer",
3
- "version": "3.2.1",
3
+ "version": "3.3.1",
4
4
  "private": false,
5
5
  "description": "Peculiar Certificate Viewer web-components makes it easy for you to display certificate related details in your web application.",
6
6
  "keywords": [
@@ -41,23 +41,23 @@
41
41
  "typescript": "^4.0.5"
42
42
  },
43
43
  "dependencies": {
44
- "@peculiar/asn1-adobe-acrobat": "^2.1.9",
45
- "@peculiar/asn1-cert-transparency": "^2.1.9",
46
- "@peculiar/asn1-csr": "^2.1.9",
47
- "@peculiar/asn1-ecc": "^2.1.9",
48
- "@peculiar/asn1-lei": "^2.1.9",
49
- "@peculiar/asn1-ntqwac": "^2.1.9",
50
- "@peculiar/asn1-pkcs9": "^2.1.9",
51
- "@peculiar/asn1-rfc8226": "^2.1.9",
52
- "@peculiar/asn1-rsa": "^2.1.9",
53
- "@peculiar/asn1-schema": "^2.1.9",
54
- "@peculiar/asn1-x509": "^2.1.9",
55
- "@peculiar/asn1-x509-attr": "^2.1.9",
56
- "@peculiar/asn1-x509-logotype": "^2.1.9",
57
- "@peculiar/asn1-x509-microsoft": "^2.1.9",
58
- "@peculiar/asn1-x509-netscape": "^2.1.9",
59
- "@peculiar/asn1-x509-qualified": "^2.1.9",
60
- "dayjs": "^1.11.3",
44
+ "@peculiar/asn1-adobe-acrobat": "^2.3.4",
45
+ "@peculiar/asn1-cert-transparency": "^2.3.3",
46
+ "@peculiar/asn1-csr": "^2.3.4",
47
+ "@peculiar/asn1-ecc": "^2.3.4",
48
+ "@peculiar/asn1-lei": "^2.3.3",
49
+ "@peculiar/asn1-ntqwac": "^2.3.4",
50
+ "@peculiar/asn1-pkcs9": "^2.3.4",
51
+ "@peculiar/asn1-rfc8226": "^2.3.3",
52
+ "@peculiar/asn1-rsa": "^2.3.4",
53
+ "@peculiar/asn1-schema": "^2.3.3",
54
+ "@peculiar/asn1-x509": "^2.3.4",
55
+ "@peculiar/asn1-x509-attr": "^2.3.4",
56
+ "@peculiar/asn1-x509-logotype": "^2.3.4",
57
+ "@peculiar/asn1-x509-microsoft": "^2.3.4",
58
+ "@peculiar/asn1-x509-netscape": "^2.3.3",
59
+ "@peculiar/asn1-x509-qualified": "^2.3.4",
60
+ "dayjs": "^1.11.6",
61
61
  "pvtsutils": "^1.3.2"
62
62
  },
63
63
  "license": "MIT",
@@ -70,5 +70,5 @@
70
70
  "publishConfig": {
71
71
  "access": "public"
72
72
  },
73
- "gitHead": "2e33190dcfdd66757f40f6cc20c4e90dfd12180a"
73
+ "gitHead": "2956c7d920777d78cf73f19c07b1223cff8fb692"
74
74
  }
@@ -1,23 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
7
-
8
- function createCommonjsModule(fn, basedir, module) {
9
- return module = {
10
- path: basedir,
11
- exports: {},
12
- require: function (path, base) {
13
- return commonjsRequire();
14
- }
15
- }, fn(module, module.exports), module.exports;
16
- }
17
-
18
- function commonjsRequire () {
19
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
20
- }
21
-
22
- exports.commonjsGlobal = commonjsGlobal;
23
- exports.createCommonjsModule = createCommonjsModule;
@@ -1,150 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- const certification_request = require('./certification_request-cde57123.js');
7
- const index = require('./index-ff818d4d.js');
8
-
9
- /**
10
- * @license
11
- * Copyright (c) Peculiar Ventures, LLC.
12
- *
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */
16
- class Attribute extends certification_request.AsnData {
17
- constructor(raw) {
18
- super(raw, certification_request.Attribute);
19
- const asnExtnValue = this.getAsnExtnValue();
20
- switch (this.asn.type) {
21
- case certification_request.id_DomainNameBeneficiary:
22
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameBeneficiary);
23
- break;
24
- case certification_request.id_DomainNameLegalRepresentative:
25
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameLegalRepresentative);
26
- break;
27
- case certification_request.id_DomainNameOwner:
28
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameOwner);
29
- break;
30
- case certification_request.id_DomainNameTechnicalOperator:
31
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.DomainNameTechnicalOperator);
32
- break;
33
- case certification_request.id_TypeRelationship:
34
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.TypeRelationship);
35
- break;
36
- case certification_request.id_ActivityDescription:
37
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ActivityDescription);
38
- break;
39
- case certification_request.id_WebGDPR:
40
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.WebGDPR);
41
- break;
42
- case certification_request.id_InsuranceValue:
43
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.InsuranceValue);
44
- break;
45
- case certification_request.id_ValuationRanking:
46
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ValuationRanking);
47
- break;
48
- case certification_request.id_pkcs9_at_challengePassword:
49
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.ChallengePassword);
50
- break;
51
- case certification_request.id_pkcs9_at_unstructuredName:
52
- this.value = certification_request.AsnParser.parse(asnExtnValue, certification_request.UnstructuredName);
53
- break;
54
- case certification_request.id_pkcs9_at_extensionRequest: {
55
- const extensionRequest = certification_request.AsnParser.parse(asnExtnValue, certification_request.ExtensionRequest);
56
- this.value = extensionRequest
57
- .map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
58
- break;
59
- }
60
- default:
61
- this.value = index.build.Convert.ToHex(asnExtnValue);
62
- }
63
- }
64
- getAsnExtnValue() {
65
- return this.asn.values[0];
66
- }
67
- }
68
-
69
- /**
70
- * @license
71
- * Copyright (c) Peculiar Ventures, LLC.
72
- *
73
- * This source code is licensed under the MIT license found in the
74
- * LICENSE file in the root directory of this source tree.
75
- */
76
- class CSR extends certification_request.AsnData {
77
- constructor(raw) {
78
- super(certification_request.certificateRawToBuffer(raw), certification_request.CertificationRequest);
79
- this.thumbprints = {};
80
- this.type = 'PKCS#10 Certificate Request';
81
- const { certificationRequestInfo } = this.asn;
82
- this.subject = new certification_request.Name(certificationRequestInfo.subject).toJSON();
83
- this.version = certificationRequestInfo.version;
84
- }
85
- get publicKey() {
86
- const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
87
- let params;
88
- if (algorithm.algorithm === certification_request.id_ecPublicKey && algorithm.parameters) {
89
- params = certification_request.AsnConvert.parse(algorithm.parameters, certification_request.ECParameters);
90
- }
91
- if (algorithm.algorithm === certification_request.id_rsaEncryption) {
92
- params = certification_request.AsnConvert.parse(subjectPublicKey, certification_request.RSAPublicKey);
93
- }
94
- const spki = certification_request.AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
95
- return {
96
- params,
97
- value: spki,
98
- algorithm: algorithm.algorithm,
99
- };
100
- }
101
- get signature() {
102
- const { signature, signatureAlgorithm } = this.asn;
103
- return {
104
- value: signature,
105
- algorithm: signatureAlgorithm.algorithm,
106
- };
107
- }
108
- get commonName() {
109
- if (!this.subject) {
110
- return '';
111
- }
112
- for (let i = 0; i < this.subject.length; i += 1) {
113
- const name = this.subject[i];
114
- if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
115
- return name.value;
116
- }
117
- }
118
- return '';
119
- }
120
- async getThumbprint(algorithm = 'SHA-1') {
121
- try {
122
- const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
123
- if (thumbprint) {
124
- this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
125
- }
126
- }
127
- catch (error) {
128
- console.error('Error thumbprint get:', error);
129
- }
130
- }
131
- parseAttributes() {
132
- const { certificationRequestInfo } = this.asn;
133
- if (certificationRequestInfo.attributes) {
134
- this.attributes = certificationRequestInfo.attributes
135
- .map((e) => new Attribute(certification_request.AsnConvert.serialize(e)));
136
- }
137
- }
138
- exportAsBase64() {
139
- return index.build.Convert.ToBase64(this.raw);
140
- }
141
- exportAsHexFormatted() {
142
- return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
143
- }
144
- exportAsPemFormatted() {
145
- return `-----BEGIN CERTIFICATE REQUEST-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
146
- }
147
- }
148
-
149
- exports.Attribute = Attribute;
150
- exports.CSR = CSR;
@@ -1,79 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- const index = require('./index-ff818d4d.js');
7
-
8
- /**
9
- * @license
10
- * Copyright (c) Peculiar Ventures, LLC.
11
- *
12
- * This source code is licensed under the MIT license found in the
13
- * LICENSE file in the root directory of this source tree.
14
- */
15
- /**
16
- * Download from buffer
17
- *
18
- * @example
19
- * ```js
20
- * import { downloadFromBuffer } from './utils';
21
- *
22
- * downloadFromBuffer(arrayBufferValue, 'myFile', 'pdf', 'applciation/pdf');
23
- * ```
24
- */
25
- function downloadFromBuffer(value, name, extension, mime = 'application/octet-stream') {
26
- const blob = new Blob([value], { type: mime });
27
- // @ts-ignore
28
- if (navigator.msSaveBlob) { // IE10+ : (has Blob, but not a[download] or URL)
29
- // @ts-ignore
30
- navigator.msSaveBlob(blob, `${name}.${extension}`);
31
- return new Promise((res) => setTimeout(res, 100));
32
- }
33
- const blobURL = window.URL.createObjectURL(blob);
34
- const link = document.createElement('a');
35
- const frame = document.createElement('iframe');
36
- link.style.display = 'none';
37
- frame.style.display = 'none';
38
- frame.name = blobURL;
39
- document.body.appendChild(frame);
40
- link.href = blobURL;
41
- link.target = blobURL;
42
- link.download = `${name}.${extension}`;
43
- document.body.appendChild(link);
44
- link.dispatchEvent(new MouseEvent('click'));
45
- document.body.removeChild(link);
46
- return new Promise((res) => setTimeout(() => {
47
- document.body.removeChild(frame);
48
- res(undefined);
49
- }, 100));
50
- }
51
-
52
- /**
53
- * @license
54
- * Copyright (c) Peculiar Ventures, LLC.
55
- *
56
- * This source code is licensed under the MIT license found in the
57
- * LICENSE file in the root directory of this source tree.
58
- */
59
- class Download {
60
- }
61
- Download.x509 = {
62
- asPEM: (pem, name) => {
63
- downloadFromBuffer(index.build.Convert.FromString(pem), name, 'cer', 'application/pkix-cert');
64
- },
65
- asDER: (hex, name) => {
66
- downloadFromBuffer(index.build.Convert.FromString(hex), name, 'cer', 'application/pkix-cert');
67
- },
68
- };
69
- Download.pkcs10 = {
70
- asPEM: (pem, name) => {
71
- downloadFromBuffer(index.build.Convert.FromString(pem), name, 'csr', 'application/pkcs10');
72
- },
73
- asDER: (hex, name) => {
74
- downloadFromBuffer(index.build.Convert.FromString(hex), name, 'csr', 'application/pkcs10');
75
- },
76
- };
77
-
78
- exports.Download = Download;
79
- exports.downloadFromBuffer = downloadFromBuffer;
@@ -1,145 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- const _commonjsHelpers = require('./_commonjsHelpers-cb1f949a.js');
7
-
8
- var dayjs_min = _commonjsHelpers.createCommonjsModule(function (module, exports) {
9
- !function(t,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t);}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return O},m.isValid=function(){return !(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
10
- });
11
-
12
- var relativeTime = _commonjsHelpers.createCommonjsModule(function (module, exports) {
13
- !function(r,e){module.exports=e();}(_commonjsHelpers.commonjsGlobal,(function(){return function(r,e,t){r=r||{};var n=e.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function i(r,e,t,o){return n.fromToBase(r,e,t,o)}t.en.relativeTime=o,n.fromToBase=function(e,n,i,d,u){for(var f,a,s,l=i.$locale().relativeTime||o,h=r.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],m=h.length,c=0;c<m;c+=1){var y=h[c];y.d&&(f=d?t(e).diff(i,y.d,!0):i.diff(e,y.d,!0));var p=(r.rounding||Math.round)(Math.abs(f));if(s=f>0,p<=y.r||!y.r){p<=1&&c>0&&(y=h[c-1]);var v=l[y.l];u&&(p=u(""+p)),a="string"==typeof v?v.replace("%d",p):v(p,n,y.l,s);break}}if(n)return a;var M=s?l.future:l.past;return "function"==typeof M?M(a):M.replace("%s",a)},n.to=function(r,e){return i(r,e,this,!0)},n.from=function(r,e){return i(r,e,this)};var d=function(r){return r.$u?t.utc():t()};n.toNow=function(r){return this.to(d(this),r)},n.fromNow=function(r){return this.from(d(this),r)};}}));
14
- });
15
-
16
- /**
17
- * @license
18
- * Copyright (c) Peculiar Ventures, LLC.
19
- *
20
- * This source code is licensed under the MIT license found in the
21
- * LICENSE file in the root directory of this source tree.
22
- */
23
- dayjs_min.extend(relativeTime);
24
- const dateShort = (date) => (new Date(date).toUTCString());
25
- const dateDiff = (dateStart, dateEnd) => {
26
- if (!dateStart || !dateEnd) {
27
- return '';
28
- }
29
- const start = dayjs_min(dateStart);
30
- const end = dayjs_min(dateEnd);
31
- return start.to(end, true);
32
- };
33
-
34
- const basicInformation = "Basic Information";
35
- const subjectName = "Subject Name";
36
- const issuerName = "Issuer Name";
37
- const publicKeyInfo = "Public Key Info";
38
- const signature = "Signature";
39
- const extensions = "Extensions";
40
- const miscellaneous = "Miscellaneous";
41
- const download = "Download";
42
- const serialNumber = "Serial Number";
43
- const version = "Version";
44
- const validity = "Validity";
45
- const issued = "Issued";
46
- const expired = "Expired";
47
- const algorithm = "Algorithm";
48
- const namedCurve = "Named Curve";
49
- const exponent = "Exponent";
50
- const modulus = "Modulus";
51
- const value = "Value";
52
- const valid = "Valid";
53
- const revoked = "Revoked";
54
- const issuer = "Issuer";
55
- const name = "Name";
56
- const publicKey = "Public Key";
57
- const fingerprint = "Fingerprint";
58
- const fingerprints = "Fingerprints";
59
- const actions = "Actions";
60
- const details = "Details";
61
- const testURLs = "Test URLs";
62
- const certificateDetails = "Certificate Details";
63
- const holder = "Holder";
64
- const digestInfo = "Digest Info";
65
- const type = "Type";
66
- const en = {
67
- basicInformation: basicInformation,
68
- subjectName: subjectName,
69
- issuerName: issuerName,
70
- publicKeyInfo: publicKeyInfo,
71
- signature: signature,
72
- extensions: extensions,
73
- miscellaneous: miscellaneous,
74
- download: download,
75
- "download.pem": "Download PEM",
76
- "download.der": "Download DER",
77
- serialNumber: serialNumber,
78
- version: version,
79
- validity: validity,
80
- issued: issued,
81
- expired: expired,
82
- algorithm: algorithm,
83
- namedCurve: namedCurve,
84
- exponent: exponent,
85
- modulus: modulus,
86
- value: value,
87
- valid: valid,
88
- revoked: revoked,
89
- issuer: issuer,
90
- name: name,
91
- publicKey: publicKey,
92
- fingerprint: fingerprint,
93
- fingerprints: fingerprints,
94
- actions: actions,
95
- details: details,
96
- testURLs: testURLs,
97
- certificateDetails: certificateDetails,
98
- holder: holder,
99
- digestInfo: digestInfo,
100
- type: type
101
- };
102
-
103
- /**
104
- * @license
105
- * Copyright (c) Peculiar Ventures, LLC.
106
- *
107
- * This source code is licensed under the MIT license found in the
108
- * LICENSE file in the root directory of this source tree.
109
- */
110
- const MESSAGES_ALL = {
111
- en,
112
- };
113
- class Localization {
114
- constructor() {
115
- this.setLocale = (locale) => {
116
- this.locale = locale && MESSAGES_ALL[locale] ? locale : 'en';
117
- };
118
- this.getLocale = () => this.locale;
119
- const language = window.navigator.language.slice(0, 2).toLowerCase();
120
- this.setLocale(language);
121
- }
122
- getString(id, replacer) {
123
- const value = MESSAGES_ALL[this.locale][id];
124
- if (!value) {
125
- return '';
126
- }
127
- if (!replacer) {
128
- return value;
129
- }
130
- const splitted = value.split(replacer.pattern);
131
- if (splitted.length > 1) {
132
- return [
133
- splitted[0],
134
- replacer.replacer,
135
- splitted[1],
136
- ];
137
- }
138
- return value;
139
- }
140
- }
141
- const l10n = new Localization();
142
-
143
- exports.dateDiff = dateDiff;
144
- exports.dateShort = dateShort;
145
- exports.l10n = l10n;
@@ -1,87 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- 'use strict';
5
-
6
- const certification_request = require('./certification_request-cde57123.js');
7
- const index = require('./index-ff818d4d.js');
8
- const l10n = require('./l10n-a048a686.js');
9
- const csr = require('./csr-78378ed0.js');
10
-
11
- /**
12
- * @license
13
- * Copyright (c) Peculiar Ventures, LLC.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */
18
- class X509AttributeCertificate extends certification_request.AsnData {
19
- constructor(raw) {
20
- var _a;
21
- super(certification_request.certificateRawToBuffer(raw), certification_request.AttributeCertificate);
22
- this.thumbprints = {};
23
- this.type = 'X.509 Attribute Certificate';
24
- const { acinfo } = this.asn;
25
- this.serialNumber = index.build.Convert.ToHex(acinfo.serialNumber);
26
- this.version = acinfo.version;
27
- const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
28
- if (!notBefore) {
29
- throw new Error("Cannot get 'notBefore' value");
30
- }
31
- this.notBefore = notBefore;
32
- const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
33
- if (!notAfter) {
34
- throw new Error("Cannot get 'notAfter' value");
35
- }
36
- this.notAfter = notAfter;
37
- this.validity = l10n.dateDiff(this.notBefore, this.notAfter);
38
- this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
39
- this.holder = acinfo.holder;
40
- }
41
- get signature() {
42
- const { signatureValue, signatureAlgorithm } = this.asn;
43
- return {
44
- value: signatureValue,
45
- algorithm: signatureAlgorithm.algorithm,
46
- };
47
- }
48
- parseExtensions() {
49
- const { acinfo } = this.asn;
50
- if (acinfo.extensions) {
51
- this.extensions = acinfo.extensions
52
- .map((e) => new certification_request.Extension(certification_request.AsnConvert.serialize(e)));
53
- }
54
- }
55
- parseAttributes() {
56
- const { acinfo } = this.asn;
57
- if (acinfo.attributes) {
58
- this.attributes = acinfo.attributes
59
- .map((e) => new csr.Attribute(certification_request.AsnConvert.serialize(e)));
60
- }
61
- }
62
- async getThumbprint(algorithm = 'SHA-1') {
63
- try {
64
- const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
65
- if (thumbprint) {
66
- this.thumbprints[algorithm['name'] || algorithm] = index.build.Convert.ToHex(thumbprint);
67
- }
68
- }
69
- catch (error) {
70
- console.error('Error thumbprint get:', error);
71
- }
72
- }
73
- exportAsBase64() {
74
- return index.build.Convert.ToBase64(this.raw);
75
- }
76
- exportAsHexFormatted() {
77
- return certification_request.hexFormat(index.build.Convert.ToHex(this.raw));
78
- }
79
- exportAsPemFormatted() {
80
- return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${certification_request.base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
81
- }
82
- get commonName() {
83
- return `attribute-certificate-${this.thumbprints['SHA-1']}`;
84
- }
85
- }
86
-
87
- exports.X509AttributeCertificate = X509AttributeCertificate;
@@ -1,20 +0,0 @@
1
- /*!
2
- * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
- */
4
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
-
6
- function createCommonjsModule(fn, basedir, module) {
7
- return module = {
8
- path: basedir,
9
- exports: {},
10
- require: function (path, base) {
11
- return commonjsRequire();
12
- }
13
- }, fn(module, module.exports), module.exports;
14
- }
15
-
16
- function commonjsRequire () {
17
- throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
18
- }
19
-
20
- export { commonjsGlobal as a, createCommonjsModule as c };