@peculiar/certificates-viewer 3.0.3 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{certification_request-311ab0a6.js → certification_request-878e786a.js} +8 -2
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +19 -3
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +12 -0
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/crypto/csr.js +3 -1
- package/dist/collection/crypto/utils.js +4 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +3 -1
- package/dist/collection/crypto/x509_certificate.js +3 -1
- package/dist/esm/{certification_request-efd1e98c.js → certification_request-3402a181.js} +8 -2
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +19 -3
- package/dist/esm/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/peculiar/{p-621509b3.entry.js → p-08538084.entry.js} +4 -4
- package/dist/peculiar/{p-fd1c657d.entry.js → p-3fc37750.entry.js} +1 -1
- package/dist/peculiar/{p-d676d064.js → p-8ad24aa3.js} +3 -3
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +1 -0
- package/dist/types/constants/oids.d.ts +1 -0
- package/dist/types/crypto/utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -8710,6 +8710,7 @@ const OIDs = {
|
|
|
8710
8710
|
'2.16.840.1.114412.31.4.31.1': 'Digi Cert Grid Host Cert',
|
|
8711
8711
|
'2.16.840.1.114413.1.7.23.3': 'Go Daddy EV policy',
|
|
8712
8712
|
'2.16.840.1.114414.1.7.23.3': 'Starfield EV policy',
|
|
8713
|
+
'2.16.840.1.114569.1.1.3': 'SHAKEN/STIR Certificate Policy v1.3',
|
|
8713
8714
|
'2.23.42.0': 'Content Type',
|
|
8714
8715
|
'2.23.42.0.0': 'Pan Data',
|
|
8715
8716
|
'2.23.42.0.1': 'Pan Token',
|
|
@@ -10224,7 +10225,10 @@ const certificateRawToBuffer = (raw) => {
|
|
|
10224
10225
|
};
|
|
10225
10226
|
const getCertificateThumbprint = async (algorithm, data) => {
|
|
10226
10227
|
const crypto = cryptoProvider.get();
|
|
10227
|
-
|
|
10228
|
+
if (crypto.subtle) {
|
|
10229
|
+
return crypto.subtle.digest(algorithm, data);
|
|
10230
|
+
}
|
|
10231
|
+
return undefined;
|
|
10228
10232
|
};
|
|
10229
10233
|
|
|
10230
10234
|
/**
|
|
@@ -10300,7 +10304,9 @@ class X509Certificate extends AsnData {
|
|
|
10300
10304
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
10301
10305
|
try {
|
|
10302
10306
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
10303
|
-
|
|
10307
|
+
if (thumbprint) {
|
|
10308
|
+
this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
|
|
10309
|
+
}
|
|
10304
10310
|
}
|
|
10305
10311
|
catch (error) {
|
|
10306
10312
|
console.error('Error thumbprint get:', error);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-064e95c7.js');
|
|
9
|
-
const certification_request = require('./certification_request-
|
|
9
|
+
const certification_request = require('./certification_request-878e786a.js');
|
|
10
10
|
const download = require('./download-5e7d5455.js');
|
|
11
11
|
const l10n = require('./l10n-d4a77087.js');
|
|
12
12
|
require('./_commonjsHelpers-cb1f949a.js');
|
|
@@ -157,7 +157,9 @@ class X509AttributeCertificate extends certification_request.AsnData {
|
|
|
157
157
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
158
158
|
try {
|
|
159
159
|
const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
|
|
160
|
-
|
|
160
|
+
if (thumbprint) {
|
|
161
|
+
this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
|
|
162
|
+
}
|
|
161
163
|
}
|
|
162
164
|
catch (error) {
|
|
163
165
|
console.error('Error thumbprint get:', error);
|
|
@@ -231,7 +233,9 @@ class CSR extends certification_request.AsnData {
|
|
|
231
233
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
232
234
|
try {
|
|
233
235
|
const thumbprint = await certification_request.getCertificateThumbprint(algorithm, this.raw);
|
|
234
|
-
|
|
236
|
+
if (thumbprint) {
|
|
237
|
+
this.thumbprints[algorithm['name'] || algorithm] = download.build.Convert.ToHex(thumbprint);
|
|
238
|
+
}
|
|
235
239
|
}
|
|
236
240
|
catch (error) {
|
|
237
241
|
console.error('Error thumbprint get:', error);
|
|
@@ -1714,6 +1718,15 @@ const certificateDecoderCss = ":host{-webkit-box-sizing:border-box;box-sizing:bo
|
|
|
1714
1718
|
const CertificateDecoder = class {
|
|
1715
1719
|
constructor(hostRef) {
|
|
1716
1720
|
index.registerInstance(this, hostRef);
|
|
1721
|
+
this.fetchAndDecodeFile = async (url) => {
|
|
1722
|
+
try {
|
|
1723
|
+
const request = await fetch(url);
|
|
1724
|
+
this.decode(await request.text());
|
|
1725
|
+
}
|
|
1726
|
+
catch (error) {
|
|
1727
|
+
alert('Failed to load certificate. Please use another file or check CORS policy.');
|
|
1728
|
+
}
|
|
1729
|
+
};
|
|
1717
1730
|
this.onClickDecode = () => {
|
|
1718
1731
|
const { value } = this.inputPaste;
|
|
1719
1732
|
if (value) {
|
|
@@ -1756,6 +1769,9 @@ const CertificateDecoder = class {
|
|
|
1756
1769
|
*/
|
|
1757
1770
|
setTimeout(() => this.decode(parsedHash.cert), 100);
|
|
1758
1771
|
}
|
|
1772
|
+
else if (parsedHash.certurl) {
|
|
1773
|
+
this.fetchAndDecodeFile(parsedHash.certurl);
|
|
1774
|
+
}
|
|
1759
1775
|
}
|
|
1760
1776
|
clearValue() {
|
|
1761
1777
|
this.inputPaste.value = '';
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const index = require('./index-064e95c7.js');
|
|
9
|
-
const certification_request = require('./certification_request-
|
|
9
|
+
const certification_request = require('./certification_request-878e786a.js');
|
|
10
10
|
const download = require('./download-5e7d5455.js');
|
|
11
11
|
const l10n = require('./l10n-d4a77087.js');
|
|
12
12
|
require('./_commonjsHelpers-cb1f949a.js');
|
|
@@ -13,6 +13,15 @@ import { validator, history, readAsBinaryString } from '../../utils';
|
|
|
13
13
|
import { X509Certificate, X509AttributeCertificate, CSR } from '../../crypto';
|
|
14
14
|
export class CertificateDecoder {
|
|
15
15
|
constructor() {
|
|
16
|
+
this.fetchAndDecodeFile = async (url) => {
|
|
17
|
+
try {
|
|
18
|
+
const request = await fetch(url);
|
|
19
|
+
this.decode(await request.text());
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
alert('Failed to load certificate. Please use another file or check CORS policy.');
|
|
23
|
+
}
|
|
24
|
+
};
|
|
16
25
|
this.onClickDecode = () => {
|
|
17
26
|
const { value } = this.inputPaste;
|
|
18
27
|
if (value) {
|
|
@@ -55,6 +64,9 @@ export class CertificateDecoder {
|
|
|
55
64
|
*/
|
|
56
65
|
setTimeout(() => this.decode(parsedHash.cert), 100);
|
|
57
66
|
}
|
|
67
|
+
else if (parsedHash.certurl) {
|
|
68
|
+
this.fetchAndDecodeFile(parsedHash.certurl);
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
clearValue() {
|
|
60
72
|
this.inputPaste.value = '';
|
|
@@ -2171,6 +2171,7 @@ export const OIDs = {
|
|
|
2171
2171
|
'2.16.840.1.114412.31.4.31.1': 'Digi Cert Grid Host Cert',
|
|
2172
2172
|
'2.16.840.1.114413.1.7.23.3': 'Go Daddy EV policy',
|
|
2173
2173
|
'2.16.840.1.114414.1.7.23.3': 'Starfield EV policy',
|
|
2174
|
+
'2.16.840.1.114569.1.1.3': 'SHAKEN/STIR Certificate Policy v1.3',
|
|
2174
2175
|
'2.23.42.0': 'Content Type',
|
|
2175
2176
|
'2.23.42.0.0': 'Pan Data',
|
|
2176
2177
|
'2.23.42.0.1': 'Pan Token',
|
|
@@ -64,7 +64,9 @@ export class CSR extends AsnData {
|
|
|
64
64
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
65
65
|
try {
|
|
66
66
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
67
|
-
|
|
67
|
+
if (thumbprint) {
|
|
68
|
+
this.thumbprints[algorithm['name'] || algorithm] = Convert.ToHex(thumbprint);
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
catch (error) {
|
|
70
72
|
console.error('Error thumbprint get:', error);
|
|
@@ -30,5 +30,8 @@ export const certificateRawToBuffer = (raw) => {
|
|
|
30
30
|
};
|
|
31
31
|
export const getCertificateThumbprint = async (algorithm, data) => {
|
|
32
32
|
const crypto = cryptoProvider.get();
|
|
33
|
-
|
|
33
|
+
if (crypto.subtle) {
|
|
34
|
+
return crypto.subtle.digest(algorithm, data);
|
|
35
|
+
}
|
|
36
|
+
return undefined;
|
|
34
37
|
};
|
|
@@ -63,7 +63,9 @@ export class X509AttributeCertificate extends AsnData {
|
|
|
63
63
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
64
64
|
try {
|
|
65
65
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
66
|
-
|
|
66
|
+
if (thumbprint) {
|
|
67
|
+
this.thumbprints[algorithm['name'] || algorithm] = Convert.ToHex(thumbprint);
|
|
68
|
+
}
|
|
67
69
|
}
|
|
68
70
|
catch (error) {
|
|
69
71
|
console.error('Error thumbprint get:', error);
|
|
@@ -84,7 +84,9 @@ export class X509Certificate extends AsnData {
|
|
|
84
84
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
85
85
|
try {
|
|
86
86
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
87
|
-
|
|
87
|
+
if (thumbprint) {
|
|
88
|
+
this.thumbprints[algorithm['name'] || algorithm] = Convert.ToHex(thumbprint);
|
|
89
|
+
}
|
|
88
90
|
}
|
|
89
91
|
catch (error) {
|
|
90
92
|
console.error('Error thumbprint get:', error);
|
|
@@ -8708,6 +8708,7 @@ const OIDs = {
|
|
|
8708
8708
|
'2.16.840.1.114412.31.4.31.1': 'Digi Cert Grid Host Cert',
|
|
8709
8709
|
'2.16.840.1.114413.1.7.23.3': 'Go Daddy EV policy',
|
|
8710
8710
|
'2.16.840.1.114414.1.7.23.3': 'Starfield EV policy',
|
|
8711
|
+
'2.16.840.1.114569.1.1.3': 'SHAKEN/STIR Certificate Policy v1.3',
|
|
8711
8712
|
'2.23.42.0': 'Content Type',
|
|
8712
8713
|
'2.23.42.0.0': 'Pan Data',
|
|
8713
8714
|
'2.23.42.0.1': 'Pan Token',
|
|
@@ -10222,7 +10223,10 @@ const certificateRawToBuffer = (raw) => {
|
|
|
10222
10223
|
};
|
|
10223
10224
|
const getCertificateThumbprint = async (algorithm, data) => {
|
|
10224
10225
|
const crypto = cryptoProvider.get();
|
|
10225
|
-
|
|
10226
|
+
if (crypto.subtle) {
|
|
10227
|
+
return crypto.subtle.digest(algorithm, data);
|
|
10228
|
+
}
|
|
10229
|
+
return undefined;
|
|
10226
10230
|
};
|
|
10227
10231
|
|
|
10228
10232
|
/**
|
|
@@ -10298,7 +10302,9 @@ class X509Certificate extends AsnData {
|
|
|
10298
10302
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
10299
10303
|
try {
|
|
10300
10304
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
10301
|
-
|
|
10305
|
+
if (thumbprint) {
|
|
10306
|
+
this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
|
|
10307
|
+
}
|
|
10302
10308
|
}
|
|
10303
10309
|
catch (error) {
|
|
10304
10310
|
console.error('Error thumbprint get:', error);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { h, r as registerInstance, H as Host, c as createEvent } from './index-bbd484d9.js';
|
|
5
|
-
import { A as AsnData, a as Attribute$1, i as id_pkcs9_at_extensionRequest, b as AsnParser, E as ExtensionRequest, c as Extension, d as AsnConvert, e as id_pkcs9_at_unstructuredName, U as UnstructuredName, f as id_pkcs9_at_challengePassword, C as ChallengePassword, g as id_ValuationRanking, V as ValuationRanking, h as id_InsuranceValue, I as InsuranceValue, j as id_WebGDPR, W as WebGDPR, k as id_ActivityDescription, l as ActivityDescription, m as id_TypeRelationship, T as TypeRelationship, n as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, o as id_DomainNameOwner, p as DomainNameOwner, q as id_DomainNameLegalRepresentative, r as DomainNameLegalRepresentative, s as id_DomainNameBeneficiary, t as DomainNameBeneficiary, u as certificateRawToBuffer, v as AttributeCertificate, w as getCertificateThumbprint, x as hexFormat, y as base64Format, z as CertificationRequest, N as Name, B as id_ecPublicKey, F as ECParameters, G as id_rsaEncryption, R as RSAPublicKey, O as OIDs, H as Name$1, J as OtherName, K as DisplayText, L as UserNotice, M as EDIPartyName, P as AsnIntegerArrayBufferConverter, Q as KeyUsage, S as BasicConstraints, X as ExtendedKeyUsage, Y as SubjectKeyIdentifier, Z as AuthorityKeyIdentifier, _ as CRLDistributionPoints, $ as AuthorityInfoAccessSyntax, a0 as SubjectInfoAccessSyntax, a1 as SubjectAlternativeName, a2 as CertificatePolicies, a3 as CertificateTransparency, a4 as NameConstraints, a5 as CertificateTemplate, a6 as EnrollCertTypeChoice, a7 as CaVersion, a8 as QCStatements, a9 as NetscapeComment, aa as NetscapeCertType, ab as LeiRole, ac as LeiChoice, ad as Timestamp, ae as ArchiveRevInfo, af as CRLReason, ag as SubjectDirectoryAttributes, ah as PrivateKeyUsagePeriod, ai as EntrustVersionInfo, aj as BiometricSyntax, ak as LogotypeExtn, al as TNAuthorizationList, am as PolicyConstraints, an as PolicyMappings, ao as isPem, ap as isX509Pem, aq as isPkcs10Pem, ar as isX509AttributePem, as as X509Certificate } from './certification_request-
|
|
5
|
+
import { A as AsnData, a as Attribute$1, i as id_pkcs9_at_extensionRequest, b as AsnParser, E as ExtensionRequest, c as Extension, d as AsnConvert, e as id_pkcs9_at_unstructuredName, U as UnstructuredName, f as id_pkcs9_at_challengePassword, C as ChallengePassword, g as id_ValuationRanking, V as ValuationRanking, h as id_InsuranceValue, I as InsuranceValue, j as id_WebGDPR, W as WebGDPR, k as id_ActivityDescription, l as ActivityDescription, m as id_TypeRelationship, T as TypeRelationship, n as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, o as id_DomainNameOwner, p as DomainNameOwner, q as id_DomainNameLegalRepresentative, r as DomainNameLegalRepresentative, s as id_DomainNameBeneficiary, t as DomainNameBeneficiary, u as certificateRawToBuffer, v as AttributeCertificate, w as getCertificateThumbprint, x as hexFormat, y as base64Format, z as CertificationRequest, N as Name, B as id_ecPublicKey, F as ECParameters, G as id_rsaEncryption, R as RSAPublicKey, O as OIDs, H as Name$1, J as OtherName, K as DisplayText, L as UserNotice, M as EDIPartyName, P as AsnIntegerArrayBufferConverter, Q as KeyUsage, S as BasicConstraints, X as ExtendedKeyUsage, Y as SubjectKeyIdentifier, Z as AuthorityKeyIdentifier, _ as CRLDistributionPoints, $ as AuthorityInfoAccessSyntax, a0 as SubjectInfoAccessSyntax, a1 as SubjectAlternativeName, a2 as CertificatePolicies, a3 as CertificateTransparency, a4 as NameConstraints, a5 as CertificateTemplate, a6 as EnrollCertTypeChoice, a7 as CaVersion, a8 as QCStatements, a9 as NetscapeComment, aa as NetscapeCertType, ab as LeiRole, ac as LeiChoice, ad as Timestamp, ae as ArchiveRevInfo, af as CRLReason, ag as SubjectDirectoryAttributes, ah as PrivateKeyUsagePeriod, ai as EntrustVersionInfo, aj as BiometricSyntax, ak as LogotypeExtn, al as TNAuthorizationList, am as PolicyConstraints, an as PolicyMappings, ao as isPem, ap as isX509Pem, aq as isPkcs10Pem, ar as isX509AttributePem, as as X509Certificate } from './certification_request-3402a181.js';
|
|
6
6
|
import { b as build, D as Download } from './download-cf68ac2c.js';
|
|
7
7
|
import { d as dateDiff, l as l10n, a as dateShort, h as history } from './l10n-9ac63748.js';
|
|
8
8
|
import './_commonjsHelpers-bfbd2ad8.js';
|
|
@@ -153,7 +153,9 @@ class X509AttributeCertificate extends AsnData {
|
|
|
153
153
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
154
154
|
try {
|
|
155
155
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
156
|
-
|
|
156
|
+
if (thumbprint) {
|
|
157
|
+
this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
|
|
158
|
+
}
|
|
157
159
|
}
|
|
158
160
|
catch (error) {
|
|
159
161
|
console.error('Error thumbprint get:', error);
|
|
@@ -227,7 +229,9 @@ class CSR extends AsnData {
|
|
|
227
229
|
async getThumbprint(algorithm = 'SHA-1') {
|
|
228
230
|
try {
|
|
229
231
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
230
|
-
|
|
232
|
+
if (thumbprint) {
|
|
233
|
+
this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
|
|
234
|
+
}
|
|
231
235
|
}
|
|
232
236
|
catch (error) {
|
|
233
237
|
console.error('Error thumbprint get:', error);
|
|
@@ -1710,6 +1714,15 @@ const certificateDecoderCss = ":host{-webkit-box-sizing:border-box;box-sizing:bo
|
|
|
1710
1714
|
const CertificateDecoder = class {
|
|
1711
1715
|
constructor(hostRef) {
|
|
1712
1716
|
registerInstance(this, hostRef);
|
|
1717
|
+
this.fetchAndDecodeFile = async (url) => {
|
|
1718
|
+
try {
|
|
1719
|
+
const request = await fetch(url);
|
|
1720
|
+
this.decode(await request.text());
|
|
1721
|
+
}
|
|
1722
|
+
catch (error) {
|
|
1723
|
+
alert('Failed to load certificate. Please use another file or check CORS policy.');
|
|
1724
|
+
}
|
|
1725
|
+
};
|
|
1713
1726
|
this.onClickDecode = () => {
|
|
1714
1727
|
const { value } = this.inputPaste;
|
|
1715
1728
|
if (value) {
|
|
@@ -1752,6 +1765,9 @@ const CertificateDecoder = class {
|
|
|
1752
1765
|
*/
|
|
1753
1766
|
setTimeout(() => this.decode(parsedHash.cert), 100);
|
|
1754
1767
|
}
|
|
1768
|
+
else if (parsedHash.certurl) {
|
|
1769
|
+
this.fetchAndDecodeFile(parsedHash.certurl);
|
|
1770
|
+
}
|
|
1755
1771
|
}
|
|
1756
1772
|
clearValue() {
|
|
1757
1773
|
this.inputPaste.value = '';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-bbd484d9.js';
|
|
5
|
-
import { as as X509Certificate, O as OIDs } from './certification_request-
|
|
5
|
+
import { as as X509Certificate, O as OIDs } from './certification_request-3402a181.js';
|
|
6
6
|
import { D as Download } from './download-cf68ac2c.js';
|
|
7
7
|
import { l as l10n } from './l10n-9ac63748.js';
|
|
8
8
|
import './_commonjsHelpers-bfbd2ad8.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{h as e,r as t,H as a,c as i}from"./p-f7683ba5.js";import{A as n,a as o,i as r,b as s,E as l,c,d,e as b,U as p,f as h,C as u,g as f,V as g,h as m,I as v,j as x,W as y,k as w,l as k,m as _,T as C,n as z,D as A,o as S,p as I,q as N,r as L,s as D,t as j,u as E,v as T,w as K,x as P,y as O,z as G,N as $,B as R,F as V,G as H,R as q,O as B,H as F,J as U,K as Y,L as M,M as X,P as W,Q,S as J,X as Z,Y as ee,Z as te,_ as ae,$ as ie,a0 as ne,a1 as oe,a2 as re,a3 as se,a4 as le,a5 as ce,a6 as de,a7 as be,a8 as pe,a9 as he,aa as ue,ab as fe,ac as ge,ad as me,ae as ve,af as xe,ag as ye,ah as we,ai as ke,aj as _e,ak as Ce,al as ze,am as Ae,an as Se,ao as Ie,ap as Ne,aq as Le,ar as De,as as je}from"./p-
|
|
4
|
+
import{h as e,r as t,H as a,c as i}from"./p-f7683ba5.js";import{A as n,a as o,i as r,b as s,E as l,c,d,e as b,U as p,f as h,C as u,g as f,V as g,h as m,I as v,j as x,W as y,k as w,l as k,m as _,T as C,n as z,D as A,o as S,p as I,q as N,r as L,s as D,t as j,u as E,v as T,w as K,x as P,y as O,z as G,N as $,B as R,F as V,G as H,R as q,O as B,H as F,J as U,K as Y,L as M,M as X,P as W,Q,S as J,X as Z,Y as ee,Z as te,_ as ae,$ as ie,a0 as ne,a1 as oe,a2 as re,a3 as se,a4 as le,a5 as ce,a6 as de,a7 as be,a8 as pe,a9 as he,aa as ue,ab as fe,ac as ge,ad as me,ae as ve,af as xe,ag as ye,ah as we,ai as ke,aj as _e,ak as Ce,al as ze,am as Ae,an as Se,ao as Ie,ap as Ne,aq as Le,ar as De,as as je}from"./p-8ad24aa3.js";import{b as Ee,D as Te}from"./p-c774ec0b.js";import{d as Ke,l as Pe,a as Oe,h as Ge}from"./p-99797a49.js";import"./p-d0b55fbb.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -22,14 +22,14 @@ import{h as e,r as t,H as a,c as i}from"./p-f7683ba5.js";import{A as n,a as o,i
|
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the MIT license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/class Ve extends n{constructor(e){var t;super(E(e),T),this.thumbprints={},this.type="X.509 Attribute Certificate";const{acinfo:a}=this.asn;this.serialNumber=Ee.Convert.ToHex(a.serialNumber),this.version=a.version;const i=a.attrCertValidityPeriod.notBeforeTime;if(!i)throw new Error("Cannot get 'notBefore' value");this.notBefore=i;const n=a.attrCertValidityPeriod.notAfterTime;if(!n)throw new Error("Cannot get 'notAfter' value");this.notAfter=n,this.validity=Ke(this.notBefore,this.notAfter),this.issuer=a.issuer.v1Form||(null===(t=a.issuer.v2Form)||void 0===t?void 0:t.issuerName),this.holder=a.holder}get signature(){const{signatureValue:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}parseExtensions(){const{acinfo:e}=this.asn;e.extensions&&(this.extensions=e.extensions.map((e=>new c(d.serialize(e)))))}parseAttributes(){const{acinfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map((e=>new Re(d.serialize(e)))))}async getThumbprint(e="SHA-1"){try{const t=await K(e,this.raw);this.thumbprints[e.name||e]=Ee.Convert.ToHex(t)}catch(e){console.error("Error thumbprint get:",e)}}exportAsBase64(){return Ee.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return P(Ee.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN ATTRIBUTE CERTIFICATE-----\n${O(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}}
|
|
25
|
+
*/class Ve extends n{constructor(e){var t;super(E(e),T),this.thumbprints={},this.type="X.509 Attribute Certificate";const{acinfo:a}=this.asn;this.serialNumber=Ee.Convert.ToHex(a.serialNumber),this.version=a.version;const i=a.attrCertValidityPeriod.notBeforeTime;if(!i)throw new Error("Cannot get 'notBefore' value");this.notBefore=i;const n=a.attrCertValidityPeriod.notAfterTime;if(!n)throw new Error("Cannot get 'notAfter' value");this.notAfter=n,this.validity=Ke(this.notBefore,this.notAfter),this.issuer=a.issuer.v1Form||(null===(t=a.issuer.v2Form)||void 0===t?void 0:t.issuerName),this.holder=a.holder}get signature(){const{signatureValue:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}parseExtensions(){const{acinfo:e}=this.asn;e.extensions&&(this.extensions=e.extensions.map((e=>new c(d.serialize(e)))))}parseAttributes(){const{acinfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map((e=>new Re(d.serialize(e)))))}async getThumbprint(e="SHA-1"){try{const t=await K(e,this.raw);t&&(this.thumbprints[e.name||e]=Ee.Convert.ToHex(t))}catch(e){console.error("Error thumbprint get:",e)}}exportAsBase64(){return Ee.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return P(Ee.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN ATTRIBUTE CERTIFICATE-----\n${O(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}}
|
|
26
26
|
/**
|
|
27
27
|
* @license
|
|
28
28
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the MIT license found in the
|
|
31
31
|
* LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/class He extends n{constructor(e){super(E(e),G),this.thumbprints={},this.type="PKCS#10 Certificate Request";const{certificationRequestInfo:t}=this.asn;this.subject=new $(t.subject).toJSON(),this.version=t.version}get publicKey(){const{subjectPublicKey:e,algorithm:t}=this.asn.certificationRequestInfo.subjectPKInfo;let a;return t.algorithm===R&&t.parameters&&(a=d.parse(t.parameters,V)),t.algorithm===H&&(a=d.parse(e,q)),{params:a,value:d.serialize(this.asn.certificationRequestInfo.subjectPKInfo),algorithm:t.algorithm}}get signature(){const{signature:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}get commonName(){if(!this.subject)return"";for(let e=0;e<this.subject.length;e+=1){const t=this.subject[e];if("CN"===t.shortName||"E"===t.shortName||"O"===t.shortName)return t.value}return""}async getThumbprint(e="SHA-1"){try{const t=await K(e,this.raw);this.thumbprints[e.name||e]=Ee.Convert.ToHex(t)}catch(e){console.error("Error thumbprint get:",e)}}parseAttributes(){const{certificationRequestInfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map((e=>new Re(d.serialize(e)))))}exportAsBase64(){return Ee.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return P(Ee.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE REQUEST-----\n${O(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`}}
|
|
32
|
+
*/class He extends n{constructor(e){super(E(e),G),this.thumbprints={},this.type="PKCS#10 Certificate Request";const{certificationRequestInfo:t}=this.asn;this.subject=new $(t.subject).toJSON(),this.version=t.version}get publicKey(){const{subjectPublicKey:e,algorithm:t}=this.asn.certificationRequestInfo.subjectPKInfo;let a;return t.algorithm===R&&t.parameters&&(a=d.parse(t.parameters,V)),t.algorithm===H&&(a=d.parse(e,q)),{params:a,value:d.serialize(this.asn.certificationRequestInfo.subjectPKInfo),algorithm:t.algorithm}}get signature(){const{signature:e,signatureAlgorithm:t}=this.asn;return{value:e,algorithm:t.algorithm}}get commonName(){if(!this.subject)return"";for(let e=0;e<this.subject.length;e+=1){const t=this.subject[e];if("CN"===t.shortName||"E"===t.shortName||"O"===t.shortName)return t.value}return""}async getThumbprint(e="SHA-1"){try{const t=await K(e,this.raw);t&&(this.thumbprints[e.name||e]=Ee.Convert.ToHex(t))}catch(e){console.error("Error thumbprint get:",e)}}parseAttributes(){const{certificationRequestInfo:e}=this.asn;e.attributes&&(this.attributes=e.attributes.map((e=>new Re(d.serialize(e)))))}exportAsBase64(){return Ee.Convert.ToBase64(this.raw)}exportAsHexFormatted(){return P(Ee.Convert.ToHex(this.raw))}exportAsPemFormatted(){return`-----BEGIN CERTIFICATE REQUEST-----\n${O(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`}}
|
|
33
33
|
/**
|
|
34
34
|
* @license
|
|
35
35
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -95,7 +95,7 @@ function Ft(e){e instanceof He?Te.pkcs10.asPEM(e.exportAsPemFormatted(),e.common
|
|
|
95
95
|
*
|
|
96
96
|
* This source code is licensed under the MIT license found in the
|
|
97
97
|
* LICENSE file in the root directory of this source tree.
|
|
98
|
-
*/Zt.style=":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}";const ea=class{constructor(e){t(this,e),this.fill="stroke",this.handleClick=e=>{if(this.disabled)return e.preventDefault(),void e.stopPropagation();this.onClick&&this.onClick(e)}}render(){const t=!!this.href;return e(t?"a":"button",{class:{button:!0,button_stroke:"stroke"===this.fill,button_fill:"fill"===this.fill,button_disabled:this.disabled},disabled:this.disabled,type:!t&&"button",href:t&&this.href,target:t&&this.target?this.target:null,rel:t&&"noreferrer noopener",onClick:this.handleClick,part:"base"},e("span",{part:"label",class:"button_label"},e("slot",null)))}};ea.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer;position:relative;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;--pv-button-padding-end:5px;--pv-button-padding-start:5px}.button{font-family:"Open Sans", "Arial", sans-serif;font-family:var(--pv-font-family);font-size:13px;font-size:var(--pv-font-size-b3);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;border-style:solid;border-width:1px;font-weight:400;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:middle;cursor:inherit;height:30px;line-height:30px;border-radius:2px;padding:0 5px;padding:0 var(--pv-button-padding-end) 0 var(--pv-button-padding-start)}.button::-moz-focus-inner{border:0}.button:focus{outline:none;-webkit-box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1);box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1)}.button[disabled]{opacity:0.5;cursor:not-allowed}.button_stroke{border-color:rgba(53, 132, 247, 0.3);border-color:rgba(var(--pv-color-primary-rgb), 0.3);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);background-color:transparent}.button_fill{border-color:#3584f7;border-color:rgba(var(--pv-color-primary-rgb), 1);background-color:#3584f7;background-color:rgba(var(--pv-color-primary-rgb), 1);color:white;color:rgba(var(--pv-color-light-rgb), 1)}.button_label{-webkit-transition:opacity 200ms;transition:opacity 200ms}.button:hover .button_label{opacity:0.7}';const ta=class{constructor(e){t(this,e),this.fill="stroke",this.actions=[],this.open=!1,this.onClickSplitButton=e=>{e.stopPropagation(),this.open=!this.open}}onClickActiveButton(e,t){this.open=!1,e(t)}renderActiveSplitState(){return this.open?e("div",{class:"button_split_container"},this.actions.map((t=>e("peculiar-button",{fill:"fill",class:"button_split_action",onClick:this.onClickActiveButton.bind(this,t.onClick)},t.text)))):null}render(){return e("div",{class:{button_split:!0}},e("peculiar-button",{fill:this.fill,onClick:this.onClick},e("slot",null)),e("peculiar-button",{fill:this.fill,onClick:this.onClickSplitButton,class:{button_split_with_icon:!0,m_open:this.open}},e("svg",{viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",class:"button_split_icon"},e("path",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z"}))),this.renderActiveSplitState())}};ta.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;vertical-align:top;position:relative;white-space:nowrap;font-size:0}.button_split_icon{width:7px;height:5px;display:inline-block;vertical-align:middle}.button_split_with_icon{width:25px;border-bottom-left-radius:0;border-top-left-radius:0}.button_split_with_icon.m_open::part(base):before{position:fixed;width:100%;height:100%;top:0;left:0;content:""}.button_split_action{width:100%}.button_split_container{position:absolute;bottom:calc(100% + 1px);left:0;width:100%;border-radius:2px;-webkit-box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);z-index:1}.button_split>peculiar-button:first-of-type::part(base){border-top-right-radius:0;border-bottom-right-radius:0}.button_split>peculiar-button:last-of-type::part(base){border-top-left-radius:0;border-bottom-left-radius:0}.button_split>peculiar-button:not(:first-child){margin-left:-1px}';const aa=class{constructor(e){t(this,e),this.onClickDecode=()=>{const{value:e}=this.inputPaste;e&&this.decode(e)},this.onClickExample=()=>{this.decode(this.certificateExample)},this.onClickClear=()=>{this.clearValue()},this.onChangeInputFile=async e=>{const t=e.target;if(t.files){const e=await $e(t.files[0]);"string"==typeof e.value&&this.decode(e.value),t.value=""}},this.onDropFile=async e=>{e.stopPropagation(),e.preventDefault();const t=e.dataTransfer;if(t.files){const e=await $e(t.files[0]);"string"==typeof e.value&&this.decode(e.value)}}}componentDidLoad(){const e=Ge.parseHash(window.location.search);e.cert
|
|
98
|
+
*/Zt.style=":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}";const ea=class{constructor(e){t(this,e),this.fill="stroke",this.handleClick=e=>{if(this.disabled)return e.preventDefault(),void e.stopPropagation();this.onClick&&this.onClick(e)}}render(){const t=!!this.href;return e(t?"a":"button",{class:{button:!0,button_stroke:"stroke"===this.fill,button_fill:"fill"===this.fill,button_disabled:this.disabled},disabled:this.disabled,type:!t&&"button",href:t&&this.href,target:t&&this.target?this.target:null,rel:t&&"noreferrer noopener",onClick:this.handleClick,part:"base"},e("span",{part:"label",class:"button_label"},e("slot",null)))}};ea.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer;position:relative;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;--pv-button-padding-end:5px;--pv-button-padding-start:5px}.button{font-family:"Open Sans", "Arial", sans-serif;font-family:var(--pv-font-family);font-size:13px;font-size:var(--pv-font-size-b3);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;border-style:solid;border-width:1px;font-weight:400;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:middle;cursor:inherit;height:30px;line-height:30px;border-radius:2px;padding:0 5px;padding:0 var(--pv-button-padding-end) 0 var(--pv-button-padding-start)}.button::-moz-focus-inner{border:0}.button:focus{outline:none;-webkit-box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1);box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1)}.button[disabled]{opacity:0.5;cursor:not-allowed}.button_stroke{border-color:rgba(53, 132, 247, 0.3);border-color:rgba(var(--pv-color-primary-rgb), 0.3);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);background-color:transparent}.button_fill{border-color:#3584f7;border-color:rgba(var(--pv-color-primary-rgb), 1);background-color:#3584f7;background-color:rgba(var(--pv-color-primary-rgb), 1);color:white;color:rgba(var(--pv-color-light-rgb), 1)}.button_label{-webkit-transition:opacity 200ms;transition:opacity 200ms}.button:hover .button_label{opacity:0.7}';const ta=class{constructor(e){t(this,e),this.fill="stroke",this.actions=[],this.open=!1,this.onClickSplitButton=e=>{e.stopPropagation(),this.open=!this.open}}onClickActiveButton(e,t){this.open=!1,e(t)}renderActiveSplitState(){return this.open?e("div",{class:"button_split_container"},this.actions.map((t=>e("peculiar-button",{fill:"fill",class:"button_split_action",onClick:this.onClickActiveButton.bind(this,t.onClick)},t.text)))):null}render(){return e("div",{class:{button_split:!0}},e("peculiar-button",{fill:this.fill,onClick:this.onClick},e("slot",null)),e("peculiar-button",{fill:this.fill,onClick:this.onClickSplitButton,class:{button_split_with_icon:!0,m_open:this.open}},e("svg",{viewBox:"0 0 7 5",xmlns:"http://www.w3.org/2000/svg",class:"button_split_icon"},e("path",{fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z"}))),this.renderActiveSplitState())}};ta.style=':host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;vertical-align:top;position:relative;white-space:nowrap;font-size:0}.button_split_icon{width:7px;height:5px;display:inline-block;vertical-align:middle}.button_split_with_icon{width:25px;border-bottom-left-radius:0;border-top-left-radius:0}.button_split_with_icon.m_open::part(base):before{position:fixed;width:100%;height:100%;top:0;left:0;content:""}.button_split_action{width:100%}.button_split_container{position:absolute;bottom:calc(100% + 1px);left:0;width:100%;border-radius:2px;-webkit-box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);z-index:1}.button_split>peculiar-button:first-of-type::part(base){border-top-right-radius:0;border-bottom-right-radius:0}.button_split>peculiar-button:last-of-type::part(base){border-top-left-radius:0;border-bottom-left-radius:0}.button_split>peculiar-button:not(:first-child){margin-left:-1px}';const aa=class{constructor(e){t(this,e),this.fetchAndDecodeFile=async e=>{try{const t=await fetch(e);this.decode(await t.text())}catch(e){alert("Failed to load certificate. Please use another file or check CORS policy.")}},this.onClickDecode=()=>{const{value:e}=this.inputPaste;e&&this.decode(e)},this.onClickExample=()=>{this.decode(this.certificateExample)},this.onClickClear=()=>{this.clearValue()},this.onChangeInputFile=async e=>{const t=e.target;if(t.files){const e=await $e(t.files[0]);"string"==typeof e.value&&this.decode(e.value),t.value=""}},this.onDropFile=async e=>{e.stopPropagation(),e.preventDefault();const t=e.dataTransfer;if(t.files){const e=await $e(t.files[0]);"string"==typeof e.value&&this.decode(e.value)}}}componentDidLoad(){const e=Ge.parseHash(window.location.search);e.cert?setTimeout((()=>this.decode(e.cert)),100):e.certurl&&this.fetchAndDecodeFile(e.certurl)}clearValue(){this.inputPaste.value="",this.certificateDecoded=null,Ge.replace({search:""})}setValue(e){this.certificateDecoded=e,this.inputPaste.value=e.exportAsPemFormatted(),Ge.replace({search:Ge.queryStringify({cert:e.exportAsBase64()})})}decode(e){const t=Ie(e),a=Ne(e),i=Le(e),n=De(e);let o,r;if(t&&!(a||n||i))return this.clearValue(),void alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.");try{a&&(o=new je(e)),n&&(o=new Ve(e)),i&&(o=new He(e))}catch(e){r=e}if(!o)try{o=new je(e)}catch(e){r=e}if(!o)try{o=new Ve(e)}catch(e){r=e}if(!o)try{o=new He(e)}catch(e){r=e}o?this.setValue(o):(this.clearValue(),console.log(r),alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest."))}render(){return e(a,null,e("textarea",{placeholder:"Certificate DER or PEM",class:"textarea",ref:e=>{this.inputPaste=e},onDrop:this.onDropFile}),e("div",{class:"controls"},e("peculiar-button",{fill:"fill",class:"button",onClick:this.onClickDecode},"Decode"),e("peculiar-button",{class:"button"},"Choose file",e("input",{type:"file",class:"input_file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,.csr,.req",onChange:this.onChangeInputFile,value:""})),e("peculiar-button",{class:"button",onClick:this.onClickClear},"Clear"),this.certificateExample&&e("peculiar-button",{class:"button",onClick:this.onClickExample},"Example")),this.certificateDecoded instanceof je&&e("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof Ve&&e("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}),this.certificateDecoded instanceof He&&e("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:!0}))}};
|
|
99
99
|
/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{r as t,c as r,h as e,H as o}from"./p-f7683ba5.js";import{as as a,O as i}from"./p-d676d064.js";import{D as l}from"./p-c774ec0b.js";import{l as s}from"./p-99797a49.js";import"./p-d0b55fbb.js";const c=class{constructor(e){t(this,e),this.detailsOpen=r(this,"detailsOpen",7),this.detailsClose=r(this,"detailsClose",7),this.certificates=[],this.filterWithSearch=!0,this.highlightWithSearch=!0,this.search="",this.certificatesDecoded=[],this.isDecodeInProcess=!0,this.isHasTests=!1,this.isHasRoots=!1,this.handleClickDetails=(t,r)=>{r.stopPropagation(),this.certificateSelectedForDetails=t,this.detailsOpen.emit(t)},this.handleModalClose=()=>{this.certificateSelectedForDetails=void 0,this.detailsClose.emit()},this.handleSearch=t=>{this.search=t.target.value.trim()}}componentWillLoad(){this.certificatesDecodeAndSet()}watchCertificates(t,r){JSON.stringify(t)!==JSON.stringify(r)&&this.certificatesDecodeAndSet()}async certificatesDecodeAndSet(){let t=!1,r=!1;if(!Array.isArray(this.certificates))return;const e=[];for(const o of this.certificates)try{const i=new a(o.value);await i.getThumbprint("SHA-1"),e.push({body:i,tests:o.tests,name:o.name}),!r&&i.isRoot&&(r=!0),t||o.tests&&(o.tests.expired||o.tests.revoked||o.tests.valid)&&(t=!0)}catch(t){console.error("Error certificate parse:",t)}this.isHasTests=t,this.isHasRoots=r,this.isDecodeInProcess=!1,this.certificatesDecoded=e}handleClickDownloadAsPem(t,r){r.stopPropagation(),l.x509.asPEM(t.body.exportAsPemFormatted(),t.name||t.body.commonName)}handleClickDownloadAsDer(t,r){r.stopPropagation(),l.x509.asPEM(t.body.exportAsHexFormatted(),t.name||t.body.commonName)}handleClickRow(t){this.expandedRow=this.expandedRow===t?void 0:t}getMaxColSpanValue(){let t=4;return this.isHasTests&&(t+=1),this.isHasRoots||(t+=1),t}renderExpandedRow(t){const r=this.getMaxColSpanValue();return e("tr",{class:"expanded_summary"},e("td",{colSpan:r},e("peculiar-certificate-summary",{certificate:t,showIssuer:!t.isRoot})))}renderCertificateTests(t){if(!t)return null;const r=[];return t.valid&&r.push(e("peculiar-button",{class:"button_table_action",href:t.valid,target:"_blank"},s.getString("valid"))),t.revoked&&r.push(e("peculiar-button",{class:"button_table_action",href:t.revoked,target:"_blank"},s.getString("revoked"))),t.expired&&r.push(e("peculiar-button",{class:"button_table_action",href:t.expired,target:"_blank"},s.getString("expired"))),r}renderContentState(){const t=this.highlightWithSearch?this.search:"",r=[];return this.certificatesDecoded.forEach(((o,a)=>{const l=a===this.expandedRow,c=i[o.body.signature.algorithm]||o.body.signature.algorithm;this.filterWithSearch&&this.search&&-1===[c,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase().indexOf(this.search.toLowerCase())||r.push([e("tr",{class:{expanded:l},onClick:this.handleClickRow.bind(this,a),key:o.body.thumbprints["SHA-1"]},!this.isHasRoots&&e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("issuer"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.body.issuerCommonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("name"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.name||o.body.commonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("publicKey"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},c))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("fingerprint")," (SHA-1):"),e("peculiar-typography",{class:"content",monospace:!0},e("peculiar-highlight-words",{search:t},o.body.thumbprints["SHA-1"]))),e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("actions"),":"),e("span",{class:"content"},e("peculiar-button",{onClick:this.handleClickDetails.bind(this,o.body),class:"button_table_action"},s.getString("details")),e("peculiar-button-split",{onClick:this.handleClickDownloadAsPem.bind(this,o),actions:[{text:s.getString("download.der"),onClick:this.handleClickDownloadAsDer.bind(this,o)}],class:"button_table_action"},s.getString("download.pem")))),this.isHasTests&&e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("testURLs"),":"),e("span",{class:"content"},this.renderCertificateTests(o.tests)))),l&&this.renderExpandedRow(o.body)])})),r}renderCertificateDetailsModal(){return this.certificateSelectedForDetails?e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_title"},e("peculiar-typography",{type:"h4"},s.getString("certificateDetails")),e("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails})))):null}renderSearch(){return this.filterWithSearch||this.highlightWithSearch?e("div",{class:"search_section"},e("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"})):null}renderEmptyState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))}renderEmptySearchState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))}renderLoadingState(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))}renderBody(){if(this.isDecodeInProcess)return null;if(!this.certificatesDecoded.length)return this.renderEmptyState();const t=this.renderContentState();return this.search&&!t.length?this.renderEmptySearchState():t}render(){return e(o,null,this.renderSearch(),e("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},e("thead",null,e("tr",null,!this.isHasRoots&&e("th",{class:"col_issuer"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("issuer"))),e("th",{class:"col_name"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("name"))),e("th",{class:"col_public_key"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("publicKey"))),e("th",{class:"col_fingerprint"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("fingerprint")," (SHA-1)")),e("th",{class:"col_actions"},e("peculiar-typography",{type:"h7",align:"center"},s.getString("actions"))),this.isHasTests&&e("th",{class:"col_tests"},e("peculiar-typography",{type:"h7",align:"center"},s.getString("testURLs"))))),e("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())}static get watchers(){return{certificates:["watchCertificates"]}}};c.style=':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}}';export{c as peculiar_certificates_viewer}
|
|
4
|
+
import{r as t,c as r,h as e,H as o}from"./p-f7683ba5.js";import{as as a,O as i}from"./p-8ad24aa3.js";import{D as l}from"./p-c774ec0b.js";import{l as s}from"./p-99797a49.js";import"./p-d0b55fbb.js";const c=class{constructor(e){t(this,e),this.detailsOpen=r(this,"detailsOpen",7),this.detailsClose=r(this,"detailsClose",7),this.certificates=[],this.filterWithSearch=!0,this.highlightWithSearch=!0,this.search="",this.certificatesDecoded=[],this.isDecodeInProcess=!0,this.isHasTests=!1,this.isHasRoots=!1,this.handleClickDetails=(t,r)=>{r.stopPropagation(),this.certificateSelectedForDetails=t,this.detailsOpen.emit(t)},this.handleModalClose=()=>{this.certificateSelectedForDetails=void 0,this.detailsClose.emit()},this.handleSearch=t=>{this.search=t.target.value.trim()}}componentWillLoad(){this.certificatesDecodeAndSet()}watchCertificates(t,r){JSON.stringify(t)!==JSON.stringify(r)&&this.certificatesDecodeAndSet()}async certificatesDecodeAndSet(){let t=!1,r=!1;if(!Array.isArray(this.certificates))return;const e=[];for(const o of this.certificates)try{const i=new a(o.value);await i.getThumbprint("SHA-1"),e.push({body:i,tests:o.tests,name:o.name}),!r&&i.isRoot&&(r=!0),t||o.tests&&(o.tests.expired||o.tests.revoked||o.tests.valid)&&(t=!0)}catch(t){console.error("Error certificate parse:",t)}this.isHasTests=t,this.isHasRoots=r,this.isDecodeInProcess=!1,this.certificatesDecoded=e}handleClickDownloadAsPem(t,r){r.stopPropagation(),l.x509.asPEM(t.body.exportAsPemFormatted(),t.name||t.body.commonName)}handleClickDownloadAsDer(t,r){r.stopPropagation(),l.x509.asPEM(t.body.exportAsHexFormatted(),t.name||t.body.commonName)}handleClickRow(t){this.expandedRow=this.expandedRow===t?void 0:t}getMaxColSpanValue(){let t=4;return this.isHasTests&&(t+=1),this.isHasRoots||(t+=1),t}renderExpandedRow(t){const r=this.getMaxColSpanValue();return e("tr",{class:"expanded_summary"},e("td",{colSpan:r},e("peculiar-certificate-summary",{certificate:t,showIssuer:!t.isRoot})))}renderCertificateTests(t){if(!t)return null;const r=[];return t.valid&&r.push(e("peculiar-button",{class:"button_table_action",href:t.valid,target:"_blank"},s.getString("valid"))),t.revoked&&r.push(e("peculiar-button",{class:"button_table_action",href:t.revoked,target:"_blank"},s.getString("revoked"))),t.expired&&r.push(e("peculiar-button",{class:"button_table_action",href:t.expired,target:"_blank"},s.getString("expired"))),r}renderContentState(){const t=this.highlightWithSearch?this.search:"",r=[];return this.certificatesDecoded.forEach(((o,a)=>{const l=a===this.expandedRow,c=i[o.body.signature.algorithm]||o.body.signature.algorithm;this.filterWithSearch&&this.search&&-1===[c,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase().indexOf(this.search.toLowerCase())||r.push([e("tr",{class:{expanded:l},onClick:this.handleClickRow.bind(this,a),key:o.body.thumbprints["SHA-1"]},!this.isHasRoots&&e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("issuer"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.body.issuerCommonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("name"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},o.name||o.body.commonName))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("publicKey"),":"),e("peculiar-typography",{class:"content"},e("peculiar-highlight-words",{search:t},c))),e("td",null,e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("fingerprint")," (SHA-1):"),e("peculiar-typography",{class:"content",monospace:!0},e("peculiar-highlight-words",{search:t},o.body.thumbprints["SHA-1"]))),e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("actions"),":"),e("span",{class:"content"},e("peculiar-button",{onClick:this.handleClickDetails.bind(this,o.body),class:"button_table_action"},s.getString("details")),e("peculiar-button-split",{onClick:this.handleClickDownloadAsPem.bind(this,o),actions:[{text:s.getString("download.der"),onClick:this.handleClickDownloadAsDer.bind(this,o)}],class:"button_table_action"},s.getString("download.pem")))),this.isHasTests&&e("td",{class:"align_center"},e("peculiar-typography",{class:"mobile_title",color:"grey_5"},s.getString("testURLs"),":"),e("span",{class:"content"},this.renderCertificateTests(o.tests)))),l&&this.renderExpandedRow(o.body)])})),r}renderCertificateDetailsModal(){return this.certificateSelectedForDetails?e("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},e("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),e("div",{class:"modal_container",role:"dialog",part:"presentation_container"},e("header",{class:"modal_title"},e("peculiar-typography",{type:"h4"},s.getString("certificateDetails")),e("button",{class:"modal_close",onClick:this.handleModalClose,type:"button","aria-label":"Close",title:"Close"},e("svg",{width:"30",height:"30",viewBox:"0 0 30 30",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.7204 14.375L21.0654 19.7185C21.3115 19.9658 21.3115 20.3693 21.0654 20.6154L20.615 21.0645C20.3689 21.3118 19.9667 21.3118 19.7181 21.0645L14.3744 15.721L9.03194 21.0645C8.78327 21.3118 8.3811 21.3118 8.13371 21.0645L7.68459 20.6154C7.43847 20.3693 7.43847 19.9658 7.68459 19.7185L13.0296 14.375L7.68459 9.03155C7.43847 8.78417 7.43847 8.38074 7.68459 8.13463L8.13371 7.68554C8.3811 7.43815 8.78327 7.43815 9.03194 7.68554L14.3744 13.029L19.7181 7.68554C19.9667 7.43815 20.3689 7.43815 20.615 7.68554L21.0654 8.13463C21.3115 8.38074 21.3115 8.78417 21.0654 9.03155L15.7204 14.375Z"})))),e("div",{class:"modal_content"},e("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails})))):null}renderSearch(){return this.filterWithSearch||this.highlightWithSearch?e("div",{class:"search_section"},e("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search",disabled:!this.certificatesDecoded.length,placeholder:"Search"})):null}renderEmptyState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"There are no certificates available.")))}renderEmptySearchState(){const t=this.getMaxColSpanValue();return e("tr",null,e("td",{class:"status_wrapper",colSpan:t},e("peculiar-typography",{type:"b1",align:"center"},"No results found for “",this.search,"“")))}renderLoadingState(){return e("div",{class:"loading_container"},e("peculiar-circular-progress",null))}renderBody(){if(this.isDecodeInProcess)return null;if(!this.certificatesDecoded.length)return this.renderEmptyState();const t=this.renderContentState();return this.search&&!t.length?this.renderEmptySearchState():t}render(){return e(o,null,this.renderSearch(),e("table",{class:{m_extra:this.isHasTests||!this.isHasRoots}},e("thead",null,e("tr",null,!this.isHasRoots&&e("th",{class:"col_issuer"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("issuer"))),e("th",{class:"col_name"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("name"))),e("th",{class:"col_public_key"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("publicKey"))),e("th",{class:"col_fingerprint"},e("peculiar-typography",{type:"h7",align:"left"},s.getString("fingerprint")," (SHA-1)")),e("th",{class:"col_actions"},e("peculiar-typography",{type:"h7",align:"center"},s.getString("actions"))),this.isHasTests&&e("th",{class:"col_tests"},e("peculiar-typography",{type:"h7",align:"center"},s.getString("testURLs"))))),e("tbody",null,this.renderBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())}static get watchers(){return{certificates:["watchCertificates"]}}};c.style=':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}}';export{c as peculiar_certificates_viewer}
|