@peculiar/certificates-viewer 4.7.1-alpha.1 → 4.7.1-alpha.5
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/components/attribute-certificate-viewer.js +2 -2
- package/components/attribute.js +1 -1
- package/components/certificate-chain-viewer.js +1 -1
- package/components/certificate-viewer.js +2 -2
- package/components/crl-viewer.js +2 -2
- package/components/csr-viewer.js +1 -1
- package/components/download.js +14323 -17
- package/components/download.js.map +1 -1
- package/components/index.js +1 -2
- package/components/index.js.map +1 -1
- package/components/index2.js +1 -1
- package/components/issuer_name.js +1 -1
- package/components/miscellaneous.js +1 -2
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +2 -2
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +1 -2
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/pkcs10_certificate_request.js +2 -2
- package/components/row.js +1 -1
- package/components/ssh-certificate-viewer.js +23 -6
- package/components/ssh-certificate-viewer.js.map +1 -1
- package/components/subject_name.js +1 -1
- package/components/utils.js +39 -0
- package/components/utils.js.map +1 -0
- package/dist/cjs/{extension-D8YKlAu4.js → extension-CjXYQXbF.js} +3 -3
- package/dist/cjs/{extension-D8YKlAu4.js.map → extension-CjXYQXbF.js.map} +1 -1
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{miscellaneous-DvVSM5KJ.js → miscellaneous-7gtHz795.js} +4 -4
- package/dist/cjs/{miscellaneous-DvVSM5KJ.js.map → miscellaneous-7gtHz795.js.map} +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js +27 -10
- package/dist/cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +6 -6
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
- package/dist/cjs/{pkcs10_certificate_request-BoHhadiA.js → pkcs10_certificate_request-CIOxDu_Z.js} +3 -3
- package/dist/cjs/{pkcs10_certificate_request-BoHhadiA.js.map → pkcs10_certificate_request-CIOxDu_Z.js.map} +1 -1
- package/dist/cjs/{ssh_certificate-s3-rwdMT.js → ssh_certificate-DnXj2sM0.js} +13 -2
- package/dist/cjs/ssh_certificate-DnXj2sM0.js.map +1 -0
- package/dist/cjs/{x509_certificate-DfXuxxZp.js → x509_certificate-DPgu-mwG.js} +4 -4
- package/dist/cjs/{x509_certificate-DfXuxxZp.js.map → x509_certificate-DPgu-mwG.js.map} +1 -1
- package/dist/cjs/{x509_crl-CxJ2lyGX.js → x509_crl-D_DKkGcn.js} +5 -5
- package/dist/cjs/{x509_crl-CxJ2lyGX.js.map → x509_crl-D_DKkGcn.js.map} +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +1 -1
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js +3 -3
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js.map +1 -1
- package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js +23 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/miscellaneous.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +2 -1
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js.map +1 -1
- package/dist/collection/crypto/ssh_certificate.js +7 -1
- package/dist/collection/crypto/ssh_certificate.js.map +1 -1
- package/dist/collection/utils/download.js +5 -0
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/esm/{extension-oK2qpCU6.js → extension-B3br1_Py.js} +3 -3
- package/dist/esm/{extension-oK2qpCU6.js.map → extension-B3br1_Py.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/{miscellaneous-DrmTXljc.js → miscellaneous-phHcBJWR.js} +4 -4
- package/dist/esm/{miscellaneous-DrmTXljc.js.map → miscellaneous-phHcBJWR.js.map} +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js +28 -11
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +6 -6
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
- package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
- package/dist/esm/{pkcs10_certificate_request-Bdt_qA_g.js → pkcs10_certificate_request-HIoLPXGQ.js} +3 -3
- package/dist/esm/{pkcs10_certificate_request-Bdt_qA_g.js.map → pkcs10_certificate_request-HIoLPXGQ.js.map} +1 -1
- package/dist/esm/{ssh_certificate-Ct-r021h.js → ssh_certificate-rmToyzuK.js} +13 -2
- package/dist/esm/ssh_certificate-rmToyzuK.js.map +1 -0
- package/dist/esm/{x509_certificate-5DEbrOA7.js → x509_certificate-C1VvfHQ5.js} +4 -4
- package/dist/{esm-es5/x509_certificate-5DEbrOA7.js.map → esm/x509_certificate-C1VvfHQ5.js.map} +1 -1
- package/dist/esm/{x509_crl-CPgNUkh7.js → x509_crl-rfnWQkGD.js} +5 -5
- package/dist/esm/{x509_crl-CPgNUkh7.js.map → x509_crl-rfnWQkGD.js.map} +1 -1
- package/dist/esm-es5/{extension-oK2qpCU6.js → extension-B3br1_Py.js} +2 -2
- package/dist/esm-es5/{extension-oK2qpCU6.js.map → extension-B3br1_Py.js.map} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{miscellaneous-DrmTXljc.js → miscellaneous-phHcBJWR.js} +2 -2
- package/dist/esm-es5/{miscellaneous-DrmTXljc.js.map → miscellaneous-phHcBJWR.js.map} +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js +10 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-Bdt_qA_g.js → pkcs10_certificate_request-HIoLPXGQ.js} +2 -2
- package/dist/esm-es5/{pkcs10_certificate_request-Bdt_qA_g.js.map → pkcs10_certificate_request-HIoLPXGQ.js.map} +1 -1
- package/dist/esm-es5/{ssh_certificate-Ct-r021h.js → ssh_certificate-rmToyzuK.js} +3 -3
- package/dist/esm-es5/ssh_certificate-rmToyzuK.js.map +1 -0
- package/dist/esm-es5/{x509_certificate-5DEbrOA7.js → x509_certificate-C1VvfHQ5.js} +2 -2
- package/dist/{esm/x509_certificate-5DEbrOA7.js.map → esm-es5/x509_certificate-C1VvfHQ5.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-CPgNUkh7.js → x509_crl-rfnWQkGD.js} +2 -2
- package/dist/esm-es5/{x509_crl-CPgNUkh7.js.map → x509_crl-rfnWQkGD.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-83a53b4f.entry.js → p-019339d6.entry.js} +2 -2
- package/dist/peculiar/{p-0b895a8e.entry.js → p-04422929.entry.js} +2 -2
- package/dist/peculiar/{p-da9eb1e7.entry.js → p-154dd0da.entry.js} +2 -2
- package/dist/peculiar/{p-da9eb1e7.entry.js.map → p-154dd0da.entry.js.map} +1 -1
- package/dist/peculiar/{p-11434880.system.entry.js → p-3685975d.system.entry.js} +2 -2
- package/dist/peculiar/{p-fd98bb82.system.entry.js → p-6f0f2749.system.entry.js} +3 -3
- package/dist/peculiar/{p-fd98bb82.system.entry.js.map → p-6f0f2749.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-62b723f6.entry.js → p-7385d0bb.entry.js} +29 -22
- package/dist/peculiar/p-7385d0bb.entry.js.map +1 -0
- package/dist/peculiar/{p-5df0f22b.system.entry.js → p-872f7312.system.entry.js} +29 -22
- package/dist/peculiar/p-872f7312.system.entry.js.map +1 -0
- package/dist/peculiar/{p-DOpiv0-8.js → p-B1eGYq5U.js} +3 -3
- package/dist/peculiar/{p-DOpiv0-8.js.map → p-B1eGYq5U.js.map} +1 -1
- package/dist/peculiar/{p-C31rbtuG.system.js → p-B2GW-g6v.system.js} +2 -2
- package/dist/peculiar/p-B2GW-g6v.system.js.map +1 -0
- package/dist/peculiar/{p-B2G7qjfV.js → p-B8_0p5ke.js} +40 -40
- package/dist/peculiar/{p-B2G7qjfV.js.map → p-B8_0p5ke.js.map} +1 -1
- package/dist/peculiar/p-BGASC3UX.system.js +1 -1
- package/dist/peculiar/{p-BCsPspKr.system.js.map → p-BdfvItQB.system.js.map} +1 -1
- package/dist/peculiar/p-BtqN4pgo.js +12 -0
- package/dist/peculiar/{p-BGIWeG8l.js.map → p-BtqN4pgo.js.map} +1 -1
- package/dist/peculiar/{p-2GQYAR0v.system.js → p-CTksa0ml.system.js} +2 -2
- package/dist/peculiar/{p-2GQYAR0v.system.js.map → p-CTksa0ml.system.js.map} +1 -1
- package/dist/peculiar/{p-RWPI76Dh.js → p-CYFfXlCT.js} +4 -4
- package/dist/peculiar/{p-RWPI76Dh.js.map → p-CYFfXlCT.js.map} +1 -1
- package/dist/peculiar/{p-D9qq15zG.js → p-CkePJXWQ.js} +4 -4
- package/dist/peculiar/{p-D9qq15zG.js.map → p-CkePJXWQ.js.map} +1 -1
- package/dist/peculiar/{p-LmKU8Smy.system.js.map → p-CuX3t1Hg.system.js.map} +1 -1
- package/dist/peculiar/{p-CxtUQdcj.system.js.map → p-Cv-b9S6H.system.js.map} +1 -1
- package/dist/peculiar/p-D0w6miI2.system.js +12 -0
- package/dist/peculiar/{p-IOtHTzYC.system.js.map → p-D0w6miI2.system.js.map} +1 -1
- package/dist/peculiar/p-DOFJd-ye.system.js.map +1 -0
- package/dist/peculiar/{p-zQwWLfga.system.js → p-DkshB-5z.system.js} +4 -4
- package/dist/peculiar/{p-zQwWLfga.system.js.map → p-DkshB-5z.system.js.map} +1 -1
- package/dist/peculiar/{p-BeVuAzsd.system.js → p-DorRvFf7.system.js} +39 -39
- package/dist/peculiar/{p-BeVuAzsd.system.js.map → p-DorRvFf7.system.js.map} +1 -1
- package/dist/peculiar/{p-BQiABBi1.system.js → p-ZxTK29QB.system.js} +2 -2
- package/dist/peculiar/{p-BQiABBi1.system.js.map → p-ZxTK29QB.system.js.map} +1 -1
- package/dist/peculiar/{p-364fd32b.system.entry.js → p-a4454e2d.system.entry.js} +2 -2
- package/dist/peculiar/{p-ClkgAXnd.system.js → p-kq9wAWxW.system.js} +3 -3
- package/dist/peculiar/p-kq9wAWxW.system.js.map +1 -0
- package/dist/peculiar/{p-Ct-r021h.js → p-rmToyzuK.js} +3 -3
- package/dist/peculiar/p-rmToyzuK.js.map +1 -0
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/ssh-certificate-viewer/-components/miscellaneous.d.ts +14 -0
- package/dist/types/crypto/ssh_certificate.d.ts +2 -0
- package/dist/types/utils/download.d.ts +3 -0
- package/hydrate/index.js +33 -5
- package/hydrate/index.mjs +33 -5
- package/package.json +2 -2
- package/components/link.js +0 -14335
- package/components/link.js.map +0 -1
- package/dist/cjs/ssh_certificate-s3-rwdMT.js.map +0 -1
- package/dist/esm/ssh_certificate-Ct-r021h.js.map +0 -1
- package/dist/esm-es5/ssh_certificate-Ct-r021h.js.map +0 -1
- package/dist/peculiar/p-5df0f22b.system.entry.js.map +0 -1
- package/dist/peculiar/p-62b723f6.entry.js.map +0 -1
- package/dist/peculiar/p-BGIWeG8l.js +0 -12
- package/dist/peculiar/p-C31rbtuG.system.js.map +0 -1
- package/dist/peculiar/p-Ce-IF7_R.system.js.map +0 -1
- package/dist/peculiar/p-ClkgAXnd.system.js.map +0 -1
- package/dist/peculiar/p-Ct-r021h.js.map +0 -1
- package/dist/peculiar/p-IOtHTzYC.system.js +0 -12
- /package/dist/peculiar/{p-83a53b4f.entry.js.map → p-019339d6.entry.js.map} +0 -0
- /package/dist/peculiar/{p-0b895a8e.entry.js.map → p-04422929.entry.js.map} +0 -0
- /package/dist/peculiar/{p-11434880.system.entry.js.map → p-3685975d.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-364fd32b.system.entry.js.map → p-a4454e2d.system.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"peculiar-certificate-decoder.entry.esm.js","sources":["../../node_modules/.pnpm/@peculiar+asn1-cms@2.4.0/node_modules/@peculiar/asn1-cms/build/es2015/object_identifiers.js","src/crypto/x509_certificates.ts","src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["export const id_ct_contentInfo = \"1.2.840.113549.1.9.16.1.6\";\nexport const id_data = \"1.2.840.113549.1.7.1\";\nexport const id_signedData = \"1.2.840.113549.1.7.2\";\nexport const id_envelopedData = \"1.2.840.113549.1.7.3\";\nexport const id_digestedData = \"1.2.840.113549.1.7.5\";\nexport const id_encryptedData = \"1.2.840.113549.1.7.6\";\nexport const id_authData = \"1.2.840.113549.1.9.16.1.2\";\n","import { Convert } from 'pvtsutils';\nimport {\n SignedData,\n id_data,\n EncapsulatedContent,\n CertificateSet,\n CertificateChoices,\n ContentInfo,\n id_signedData,\n} from '@peculiar/asn1-cms';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { AsnConvert, OctetString } from '@peculiar/asn1-schema';\nimport { Download } from '../utils';\nimport { PemConverter } from './pem_converter';\nimport { X509Certificate } from './x509_certificate';\n\nexport class X509Certificates extends Array<X509Certificate> {\n constructor(raw: string) {\n super();\n\n const rawItems = PemConverter.isPem(raw)\n ? PemConverter.decode(raw).map((value) => Convert.ToBase64Url(value))\n : raw.split(',');\n\n if (rawItems.length < 2) {\n throw new Error('Unable to parse string. The array of elements is less than 2');\n }\n\n for (const item of rawItems) {\n this.push(new X509Certificate(item));\n }\n }\n\n public get commonName(): string {\n return Array.from(this)\n .map((o) => o.commonName)\n .join('_');\n }\n\n public get raw(): ArrayBuffer {\n const signedData = new SignedData();\n\n signedData.version = 1;\n signedData.encapContentInfo.eContentType = id_data;\n signedData.encapContentInfo.eContent = new EncapsulatedContent({ single: new OctetString() });\n signedData.certificates = new CertificateSet(\n Array.from(this)\n .map((o) => new CertificateChoices({ certificate: AsnConvert.parse(o.raw, Certificate) })),\n );\n\n const cms = new ContentInfo({\n contentType: id_signedData,\n content: AsnConvert.serialize(signedData),\n });\n\n return AsnConvert.serialize(cms);\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return Array.from(this)\n .map((o) => o.toString('pem'))\n .join('\\n');\n case 'base64url':\n return Array.from(this)\n .map((o) => o.toString('base64url'))\n .join(',');\n default:\n return Array.from(this)\n .map((o) => o.toString('base64'))\n .join(',');\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n margin-bottom: var(--pv-size-base-12);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\n X509Certificates,\n SshCertificate,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateToDecode?: string;\n\n @State() certificateDecoded: X509Certificates\n | X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl\n | SshCertificate;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.certificateToDecode) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.certificateToDecode), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n async setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n\n this.inputPaste.value = await value.toString('pem');\n this.successParse.emit(await value.toString('base64url'));\n }\n\n async decode(value: string) {\n new Promise<X509Certificates>((resolve) => {\n resolve(new X509Certificates(value));\n })\n .catch(() => new X509Certificate(value))\n .catch(() => new X509AttributeCertificate(value))\n .catch(() => new Pkcs10CertificateRequest(value))\n .catch(() => new X509Crl(value))\n .catch(() => new SshCertificate(value))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((error) => {\n console.log(error);\n\n alert(`Error decoding certificate:\\n\"${value}\"\\n\\nPlease try to use Certificate/AttributeCertificate/CertificateRequest/CRL.`);\n });\n }\n\n renderCertificate() {\n if (this.certificateDecoded instanceof X509Certificates) {\n return (\n <peculiar-certificate-chain-viewer\n certificates={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Certificate) {\n return (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509AttributeCertificate) {\n return (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof Pkcs10CertificateRequest) {\n return (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Crl) {\n return (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof SshCertificate) {\n return (\n <peculiar-ssh-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n return null;\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl,.cert\"\n value=\"\"\n onChange={this.handleChangeInputFile}\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.renderCertificate()}\n </Host>\n );\n }\n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KAAK,EAAC,aAAa,EAAA,EACtB,CAAC,CAAA,UAAU,qDACT,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,kBAAkB,EAGb,EAAA,gBAAA,CAAA,EACb,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAA,EACxC,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,EAAE,EAAc,EAAA,MAAA,CAAA,EAC7B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,MACpC,CAAQ,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EACzB,OAAO,CAAC,KAAK,CACP,CACV,CAAC,CACK,CACL,CACP,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAC,MAAM,EACL,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAGxB,EAAA,QAAA,CAAA,EACT,CAAC,CAAA,MAAM,qDACL,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAGvB,EAAA,OAAA,CAAA,CACL,CACF,EACL,IAAI,CAAC,iBAAiB,EAAE,CACpB;;;;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"peculiar-certificate-decoder.entry.esm.js","sources":["../../node_modules/.pnpm/@peculiar+asn1-cms@2.4.0/node_modules/@peculiar/asn1-cms/build/es2015/object_identifiers.js","src/crypto/x509_certificates.ts","src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["export const id_ct_contentInfo = \"1.2.840.113549.1.9.16.1.6\";\nexport const id_data = \"1.2.840.113549.1.7.1\";\nexport const id_signedData = \"1.2.840.113549.1.7.2\";\nexport const id_envelopedData = \"1.2.840.113549.1.7.3\";\nexport const id_digestedData = \"1.2.840.113549.1.7.5\";\nexport const id_encryptedData = \"1.2.840.113549.1.7.6\";\nexport const id_authData = \"1.2.840.113549.1.9.16.1.2\";\n","import { Convert } from 'pvtsutils';\nimport {\n SignedData,\n id_data,\n EncapsulatedContent,\n CertificateSet,\n CertificateChoices,\n ContentInfo,\n id_signedData,\n} from '@peculiar/asn1-cms';\nimport { Certificate } from '@peculiar/asn1-x509';\nimport { AsnConvert, OctetString } from '@peculiar/asn1-schema';\nimport { Download } from '../utils';\nimport { PemConverter } from './pem_converter';\nimport { X509Certificate } from './x509_certificate';\n\nexport class X509Certificates extends Array<X509Certificate> {\n constructor(raw: string) {\n super();\n\n const rawItems = PemConverter.isPem(raw)\n ? PemConverter.decode(raw).map((value) => Convert.ToBase64Url(value))\n : raw.split(',');\n\n if (rawItems.length < 2) {\n throw new Error('Unable to parse string. The array of elements is less than 2');\n }\n\n for (const item of rawItems) {\n this.push(new X509Certificate(item));\n }\n }\n\n public get commonName(): string {\n return Array.from(this)\n .map((o) => o.commonName)\n .join('_');\n }\n\n public get raw(): ArrayBuffer {\n const signedData = new SignedData();\n\n signedData.version = 1;\n signedData.encapContentInfo.eContentType = id_data;\n signedData.encapContentInfo.eContent = new EncapsulatedContent({ single: new OctetString() });\n signedData.certificates = new CertificateSet(\n Array.from(this)\n .map((o) => new CertificateChoices({ certificate: AsnConvert.parse(o.raw, Certificate) })),\n );\n\n const cms = new ContentInfo({\n contentType: id_signedData,\n content: AsnConvert.serialize(signedData),\n });\n\n return AsnConvert.serialize(cms);\n }\n\n public toString(format: 'pem' | 'base64' | 'base64url' = 'pem'): string {\n switch (format) {\n case 'pem':\n return Array.from(this)\n .map((o) => o.toString('pem'))\n .join('\\n');\n case 'base64url':\n return Array.from(this)\n .map((o) => o.toString('base64url'))\n .join(',');\n default:\n return Array.from(this)\n .map((o) => o.toString('base64'))\n .join(',');\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n","@import '../../css/base.scss';\n\n:host {\n display: block;\n width: 100%;\n}\n\n.textarea {\n min-height: 300px;\n width: 100%;\n border-radius: 4px;\n border: 1px solid var(--pv-color-gray-5);;\n padding: 14px;\n font-family: monospace;\n resize: vertical;\n}\n\n.controls {\n margin-top: var(--pv-size-base-2);\n display: flex;\n flex-direction: column;\n gap: var(--pv-size-base-2);\n margin-bottom: var(--pv-size-base-12);\n}\n\n.control_row {\n display: flex;\n align-items: center;\n gap: var(--pv-size-base);\n}\n","/**\n * @license\n * Copyright (c) Peculiar Ventures, LLC.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n Component,\n Host,\n h,\n State,\n Prop,\n Event,\n EventEmitter,\n} from '@stencil/core';\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\n X509Certificates,\n SshCertificate,\n} from '../../crypto';\nimport { Button } from '../button';\nimport { Typography } from '../typography';\n\n@Component({\n tag: 'peculiar-certificate-decoder',\n styleUrl: 'certificate-decoder.scss',\n shadow: true,\n})\nexport class CertificateDecoder {\n private inputPaste?: HTMLTextAreaElement;\n\n /**\n * The example certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateExamples?: {\n title: string;\n value: string;\n }[];\n\n /**\n * The default certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificateToDecode?: string;\n\n @State() certificateDecoded: X509Certificates\n | X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl\n | SshCertificate;\n\n /**\n * Emitted when the certificate has been successfully parsed.\n */\n @Event() successParse!: EventEmitter<string>;\n\n /**\n * Emitted when the certificate has been removed.\n */\n @Event() clearCertificate!: EventEmitter<void>;\n\n componentDidLoad() {\n if (this.certificateToDecode) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.certificateToDecode), 100);\n }\n }\n\n private handleClickDecode = () => {\n const { value } = this.inputPaste;\n\n if (value) {\n this.decode(value);\n }\n };\n\n private handleClickClear = () => {\n this.clearValue();\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleChangeInputFile = async (event: any) => {\n const element = event.target;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n\n element.value = '';\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private handleDropFile = async (event: any) => {\n event.stopPropagation();\n event.preventDefault();\n\n const element = event.dataTransfer;\n\n if (element.files) {\n const file = await readAsBinaryString(element.files[0]);\n\n if (typeof file.value === 'string') {\n this.decode(file.value);\n }\n }\n };\n\n clearValue() {\n this.inputPaste.value = '';\n this.certificateDecoded = null;\n this.clearCertificate.emit();\n }\n\n async setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n\n this.inputPaste.value = await value.toString('pem');\n this.successParse.emit(await value.toString('base64url'));\n }\n\n async decode(value: string) {\n new Promise<X509Certificates>((resolve) => {\n resolve(new X509Certificates(value));\n })\n .catch(() => new X509Certificate(value))\n .catch(() => new X509AttributeCertificate(value))\n .catch(() => new Pkcs10CertificateRequest(value))\n .catch(() => new X509Crl(value))\n .catch(() => new SshCertificate(value))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((error) => {\n console.log(error);\n\n alert(`Error decoding certificate:\\n\"${value}\"\\n\\nPlease try to use Certificate/AttributeCertificate/CertificateRequest/CRL.`);\n });\n }\n\n renderCertificate() {\n if (this.certificateDecoded instanceof X509Certificates) {\n return (\n <peculiar-certificate-chain-viewer\n certificates={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Certificate) {\n return (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509AttributeCertificate) {\n return (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof Pkcs10CertificateRequest) {\n return (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof X509Crl) {\n return (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n if (this.certificateDecoded instanceof SshCertificate) {\n return (\n <peculiar-ssh-certificate-viewer\n certificate={this.certificateDecoded}\n download\n />\n );\n }\n\n return null;\n }\n\n render() {\n return (\n <Host>\n <textarea\n placeholder=\"Certificate DER or PEM\"\n class=\"textarea t-b2 c-black\"\n ref={(el) => { this.inputPaste = el; }}\n onDrop={this.handleDropFile}\n />\n <div class=\"controls\">\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Drag or load file:\n </Typography>\n <input\n type=\"file\"\n accept=\"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl,.pub\"\n value=\"\"\n onChange={this.handleChangeInputFile}\n />\n </div>\n {this.certificateExamples?.length && (\n <div class=\"control_row\">\n <Typography\n variant=\"b3\"\n color=\"secondary-tint-2\"\n >\n Load examples:\n </Typography>\n <select onChange={this.handleChangeExample}>\n <option value=\"\">None</option>\n {this.certificateExamples.map((example) => (\n <option value={example.value}>\n {example.title}\n </option>\n ))}\n </select>\n </div>\n )}\n <div class=\"control_row\">\n <Button\n onClick={this.handleClickDecode}\n >\n Decode\n </Button>\n <Button\n onClick={this.handleClickClear}\n >\n Clear\n </Button>\n </div>\n </div>\n {this.renderCertificate()}\n </Host>\n );\n }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K,KAAK,EAAC,aAAa,EAAA,EACtB,CAAC,CAAA,UAAU,qDACT,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,kBAAkB,EAGb,EAAA,gBAAA,CAAA,EACb,CAAA,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAQ,QAAQ,EAAE,IAAI,CAAC,mBAAmB,EAAA,EACxC,CAAQ,CAAA,QAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,EAAE,EAAc,EAAA,MAAA,CAAA,EAC7B,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,MACpC,CAAQ,CAAA,QAAA,EAAA,EAAA,KAAK,EAAE,OAAO,CAAC,KAAK,EAAA,EACzB,OAAO,CAAC,KAAK,CACP,CACV,CAAC,CACK,CACL,CACP,EACD,CAAK,CAAA,KAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,KAAK,EAAC,aAAa,EAAA,EACtB,CAAA,CAAC,MAAM,EACL,EAAA,GAAA,EAAA,0CAAA,EAAA,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAGxB,EAAA,QAAA,CAAA,EACT,CAAC,CAAA,MAAM,qDACL,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAGvB,EAAA,OAAA,CAAA,CACL,CACF,EACL,IAAI,CAAC,iBAAiB,EAAE,CACpB;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{p as e,g as i,b as t}from"./p-CwgZaF40.js";export{s as setNonce}from"./p-CwgZaF40.js";var c=()=>{const i=import.meta.url;const t={};if(i!==""){t.resourcesUrl=new URL(".",i).href}return e(t)};c().then((async e=>{await i();return t([["p-9d9f24bd",[[262,"peculiar-text-hider",{opened:[32]}]]],["p-
|
|
4
|
+
import{p as e,g as i,b as t}from"./p-CwgZaF40.js";export{s as setNonce}from"./p-CwgZaF40.js";var c=()=>{const i=import.meta.url;const t={};if(i!==""){t.resourcesUrl=new URL(".",i).href}return e(t)};c().then((async e=>{await i();return t([["p-9d9f24bd",[[262,"peculiar-text-hider",{opened:[32]}]]],["p-019339d6",[[257,"peculiar-certificate-viewer",{certificate:[513],download:[516],authKeyIdParentLink:[513,"auth-key-id-parent-link"],authKeyIdSiblingsLink:[513,"auth-key-id-siblings-link"],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],issuerDnLink:[513,"issuer-dn-link"],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],isDecodeInProcess:[32]},null,{certificate:["watchCertificateAndDecode"]}]]],["p-7385d0bb",[[257,"peculiar-certificate-chain-viewer",{certificates:[16],download:[516],selectedCertificateIndex:[32]}],[257,"peculiar-ssh-certificate-viewer",{certificate:[513],download:[516],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],isDecodeInProcess:[32]},null,{certificate:["watchCertificateAndDecode"]}],[257,"peculiar-attribute-certificate-viewer",{certificate:[1],download:[4],authKeyIdParentLink:[513,"auth-key-id-parent-link"],authKeyIdSiblingsLink:[513,"auth-key-id-siblings-link"],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],isDecodeInProcess:[32]},null,{certificate:["watchCertificateAndDecode"]}],[257,"peculiar-crl-viewer",{certificate:[513],download:[4],authKeyIdParentLink:[513,"auth-key-id-parent-link"],authKeyIdSiblingsLink:[513,"auth-key-id-siblings-link"],issuerDnLink:[513,"issuer-dn-link"],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],isDecodeInProcess:[32]},null,{certificate:["watchCertificateAndDecode"]}],[257,"peculiar-csr-viewer",{certificate:[513],download:[4],subjectKeyIdChildrenLink:[513,"subject-key-id-children-link"],subjectKeyIdSiblingsLink:[513,"subject-key-id-siblings-link"],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],isDecodeInProcess:[32]},null,{certificate:["watchCertificateAndDecode"]}]]],["p-154dd0da",[[257,"peculiar-certificate-decoder",{certificateExamples:[16,"certificate-examples"],certificateToDecode:[1,"certificate-to-decode"],certificateDecoded:[32]}]]],["p-27ae6a3a",[[258,"peculiar-button-menu",{groups:[16],open:[32]}],[257,"peculiar-circular-progress",{size:[2],width:[2]}],[257,"peculiar-highlight-words",{search:[1]}]]],["p-04422929",[[257,"peculiar-certificates-viewer",{certificates:[16],filterWithSearch:[4,"filter-with-search"],highlightWithSearch:[4,"highlight-with-search"],mobileMediaQueryString:[1,"mobile-media-query-string"],mobileScreenView:[32],search:[32],certificatesDecoded:[32],expandedRow:[32],certificateSelectedForDetails:[32],isDecodeInProcess:[32]},null,{certificates:["watchCertificates"]}]]]],e)}));
|
|
5
5
|
//# sourceMappingURL=peculiar.esm.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
import { FunctionalComponent } from '../../../stencil-public-runtime';
|
|
9
|
+
import { SshCertificate } from '../../../crypto';
|
|
10
|
+
interface ISshMiscellaneousProps {
|
|
11
|
+
certificate: SshCertificate;
|
|
12
|
+
}
|
|
13
|
+
export declare const SshMiscellaneous: FunctionalComponent<ISshMiscellaneousProps>;
|
|
14
|
+
export {};
|
|
@@ -25,4 +25,6 @@ export declare class SshCertificate {
|
|
|
25
25
|
parseSignatureKey(): Promise<void>;
|
|
26
26
|
parsePublicKey(): Promise<void>;
|
|
27
27
|
toString(_format?: 'pem' | 'base64' | 'base64url'): Promise<string>;
|
|
28
|
+
get commonName(): string;
|
|
29
|
+
downloadAsPub(name?: string): Promise<void>;
|
|
28
30
|
}
|
package/hydrate/index.js
CHANGED
|
@@ -10175,6 +10175,11 @@ Download.crl = {
|
|
|
10175
10175
|
downloadFromBuffer(raw, name, 'crl', 'application/pkix-crl');
|
|
10176
10176
|
},
|
|
10177
10177
|
};
|
|
10178
|
+
Download.certSSH = {
|
|
10179
|
+
asPub: (value, name) => {
|
|
10180
|
+
downloadFromBuffer(Convert.FromString(value), name, 'pub', 'text/plain');
|
|
10181
|
+
},
|
|
10182
|
+
};
|
|
10178
10183
|
|
|
10179
10184
|
/**
|
|
10180
10185
|
* @license
|
|
@@ -18286,6 +18291,12 @@ class SshCertificate {
|
|
|
18286
18291
|
async toString(_format = 'pem') {
|
|
18287
18292
|
return __classPrivateFieldGet(this, _SshCertificate_cert, "f").toSSH();
|
|
18288
18293
|
}
|
|
18294
|
+
get commonName() {
|
|
18295
|
+
return __classPrivateFieldGet(this, _SshCertificate_cert, "f").principals.join('_') || __classPrivateFieldGet(this, _SshCertificate_cert, "f").keyId || __classPrivateFieldGet(this, _SshCertificate_cert, "f").certType;
|
|
18296
|
+
}
|
|
18297
|
+
async downloadAsPub(name) {
|
|
18298
|
+
Download.certSSH.asPub(await this.toString(), name || [this.commonName, 'cert'].join('-'));
|
|
18299
|
+
}
|
|
18289
18300
|
}
|
|
18290
18301
|
_SshCertificate_cert = new WeakMap();
|
|
18291
18302
|
|
|
@@ -20500,7 +20511,7 @@ class CertificateDecoder {
|
|
|
20500
20511
|
}
|
|
20501
20512
|
render() {
|
|
20502
20513
|
var _a;
|
|
20503
|
-
return (hAsync(Host, { key: '9067f2d7f33a40b3ad0ba03c7338a6f800100dab' }, hAsync("textarea", { key: '9e8962631c259fd5e144a1397d8591dde46d032f', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), hAsync("div", { key: '9be2b1e6c9b3de94c9d5e1e6cf31d9fb487960d8', class: "controls" }, hAsync("div", { key: '3959b89ab5c5654a3c10a1166743c056c0340e2e', class: "control_row" }, hAsync(Typography, { key: '3c03f42d14ff5a485264523bab40765bb4f89a8f', variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), hAsync("input", { key: '
|
|
20514
|
+
return (hAsync(Host, { key: '9067f2d7f33a40b3ad0ba03c7338a6f800100dab' }, hAsync("textarea", { key: '9e8962631c259fd5e144a1397d8591dde46d032f', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), hAsync("div", { key: '9be2b1e6c9b3de94c9d5e1e6cf31d9fb487960d8', class: "controls" }, hAsync("div", { key: '3959b89ab5c5654a3c10a1166743c056c0340e2e', class: "control_row" }, hAsync(Typography, { key: '3c03f42d14ff5a485264523bab40765bb4f89a8f', variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), hAsync("input", { key: '29845cfd11955ded4b43d19be3ede89d77b71fef', type: "file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl,.pub", value: "", onChange: this.handleChangeInputFile })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.length) && (hAsync("div", { key: 'ec2e21cdcda421bd046d42607569e90eb0a96589', class: "control_row" }, hAsync(Typography, { key: '17850c755e70545949be4f772ec67f02eae829af', variant: "b3", color: "secondary-tint-2" }, "Load examples:"), hAsync("select", { key: '4431af8f0dcc97fd8e26637cef8a9524a83e9519', onChange: this.handleChangeExample }, hAsync("option", { key: 'c08edb4c2faf0f640e100cf62ae7ad07f0714cc3', value: "" }, "None"), this.certificateExamples.map((example) => (hAsync("option", { value: example.value }, example.title)))))), hAsync("div", { key: 'e7f7a693ef5f72ce739fe6a42d8c87345d23a743', class: "control_row" }, hAsync(Button, { key: '7448517bf7f76af06f8a7f60d1e40360613d3acd', onClick: this.handleClickDecode }, "Decode"), hAsync(Button, { key: 'b831592de27a3b292b2d81a19400216fbce7e797', onClick: this.handleClickClear }, "Clear"))), this.renderCertificate()));
|
|
20504
20515
|
}
|
|
20505
20516
|
static get style() { return certificateDecoderCss; }
|
|
20506
20517
|
static get cmpMeta() { return {
|
|
@@ -21271,9 +21282,9 @@ const SshBasicInformation = (props) => {
|
|
|
21271
21282
|
hAsync(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
|
|
21272
21283
|
hAsync(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
|
|
21273
21284
|
hAsync(RowValue, { name: l10n.getString('keyId'), value: keyId }),
|
|
21274
|
-
hAsync(RowValue, { name: l10n.getString('principals'), value: principals.join(', ') }),
|
|
21275
|
-
hAsync(RowValue, { name: l10n.getString('criticalOptions'), value: Object.keys(criticalOptions).join(', ') }),
|
|
21276
|
-
hAsync(RowValue, { name: l10n.getString('extensions'), value: Object.keys(extensions).join(', ') }),
|
|
21285
|
+
hAsync(RowValue, { name: l10n.getString('principals'), value: principals.join(', ') || '(none)' }),
|
|
21286
|
+
hAsync(RowValue, { name: l10n.getString('criticalOptions'), value: Object.keys(criticalOptions).join(', ') || '(none)' }),
|
|
21287
|
+
hAsync(RowValue, { name: l10n.getString('extensions'), value: Object.keys(extensions).join(', ') || '(none)' }),
|
|
21277
21288
|
];
|
|
21278
21289
|
};
|
|
21279
21290
|
|
|
@@ -21317,6 +21328,23 @@ const SshSignatureKey = (props) => {
|
|
|
21317
21328
|
];
|
|
21318
21329
|
};
|
|
21319
21330
|
|
|
21331
|
+
/**
|
|
21332
|
+
* @license
|
|
21333
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
21334
|
+
*
|
|
21335
|
+
* This source code is licensed under the MIT license found in the
|
|
21336
|
+
* LICENSE file in the root directory of this source tree.
|
|
21337
|
+
*/
|
|
21338
|
+
const SshMiscellaneous = (props) => {
|
|
21339
|
+
const { certificate } = props;
|
|
21340
|
+
return [
|
|
21341
|
+
hAsync(RowTitle, { value: l10n.getString('miscellaneous') }),
|
|
21342
|
+
hAsync("tr", null,
|
|
21343
|
+
hAsync("td", null,
|
|
21344
|
+
hAsync(Button, { startIcon: hAsync(DownloadIcon, null), onClick: () => certificate.downloadAsPub() }, l10n.getString('download')))),
|
|
21345
|
+
];
|
|
21346
|
+
};
|
|
21347
|
+
|
|
21320
21348
|
const certificateViewerCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
21321
21349
|
|
|
21322
21350
|
class SshCertificateViewer {
|
|
@@ -21393,7 +21421,7 @@ class SshCertificateViewer {
|
|
|
21393
21421
|
if (!this.certificateDecoded) {
|
|
21394
21422
|
return this.renderEmptyState();
|
|
21395
21423
|
}
|
|
21396
|
-
return (hAsync(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, hAsync("table", null, hAsync(SshBasicInformation, Object.assign({}, this.certificateDecoded)), hAsync(SshPublicKey, { key: this.certificateDecoded.publicKey }), hAsync(SshSignatureKey, { key: this.certificateDecoded.signatureKey }))));
|
|
21424
|
+
return (hAsync(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, hAsync("table", null, hAsync(SshBasicInformation, Object.assign({}, this.certificateDecoded)), hAsync(SshPublicKey, { key: this.certificateDecoded.publicKey }), hAsync(SshSignatureKey, { key: this.certificateDecoded.signatureKey }), this.download && (hAsync(SshMiscellaneous, { certificate: this.certificateDecoded })))));
|
|
21397
21425
|
}
|
|
21398
21426
|
static get watchers() { return {
|
|
21399
21427
|
"certificate": ["watchCertificateAndDecode"]
|
package/hydrate/index.mjs
CHANGED
|
@@ -10173,6 +10173,11 @@ Download.crl = {
|
|
|
10173
10173
|
downloadFromBuffer(raw, name, 'crl', 'application/pkix-crl');
|
|
10174
10174
|
},
|
|
10175
10175
|
};
|
|
10176
|
+
Download.certSSH = {
|
|
10177
|
+
asPub: (value, name) => {
|
|
10178
|
+
downloadFromBuffer(Convert.FromString(value), name, 'pub', 'text/plain');
|
|
10179
|
+
},
|
|
10180
|
+
};
|
|
10176
10181
|
|
|
10177
10182
|
/**
|
|
10178
10183
|
* @license
|
|
@@ -18284,6 +18289,12 @@ class SshCertificate {
|
|
|
18284
18289
|
async toString(_format = 'pem') {
|
|
18285
18290
|
return __classPrivateFieldGet(this, _SshCertificate_cert, "f").toSSH();
|
|
18286
18291
|
}
|
|
18292
|
+
get commonName() {
|
|
18293
|
+
return __classPrivateFieldGet(this, _SshCertificate_cert, "f").principals.join('_') || __classPrivateFieldGet(this, _SshCertificate_cert, "f").keyId || __classPrivateFieldGet(this, _SshCertificate_cert, "f").certType;
|
|
18294
|
+
}
|
|
18295
|
+
async downloadAsPub(name) {
|
|
18296
|
+
Download.certSSH.asPub(await this.toString(), name || [this.commonName, 'cert'].join('-'));
|
|
18297
|
+
}
|
|
18287
18298
|
}
|
|
18288
18299
|
_SshCertificate_cert = new WeakMap();
|
|
18289
18300
|
|
|
@@ -20498,7 +20509,7 @@ class CertificateDecoder {
|
|
|
20498
20509
|
}
|
|
20499
20510
|
render() {
|
|
20500
20511
|
var _a;
|
|
20501
|
-
return (hAsync(Host, { key: '9067f2d7f33a40b3ad0ba03c7338a6f800100dab' }, hAsync("textarea", { key: '9e8962631c259fd5e144a1397d8591dde46d032f', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), hAsync("div", { key: '9be2b1e6c9b3de94c9d5e1e6cf31d9fb487960d8', class: "controls" }, hAsync("div", { key: '3959b89ab5c5654a3c10a1166743c056c0340e2e', class: "control_row" }, hAsync(Typography, { key: '3c03f42d14ff5a485264523bab40765bb4f89a8f', variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), hAsync("input", { key: '
|
|
20512
|
+
return (hAsync(Host, { key: '9067f2d7f33a40b3ad0ba03c7338a6f800100dab' }, hAsync("textarea", { key: '9e8962631c259fd5e144a1397d8591dde46d032f', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), hAsync("div", { key: '9be2b1e6c9b3de94c9d5e1e6cf31d9fb487960d8', class: "controls" }, hAsync("div", { key: '3959b89ab5c5654a3c10a1166743c056c0340e2e', class: "control_row" }, hAsync(Typography, { key: '3c03f42d14ff5a485264523bab40765bb4f89a8f', variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), hAsync("input", { key: '29845cfd11955ded4b43d19be3ede89d77b71fef', type: "file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl,.pub", value: "", onChange: this.handleChangeInputFile })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.length) && (hAsync("div", { key: 'ec2e21cdcda421bd046d42607569e90eb0a96589', class: "control_row" }, hAsync(Typography, { key: '17850c755e70545949be4f772ec67f02eae829af', variant: "b3", color: "secondary-tint-2" }, "Load examples:"), hAsync("select", { key: '4431af8f0dcc97fd8e26637cef8a9524a83e9519', onChange: this.handleChangeExample }, hAsync("option", { key: 'c08edb4c2faf0f640e100cf62ae7ad07f0714cc3', value: "" }, "None"), this.certificateExamples.map((example) => (hAsync("option", { value: example.value }, example.title)))))), hAsync("div", { key: 'e7f7a693ef5f72ce739fe6a42d8c87345d23a743', class: "control_row" }, hAsync(Button, { key: '7448517bf7f76af06f8a7f60d1e40360613d3acd', onClick: this.handleClickDecode }, "Decode"), hAsync(Button, { key: 'b831592de27a3b292b2d81a19400216fbce7e797', onClick: this.handleClickClear }, "Clear"))), this.renderCertificate()));
|
|
20502
20513
|
}
|
|
20503
20514
|
static get style() { return certificateDecoderCss; }
|
|
20504
20515
|
static get cmpMeta() { return {
|
|
@@ -21269,9 +21280,9 @@ const SshBasicInformation = (props) => {
|
|
|
21269
21280
|
hAsync(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
|
|
21270
21281
|
hAsync(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
|
|
21271
21282
|
hAsync(RowValue, { name: l10n.getString('keyId'), value: keyId }),
|
|
21272
|
-
hAsync(RowValue, { name: l10n.getString('principals'), value: principals.join(', ') }),
|
|
21273
|
-
hAsync(RowValue, { name: l10n.getString('criticalOptions'), value: Object.keys(criticalOptions).join(', ') }),
|
|
21274
|
-
hAsync(RowValue, { name: l10n.getString('extensions'), value: Object.keys(extensions).join(', ') }),
|
|
21283
|
+
hAsync(RowValue, { name: l10n.getString('principals'), value: principals.join(', ') || '(none)' }),
|
|
21284
|
+
hAsync(RowValue, { name: l10n.getString('criticalOptions'), value: Object.keys(criticalOptions).join(', ') || '(none)' }),
|
|
21285
|
+
hAsync(RowValue, { name: l10n.getString('extensions'), value: Object.keys(extensions).join(', ') || '(none)' }),
|
|
21275
21286
|
];
|
|
21276
21287
|
};
|
|
21277
21288
|
|
|
@@ -21315,6 +21326,23 @@ const SshSignatureKey = (props) => {
|
|
|
21315
21326
|
];
|
|
21316
21327
|
};
|
|
21317
21328
|
|
|
21329
|
+
/**
|
|
21330
|
+
* @license
|
|
21331
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
21332
|
+
*
|
|
21333
|
+
* This source code is licensed under the MIT license found in the
|
|
21334
|
+
* LICENSE file in the root directory of this source tree.
|
|
21335
|
+
*/
|
|
21336
|
+
const SshMiscellaneous = (props) => {
|
|
21337
|
+
const { certificate } = props;
|
|
21338
|
+
return [
|
|
21339
|
+
hAsync(RowTitle, { value: l10n.getString('miscellaneous') }),
|
|
21340
|
+
hAsync("tr", null,
|
|
21341
|
+
hAsync("td", null,
|
|
21342
|
+
hAsync(Button, { startIcon: hAsync(DownloadIcon, null), onClick: () => certificate.downloadAsPub() }, l10n.getString('download')))),
|
|
21343
|
+
];
|
|
21344
|
+
};
|
|
21345
|
+
|
|
21318
21346
|
const certificateViewerCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
21319
21347
|
|
|
21320
21348
|
class SshCertificateViewer {
|
|
@@ -21391,7 +21419,7 @@ class SshCertificateViewer {
|
|
|
21391
21419
|
if (!this.certificateDecoded) {
|
|
21392
21420
|
return this.renderEmptyState();
|
|
21393
21421
|
}
|
|
21394
|
-
return (hAsync(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, hAsync("table", null, hAsync(SshBasicInformation, Object.assign({}, this.certificateDecoded)), hAsync(SshPublicKey, { key: this.certificateDecoded.publicKey }), hAsync(SshSignatureKey, { key: this.certificateDecoded.signatureKey }))));
|
|
21422
|
+
return (hAsync(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, hAsync("table", null, hAsync(SshBasicInformation, Object.assign({}, this.certificateDecoded)), hAsync(SshPublicKey, { key: this.certificateDecoded.publicKey }), hAsync(SshSignatureKey, { key: this.certificateDecoded.signatureKey }), this.download && (hAsync(SshMiscellaneous, { certificate: this.certificateDecoded })))));
|
|
21395
21423
|
}
|
|
21396
21424
|
static get watchers() { return {
|
|
21397
21425
|
"certificate": ["watchCertificateAndDecode"]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peculiar/certificates-viewer",
|
|
3
|
-
"version": "4.7.1-alpha.
|
|
3
|
+
"version": "4.7.1-alpha.5+5752b52",
|
|
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": [
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"publishConfig": {
|
|
88
88
|
"access": "public"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "5752b52682fba99aae66eb7e1d83a51c21ecdd0c"
|
|
91
91
|
}
|