@peculiar/certificates-viewer 4.2.2 → 4.3.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/components/attribute-certificate-viewer.js +1 -1
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/certificate-viewer.js +2 -2
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +2 -2
- package/components/crl-viewer.js.map +1 -1
- package/components/download.js +12 -17
- package/components/download.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +12 -69
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/pkcs10_certificate_request.js +1 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/dist/cjs/{certification_request-815ec558.js → certification_request-314859bb.js} +12 -22
- package/dist/cjs/certification_request-314859bb.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/{miscellaneous-9a573276.js → miscellaneous-f1bc3a4b.js} +2 -2
- package/dist/cjs/{miscellaneous-9a573276.js.map → miscellaneous-f1bc3a4b.js.map} +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +15 -72
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +3 -3
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +2 -2
- package/dist/cjs/{pkcs10_certificate_request-0ebc0023.js → pkcs10_certificate_request-93c66ce7.js} +3 -3
- package/dist/cjs/pkcs10_certificate_request-93c66ce7.js.map +1 -0
- package/dist/cjs/{x509_certificate-9914b149.js → x509_certificate-0776e3ec.js} +3 -3
- package/dist/cjs/x509_certificate-0776e3ec.js.map +1 -0
- package/dist/cjs/{x509_crl-86b6e71d.js → x509_crl-5326d209.js} +5 -5
- package/dist/cjs/x509_crl-5326d209.js.map +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +12 -69
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/constants/oids.js +3 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js +1 -1
- package/dist/collection/crypto/pkcs10_certificate_request.js.map +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js +1 -1
- package/dist/collection/crypto/x509_attribute_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_certificate.js +1 -1
- package/dist/collection/crypto/x509_certificate.js.map +1 -1
- package/dist/collection/crypto/x509_crl.js +1 -1
- package/dist/collection/crypto/x509_crl.js.map +1 -1
- package/dist/collection/utils/download.js +8 -8
- package/dist/collection/utils/download.js.map +1 -1
- package/dist/collection/utils/validator.js +0 -8
- package/dist/collection/utils/validator.js.map +1 -1
- package/dist/esm/{certification_request-08b4deb8.js → certification_request-b531916a.js} +13 -18
- package/dist/esm/certification_request-b531916a.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/{miscellaneous-d4bbc6f2.js → miscellaneous-7fe71e3f.js} +2 -2
- package/dist/esm/{miscellaneous-d4bbc6f2.js.map → miscellaneous-7fe71e3f.js.map} +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +4 -4
- package/dist/esm/peculiar-certificate-decoder.entry.js +15 -72
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +3 -3
- package/dist/esm/peculiar-certificates-viewer.entry.js +2 -2
- package/dist/esm/{pkcs10_certificate_request-3763c2af.js → pkcs10_certificate_request-cca2ca68.js} +3 -3
- package/dist/esm/pkcs10_certificate_request-cca2ca68.js.map +1 -0
- package/dist/esm/{x509_certificate-47b4c5ee.js → x509_certificate-050175dd.js} +3 -3
- package/dist/esm/x509_certificate-050175dd.js.map +1 -0
- package/dist/esm/{x509_crl-ba76d3ed.js → x509_crl-c497f907.js} +5 -5
- package/dist/esm/x509_crl-c497f907.js.map +1 -0
- package/dist/esm-es5/{certification_request-08b4deb8.js → certification_request-b531916a.js} +5 -5
- package/dist/esm-es5/certification_request-b531916a.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{miscellaneous-d4bbc6f2.js → miscellaneous-7fe71e3f.js} +2 -2
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +2 -2
- 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-3763c2af.js → pkcs10_certificate_request-cca2ca68.js} +3 -3
- package/dist/esm-es5/{pkcs10_certificate_request-3763c2af.js.map → pkcs10_certificate_request-cca2ca68.js.map} +1 -1
- package/dist/esm-es5/{x509_certificate-47b4c5ee.js → x509_certificate-050175dd.js} +3 -3
- package/dist/{peculiar/p-1818204e.system.js.map → esm-es5/x509_certificate-050175dd.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-ba76d3ed.js → x509_crl-c497f907.js} +4 -4
- package/dist/esm-es5/x509_crl-c497f907.js.map +1 -0
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/{p-1818204e.system.js → p-05af3b74.system.js} +4 -4
- package/dist/{esm-es5/x509_certificate-47b4c5ee.js.map → peculiar/p-05af3b74.system.js.map} +1 -1
- package/dist/peculiar/{p-30e18f2d.system.js → p-163a3052.system.js} +5 -5
- package/dist/peculiar/p-163a3052.system.js.map +1 -0
- package/dist/peculiar/{p-364df80d.system.entry.js → p-2d9c40d6.system.entry.js} +2 -2
- package/dist/peculiar/p-494d26fb.entry.js +5 -0
- package/dist/peculiar/p-494d26fb.entry.js.map +1 -0
- package/dist/peculiar/{p-c10bfa6a.system.js → p-52f13c4a.system.js} +2 -2
- package/dist/peculiar/{p-82e4faf0.js → p-5a699274.js} +4 -4
- package/dist/peculiar/p-5a699274.js.map +1 -0
- package/dist/peculiar/p-6221d0a4.system.entry.js +5 -0
- package/dist/peculiar/p-6221d0a4.system.entry.js.map +1 -0
- package/dist/peculiar/{p-6acca6ea.js → p-666438a8.js} +11 -11
- package/dist/peculiar/p-666438a8.js.map +1 -0
- package/dist/peculiar/{p-84e3e94a.entry.js → p-7a5173be.entry.js} +7 -7
- package/dist/peculiar/{p-31d5da39.js → p-80477c05.js} +3 -3
- package/dist/peculiar/{p-31d5da39.js.map → p-80477c05.js.map} +1 -1
- package/dist/peculiar/p-8393399a.system.js +1 -1
- package/dist/peculiar/{p-9c8dc738.entry.js → p-8ff95ad8.entry.js} +2 -2
- package/dist/peculiar/{p-4ee5140c.system.js → p-a06f51a2.system.js} +3 -3
- package/dist/peculiar/{p-4ee5140c.system.js.map → p-a06f51a2.system.js.map} +1 -1
- package/dist/peculiar/{p-b0c963b1.js → p-adf16adb.js} +13 -13
- package/dist/peculiar/{p-78a6b479.js → p-b6d5e413.js} +4 -4
- package/dist/peculiar/{p-78a6b479.js.map → p-b6d5e413.js.map} +1 -1
- package/dist/peculiar/{p-8db3e1fd.system.entry.js → p-bd7fb688.system.entry.js} +2 -2
- package/dist/peculiar/{p-0f3787cf.system.entry.js → p-cc256004.system.entry.js} +2 -2
- package/dist/peculiar/p-d1066b51.system.js +135 -0
- package/dist/peculiar/p-d1066b51.system.js.map +1 -0
- package/dist/peculiar/{p-28b4d316.system.js → p-d6229f42.system.js} +2 -2
- package/dist/peculiar/{p-f8efbe93.entry.js → p-ddadcb44.entry.js} +2 -2
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +1 -1
- package/dist/types/constants/oids.d.ts +3 -0
- package/dist/types/utils/download.d.ts +4 -4
- package/dist/types/utils/validator.d.ts +0 -4
- package/hydrate/index.js +26 -88
- package/package.json +3 -3
- package/dist/cjs/certification_request-815ec558.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-0ebc0023.js.map +0 -1
- package/dist/cjs/x509_certificate-9914b149.js.map +0 -1
- package/dist/cjs/x509_crl-86b6e71d.js.map +0 -1
- package/dist/esm/certification_request-08b4deb8.js.map +0 -1
- package/dist/esm/pkcs10_certificate_request-3763c2af.js.map +0 -1
- package/dist/esm/x509_certificate-47b4c5ee.js.map +0 -1
- package/dist/esm/x509_crl-ba76d3ed.js.map +0 -1
- package/dist/esm-es5/certification_request-08b4deb8.js.map +0 -1
- package/dist/esm-es5/x509_crl-ba76d3ed.js.map +0 -1
- package/dist/peculiar/p-30e18f2d.system.js.map +0 -1
- package/dist/peculiar/p-6acca6ea.js.map +0 -1
- package/dist/peculiar/p-82005297.system.entry.js +0 -5
- package/dist/peculiar/p-82005297.system.entry.js.map +0 -1
- package/dist/peculiar/p-82e4faf0.js.map +0 -1
- package/dist/peculiar/p-c3fce3f5.entry.js +0 -5
- package/dist/peculiar/p-c3fce3f5.entry.js.map +0 -1
- package/dist/peculiar/p-df2c8826.system.js +0 -135
- package/dist/peculiar/p-df2c8826.system.js.map +0 -1
- /package/dist/esm-es5/{miscellaneous-d4bbc6f2.js.map → miscellaneous-7fe71e3f.js.map} +0 -0
- /package/dist/peculiar/{p-364df80d.system.entry.js.map → p-2d9c40d6.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-c10bfa6a.system.js.map → p-52f13c4a.system.js.map} +0 -0
- /package/dist/peculiar/{p-84e3e94a.entry.js.map → p-7a5173be.entry.js.map} +0 -0
- /package/dist/peculiar/{p-9c8dc738.entry.js.map → p-8ff95ad8.entry.js.map} +0 -0
- /package/dist/peculiar/{p-b0c963b1.js.map → p-adf16adb.js.map} +0 -0
- /package/dist/peculiar/{p-8db3e1fd.system.entry.js.map → p-bd7fb688.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-0f3787cf.system.entry.js.map → p-cc256004.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-28b4d316.system.js.map → p-d6229f42.system.js.map} +0 -0
- /package/dist/peculiar/{p-f8efbe93.entry.js.map → p-ddadcb44.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__extends","X509AttributeCertificate","_super","raw","_this","call","this","certificateRawToBuffer","AttributeCertificate","thumbprints","type","tag","acinfo","asn","serialNumber","Convert","ToHex","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","Object","defineProperty","prototype","_b","signatureValue","signatureAlgorithm","value","algorithm","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","parseAttributes","attributes","Attribute","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","concat","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","name","Download","attrCert","asPEM","commonName","downloadAsDER","asDER","AsnData","X509Crl","CertificateList","tbsCertList","Name","toJSON","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","error_2","signature","i","length","shortName","crlExtensions","crl"],"sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\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 { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = 'ATTRIBUTE CERTIFICATE';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\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 */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = 'X509 CRL';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;4CA8B8CA,UAAAC,EAAAC,GAyB5C,SAAAD,EAAYE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aiC,EAAYiB,cAC3BjD,KAAI,SAACC,GAAM,WAAIC,UAAUC,WAAWC,UAAUH,GAAnC,G,GAIX6B,EAAAtC,UAAAwB,SAAA,SAASC,GAAA,GAAAA,SAAA,GAAAA,EAAA,KAAwC,CACtD,OAAQA,GACN,IAAK,MACH,OAAOC,UAAU7C,UAAQC,MAAMV,KAAKH,MACtC,IAAK,MACH,MAAO,cAAAsD,OAAcnD,KAAKK,IAAG,WAAA8C,OAAUI,aAAavD,KAAKoD,SAAS,WAAU,eAAAD,OAAcnD,KAAKK,IAAG,SACpG,QACE,OAAOI,UAAQ+C,SAASxD,KAAKH,K,EAI5BqE,EAAAtC,UAAA6B,cAAA,SAAcC,GACnBC,SAAS2B,IAAIzB,MACX7D,KAAKoD,SAAS,OACdM,GAAQ1D,KAAK8D,W,EAIVI,EAAAtC,UAAAmC,cAAA,SAAcL,GACnBC,SAAS2B,IAAItB,MACXhE,KAAKH,IACL6D,GAAQ1D,KAAK8D,W,YA3GUG,gB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
export{D as Download,d as downloadFromBuffer}from"./p-
|
|
4
|
+
export{D as Download,d as downloadFromBuffer}from"./p-666438a8.js";export{r as readAsArrayBuffer,a as readAsBinaryString,b as readAsDataUrl,c as readAsText}from"./p-25a532a3.js";export{P as Pkcs10CertificateRequest}from"./p-b6d5e413.js";export{B as Button,T as Typography}from"./p-4bc5ddbe.js";export{L as Link}from"./p-e6a6e602.js";export{C as CrossIcon,D as DetailsIcon,L as LinkIcon}from"./p-99efefea.js";export{D as DownloadIcon}from"./p-ae91d778.js";export{A as ActionsIcon}from"./p-a9487007.js";export{A as ArrowBottomIcon,a as ArrowTopIcon}from"./p-27ca6743.js";import"./p-3cb79cd9.js";
|
|
5
5
|
//# sourceMappingURL=index.esm.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))t[r]=n[r]};return t(n,r)};return function(n,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(n,r);function e(){this.constructor=n}n.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}();var __awaiter=this&&this.__awaiter||function(t,n,r,e){function i(t){return t instanceof r?t:new r((function(n){n(t)}))}return new(r||(r=Promise))((function(r,u){function o(t){try{
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r))t[r]=n[r]};return t(n,r)};return function(n,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(n,r);function e(){this.constructor=n}n.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}}();var __awaiter=this&&this.__awaiter||function(t,n,r,e){function i(t){return t instanceof r?t:new r((function(n){n(t)}))}return new(r||(r=Promise))((function(r,u){function o(t){try{f(e.next(t))}catch(t){u(t)}}function a(t){try{f(e["throw"](t))}catch(t){u(t)}}function f(t){t.done?r(t.value):i(t.value).then(o,a)}f((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var r={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},e,i,u,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(t){return function(n){return f([t,n])}}function f(a){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(r=0)),r)try{if(e=1,i&&(u=a[0]&2?i["return"]:a[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,a[1])).done)return u;if(i=0,u)a=[a[0]&2,u.value];switch(a[0]){case 0:case 1:u=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(u=r.trys,u=u.length>0&&u[u.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!u||a[1]>u[0]&&a[1]<u[3])){r.label=a[1];break}if(a[0]===6&&r.label<u[1]){r.label=u[1];u=a;break}if(u&&r.label<u[2]){r.label=u[2];r.ops.push(a);break}if(u[2])r.ops.pop();r.trys.pop();continue}a=n.call(t,r)}catch(t){a=[6,t];i=0}finally{e=u=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-
|
|
4
|
+
*/System.register(["./p-d1066b51.system.js"],(function(t){"use strict";var n,r,e,i,u,o,a,f,c,s,h,l,v,b,m,w,g,y,_,p,d;return{setters:[function(t){n=t.A;r=t.v;e=t.K;i=t.C;u=t.N;o=t.L;a=t.G;f=t.y;c=t.x;s=t.z;h=t.B;l=t.R;v=t.M;b=t.O;m=t.P;w=t.Q;g=t.S;y=t.F;_=t.H;p=t.J;d=t.D}],execute:function(){
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -9,5 +9,5 @@ var __extends=this&&this.__extends||function(){var t=function(n,r){t=Object.setP
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var O=function(t){__extends(n,t);function n(n){var
|
|
13
|
-
//# sourceMappingURL=p-
|
|
12
|
+
var O=function(t){__extends(n,t);function n(n){var a=t.call(this,r(n),e)||this;a.thumbprints={};a.type="X.509 Certificate";a.tag="CERTIFICATE";var f=a.asn.tbsCertificate;a.serialNumber=i.ToHex(f.serialNumber);a.subject=new u(f.subject).toJSON();a.issuer=new u(f.issuer).toJSON();a.version=f.version+1;var c=f.validity.notBefore.utcTime||f.validity.notBefore.generalTime;if(!c){throw new Error("Cannot get 'notBefore' value")}a.notBefore=c;var s=f.validity.notAfter.utcTime||f.validity.notAfter.generalTime;if(!s){throw new Error("Cannot get 'notAfter' value")}a.notAfter=s;a.validity=o(a.notBefore,a.notAfter);return a}n.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new a(f.serialize(t))}))}};n.prototype.getPublicKeyInfo=function(t){var n=this;var r=t.subjectPublicKey,e=t.algorithm;var i;if(e.algorithm===c&&e.parameters){i=f.parse(e.parameters,s)}if(e.algorithm===h){i=f.parse(r,l)}if(e.algorithm===v){i=f.parse(r,b);i=i.map((function(t){return n.getPublicKeyInfo(t)}))}var u=f.serialize(t);return{params:i,value:u,algorithm:e.algorithm}};Object.defineProperty(n.prototype,"publicKey",{get:function(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"signature",{get:function(){var t=this.asn,n=t.signatureValue,r=t.signatureAlgorithm;var e;if(r.algorithm===m){var i=f.parse(n,w);var u=f.parse(r.parameters,g);e=u.map((function(t,n){return Object.assign(Object.assign({},t),{value:i[n]})}))}return{params:e,value:n,algorithm:r.algorithm}},enumerable:false,configurable:true});n.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var n,r;if(t===void 0){t="SHA-1"}return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);return[4,y(t,this.raw)];case 1:n=e.sent();if(n){this.thumbprints[t]=i.ToHex(n)}return[3,3];case 2:r=e.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(n.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var n=this.subject[t];if(n.shortName==="CN"||n.shortName==="E"||n.shortName==="O"){return n.value}}return""},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"issuerCommonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var n=this.issuer[t];if(n.shortName==="CN"){return n.value}if(n.shortName==="E"){return n.value}}return""},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"isRoot",{get:function(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)},enumerable:false,configurable:true});n.prototype.subjectToString=function(){if(!this.subject){return""}return this.subject.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};n.prototype.issuerToString=function(){if(!this.issuer){return""}return this.issuer.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};n.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"hex":return p(i.ToHex(this.raw));case"pem":return"-----BEGIN ".concat(this.tag,"-----\n").concat(_(this.toString("base64")),"\n-----END ").concat(this.tag,"-----");default:return i.ToBase64(this.raw)}};n.prototype.downloadAsPEM=function(t){d.cert.asPEM(this.toString("pem"),t||this.commonName)};n.prototype.downloadAsDER=function(t){d.cert.asDER(this.raw,t||this.commonName)};return n}(n);t("X",O)}}}));
|
|
13
|
+
//# sourceMappingURL=p-05af3b74.system.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__extends","X509Certificate","_super","raw","_this","call","this","certificateRawToBuffer","Certificate","thumbprints","type","tag","tbsCertificate","asn","serialNumber","Convert","ToHex","subject","Name","toJSON","issuer","version","notBefore","validity","utcTime","generalTime","Error","notAfter","dateDiff","prototype","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","getPublicKeyInfo","publicKeyInfo","subjectPublicKey","algorithm","params","id_ecPublicKey","parameters","parse","ECParameters","id_rsaEncryption","RSAPublicKey","id_composite_key","CompositePublicKey","param","spki","value","Object","defineProperty","subjectPublicKeyInfo","_a","signatureValue","signatureAlgorithm","id_alg_composite","compositeSignatureValues_1","CompositeSignatureValue","compositeParams","CompositeParams","index","assign","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","i","length","name","shortName","JSON","stringify","subjectToString","concat","join","issuerToString","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","Download","cert","asPEM","commonName","downloadAsDER","asDER","AsnData"],"sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\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 { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = 'CERTIFICATE';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN') {\n return name.value;\n }\n\n if (name.shortName === 'E') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\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.toString('hex'),\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;mCAgDqCA,UAAAC,EAAAC,GAuBnC,SAAAD,EAAYE,GACV,IAAAC,EAAAF,EAAKG,KAAAC,KAACC,uBAAuBJ,GAAMK,cAAYF,KAP1CF,EAAAK,YAAsC,GAE7BL,EAAAM,KAAO,oBAEPN,EAAAO,IAAM,cAKZ,IAAAC,EAAmBR,EAAKS,IAAGD,eAEnCR,EAAKU,aAAeC,UAAQC,MAAMJ,EAAeE,cACjDV,EAAKa,QAAU,IAAIC,KAAKN,EAAeK,SAASE,SAChDf,EAAKgB,OAAS,IAAIF,KAAKN,EAAeQ,QAAQD,SAC9Cf,EAAKiB,QAAUT,EAAeS,QAAU,EAExC,IAAMC,EAAYV,EAAeW,SAASD,UAAUE,SAC/CZ,EAAeW,SAASD,UAAUG,YAEvC,IAAKH,EAAW,CACd,MAAM,IAAII,MAAM,+B,CAGlBtB,EAAKkB,UAAYA,EAEjB,IAAMK,EAAWf,EAAeW,SAASI,SAASH,SAC7CZ,EAAeW,SAASI,SAASF,YAEtC,IAAKE,EAAU,CACb,MAAM,IAAID,MAAM,8B,CAGlBtB,EAAKuB,SAAWA,EAChBvB,EAAKmB,SAAWK,SAASxB,EAAKkB,UAAWlB,EAAKuB,U,SAGzC1B,EAAA4B,UAAAC,gBAAA,WACG,IAAAlB,EAAmBN,KAAKO,IAAGD,eAEnC,GAAIA,EAAemB,WAAY,CAC7BzB,KAAKyB,WAAanB,EAAemB,WAC9BC,KAAI,SAACC,GAAM,WAAIC,UAAUC,WAAWC,UAAUH,GAAnC,G,GAIVhC,EAAA4B,UAAAQ,iBAAA,SAAiBC,GAAjB,IAAAlC,EAAAE,KACE,IAAAiC,EAAgCD,EAAaC,iBAA3BC,EAAcF,EAAaE,UACrD,IAAIC,EAEJ,GAAID,EAAUA,YAAcE,gBAAkBF,EAAUG,WAAY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AA,SAASC,GAAA,GAAAA,SAAA,GAAAA,EAAA,KAAwC,CACtD,OAAQA,GACN,IAAK,MACH,OAAOC,UAAUtE,UAAQC,MAAMV,KAAKH,MACtC,IAAK,MACH,MAAO,cAAA6E,OAAc1E,KAAKK,IAAG,WAAAqE,OAAUM,aAAahF,KAAK6E,SAAS,WAAU,eAAAH,OAAc1E,KAAKK,IAAG,SACpG,QACE,OAAOI,UAAQwE,SAASjF,KAAKH,K,EAI5BF,EAAA4B,UAAA2D,cAAA,SAAcb,GACnBc,SAASC,KAAKC,MACZrF,KAAK6E,SAAS,OACdR,GAAQrE,KAAKsF,W,EAIV3F,EAAA4B,UAAAgE,cAAA,SAAclB,GACnBc,SAASC,KAAKI,MACZxF,KAAK6E,SAAS,OACdR,GAAQrE,KAAKsF,W,YArNkBG,gB"}
|
|
1
|
+
{"version":3,"names":["__extends","X509Certificate","_super","raw","_this","call","this","certificateRawToBuffer","Certificate","thumbprints","type","tag","tbsCertificate","asn","serialNumber","Convert","ToHex","subject","Name","toJSON","issuer","version","notBefore","validity","utcTime","generalTime","Error","notAfter","dateDiff","prototype","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","getPublicKeyInfo","publicKeyInfo","subjectPublicKey","algorithm","params","id_ecPublicKey","parameters","parse","ECParameters","id_rsaEncryption","RSAPublicKey","id_composite_key","CompositePublicKey","param","spki","value","Object","defineProperty","subjectPublicKeyInfo","_a","signatureValue","signatureAlgorithm","id_alg_composite","compositeSignatureValues_1","CompositeSignatureValue","compositeParams","CompositeParams","index","assign","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","i","length","name","shortName","JSON","stringify","subjectToString","concat","join","issuerToString","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","Download","cert","asPEM","commonName","downloadAsDER","asDER","AsnData"],"sources":["src/crypto/x509_certificate.ts"],"sourcesContent":["/**\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 { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport {\n id_composite_key,\n id_alg_composite,\n CompositePublicKey,\n CompositeSignatureValue,\n CompositeParams,\n} from '@peculiar/asn1-x509-post-quantum';\nimport { Certificate, SubjectPublicKeyInfo } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { Name, INameJSON } from './name';\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\nexport interface ISignature {\n algorithm: string;\n value: BufferSource;\n params?: {\n algorithm: string;\n value: BufferSource;\n }[];\n}\n\nexport interface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey | IPublicKey[];\n}\n\nexport class X509Certificate extends AsnData<Certificate> {\n public readonly serialNumber: string;\n\n public readonly subject: INameJSON[];\n\n public readonly issuer: INameJSON[];\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public readonly version: number;\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate';\n\n public readonly tag = 'CERTIFICATE';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), Certificate);\n\n const { tbsCertificate } = this.asn;\n\n this.serialNumber = Convert.ToHex(tbsCertificate.serialNumber);\n this.subject = new Name(tbsCertificate.subject).toJSON();\n this.issuer = new Name(tbsCertificate.issuer).toJSON();\n this.version = tbsCertificate.version + 1;\n\n const notBefore = tbsCertificate.validity.notBefore.utcTime\n || tbsCertificate.validity.notBefore.generalTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = tbsCertificate.validity.notAfter.utcTime\n || tbsCertificate.validity.notAfter.generalTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n }\n\n public parseExtensions() {\n const { tbsCertificate } = this.asn;\n\n if (tbsCertificate.extensions) {\n this.extensions = tbsCertificate.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n private getPublicKeyInfo(publicKeyInfo: SubjectPublicKeyInfo) {\n const { subjectPublicKey, algorithm } = publicKeyInfo;\n let params;\n\n if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {\n params = AsnConvert.parse(algorithm.parameters, ECParameters);\n }\n\n if (algorithm.algorithm === id_rsaEncryption) {\n params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);\n }\n\n if (algorithm.algorithm === id_composite_key) {\n params = AsnConvert.parse(subjectPublicKey, CompositePublicKey);\n\n params = params.map((param) => this.getPublicKeyInfo(param));\n }\n\n const spki = AsnConvert.serialize(publicKeyInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\n };\n }\n\n public get publicKey(): IPublicKey {\n return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo);\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n let params;\n\n if (signatureAlgorithm.algorithm === id_alg_composite) {\n const compositeSignatureValues = AsnConvert.parse(signatureValue, CompositeSignatureValue);\n const compositeParams = AsnConvert.parse(signatureAlgorithm.parameters, CompositeParams);\n\n params = compositeParams.map((param, index) => ({\n ...param,\n value: compositeSignatureValues[index],\n }));\n }\n\n return {\n params,\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n if (!this.subject) {\n return '';\n }\n\n for (let i = 0; i < this.subject.length; i += 1) {\n const name = this.subject[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get issuerCommonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN') {\n return name.value;\n }\n\n if (name.shortName === 'E') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public get isRoot(): boolean {\n return JSON.stringify(this.issuer) === JSON.stringify(this.subject);\n }\n\n public subjectToString() {\n if (!this.subject) {\n return '';\n }\n\n return this.subject\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public issuerToString() {\n if (!this.issuer) {\n return '';\n }\n\n return this.issuer\n .map((name) => (\n `${name.shortName}=${name.value}`\n ))\n .join(', ');\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\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"],"mappings":";;;;;;;;;;;kBAgDqCA,UAAAC,EAAAC,GAuBnC,SAAAD,EAAYE,GACV,IAAAC,EAAAF,EAAKG,KAAAC,KAACC,EAAuBJ,GAAMK,IAAYF,KAP1CF,EAAAK,YAAsC,GAE7BL,EAAAM,KAAO,oBAEPN,EAAAO,IAAM,cAKZ,IAAAC,EAAmBR,EAAKS,IAAGD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KC,MACZrF,KAAK6E,SAAS,OACdR,GAAQrE,KAAKsF,W,EAIV3F,EAAA4B,UAAAgE,cAAA,SAAclB,GACnBc,EAASC,KAAKI,MACZxF,KAAKH,IACLwE,GAAQrE,KAAKsF,W,YArNkBG,G"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,u){function o(t){try{
|
|
1
|
+
var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)if(Object.prototype.hasOwnProperty.call(n,e))t[e]=n[e]};return t(n,e)};return function(n,e){if(typeof e!=="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}}();var __awaiter=this&&this.__awaiter||function(t,n,e,r){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,u){function o(t){try{a(r.next(t))}catch(t){u(t)}}function c(t){try{a(r["throw"](t))}catch(t){u(t)}}function a(t){t.done?e(t.value):i(t.value).then(o,c)}a((r=r.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},r,i,u,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(t){return function(n){return a([t,n])}}function a(c){if(r)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(e=0)),e)try{if(r=1,i&&(u=c[0]&2?i["return"]:c[0]?i["throw"]||((u=i["return"])&&u.call(i),0):i.next)&&!(u=u.call(i,c[1])).done)return u;if(i=0,u)c=[c[0]&2,u.value];switch(c[0]){case 0:case 1:u=c;break;case 4:e.label++;return{value:c[1],done:false};case 5:e.label++;i=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(u=e.trys,u=u.length>0&&u[u.length-1])&&(c[0]===6||c[0]===2)){e=0;continue}if(c[0]===3&&(!u||c[1]>u[0]&&c[1]<u[3])){e.label=c[1];break}if(c[0]===6&&e.label<u[1]){e.label=u[1];u=c;break}if(u&&e.label<u[2]){e.label=u[2];e.ops.push(c);break}if(u[2])e.ops.pop();e.trys.pop();continue}c=n.call(t,e)}catch(t){c=[6,t];i=0}finally{r=u=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-
|
|
4
|
+
*/System.register(["./p-d1066b51.system.js","./p-a06f51a2.system.js"],(function(t){"use strict";var n,e,r,i,u,o,c,a,s,f,h,l,v,b;return{setters:[function(t){n=t.A;e=t.v;r=t.X;i=t.C;u=t.L;o=t.G;c=t.y;a=t.F;s=t.H;f=t.J;h=t.D;l=t.Y;v=t.N},function(t){b=t.A}],execute:function(){
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -9,12 +9,12 @@ var __extends=this&&this.__extends||function(){var t=function(n,e){t=Object.setP
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var w=function(t){__extends(n,t);function n(n){var o;var c=t.call(this,e(n),r)||this;c.thumbprints={};c.type="X.509 Attribute Certificate";c.tag="ATTRIBUTE CERTIFICATE";var
|
|
12
|
+
var w=function(t){__extends(n,t);function n(n){var o;var c=t.call(this,e(n),r)||this;c.thumbprints={};c.type="X.509 Attribute Certificate";c.tag="ATTRIBUTE CERTIFICATE";var a=c.asn.acinfo;c.serialNumber=i.ToHex(a.serialNumber);c.version=a.version;var s=a.attrCertValidityPeriod.notBeforeTime;if(!s){throw new Error("Cannot get 'notBefore' value")}c.notBefore=s;var f=a.attrCertValidityPeriod.notAfterTime;if(!f){throw new Error("Cannot get 'notAfter' value")}c.notAfter=f;c.validity=u(c.notBefore,c.notAfter);c.issuer=a.issuer.v1Form||((o=a.issuer.v2Form)===null||o===void 0?void 0:o.issuerName);c.holder=a.holder;return c}Object.defineProperty(n.prototype,"signature",{get:function(){var t=this.asn,n=t.signatureValue,e=t.signatureAlgorithm;return{value:n,algorithm:e.algorithm}},enumerable:false,configurable:true});n.prototype.parseExtensions=function(){var t=this.asn.acinfo;if(t.extensions){this.extensions=t.extensions.map((function(t){return new o(c.serialize(t))}))}};n.prototype.parseAttributes=function(){var t=this.asn.acinfo;if(t.attributes){this.attributes=t.attributes.map((function(t){return new b(c.serialize(t))}))}};n.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var n,e;if(t===void 0){t="SHA-1"}return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,a(t,this.raw)];case 1:n=r.sent();if(n){this.thumbprints[t]=i.ToHex(n)}return[3,3];case 2:e=r.sent();console.error("Error thumbprint get:",e);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(n.prototype,"commonName",{get:function(){return"attribute-certificate-".concat(this.thumbprints["SHA-1"])},enumerable:false,configurable:true});n.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"hex":return f(i.ToHex(this.raw));case"pem":return"-----BEGIN ".concat(this.tag,"-----\n").concat(s(this.toString("base64")),"\n-----END ").concat(this.tag,"-----");default:return i.ToBase64(this.raw)}};n.prototype.downloadAsPEM=function(t){h.attrCert.asPEM(this.toString("pem"),t||this.commonName)};n.prototype.downloadAsDER=function(t){h.attrCert.asDER(this.raw,t||this.commonName)};return n}(n);t("X",w);
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var m=function(t){__extends(n,t);function n(n){var r=t.call(this,e(n),l)||this;r.thumbprints={};r.type="X.509 Certificate Revocation List";r.tag="X509 CRL";var i=r.asn.tbsCertList;r.issuer=new v(i.issuer).toJSON();r.version=i.version+1;r.lastUpdate=i.thisUpdate.getTime();r.nextUpdate=i.nextUpdate.getTime();r.revokedCertificates=(i.revokedCertificates||[]).map((function(t){var n;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(n=t.crlEntryExtensions)===null||n===void 0?void 0:n.map((function(t){return new o(c.serialize(t))}))}}));return r}n.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var n,e;if(t===void 0){t="SHA-1"}return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,
|
|
20
|
-
//# sourceMappingURL=p-
|
|
19
|
+
*/var m=function(t){__extends(n,t);function n(n){var r=t.call(this,e(n),l)||this;r.thumbprints={};r.type="X.509 Certificate Revocation List";r.tag="X509 CRL";var i=r.asn.tbsCertList;r.issuer=new v(i.issuer).toJSON();r.version=i.version+1;r.lastUpdate=i.thisUpdate.getTime();r.nextUpdate=i.nextUpdate.getTime();r.revokedCertificates=(i.revokedCertificates||[]).map((function(t){var n;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(n=t.crlEntryExtensions)===null||n===void 0?void 0:n.map((function(t){return new o(c.serialize(t))}))}}));return r}n.prototype.getThumbprint=function(){return __awaiter(this,arguments,void 0,(function(t){var n,e;if(t===void 0){t="SHA-1"}return __generator(this,(function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);return[4,a(t,this.raw)];case 1:n=r.sent();if(n){this.thumbprints[t]=i.ToHex(n)}return[3,3];case 2:e=r.sent();console.error("Error thumbprint get:",e);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(n.prototype,"signature",{get:function(){var t=this.asn,n=t.signature,e=t.signatureAlgorithm;return{value:n,algorithm:e.algorithm}},enumerable:false,configurable:true});Object.defineProperty(n.prototype,"commonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var n=this.issuer[t];if(n.shortName==="CN"||n.shortName==="E"||n.shortName==="O"){return n.value}}return""},enumerable:false,configurable:true});n.prototype.parseExtensions=function(){var t=this.asn.tbsCertList;if(t.crlExtensions){this.extensions=t.crlExtensions.map((function(t){return new o(c.serialize(t))}))}};n.prototype.toString=function(t){if(t===void 0){t="pem"}switch(t){case"hex":return f(i.ToHex(this.raw));case"pem":return"-----BEGIN ".concat(this.tag,"-----\n").concat(s(this.toString("base64")),"\n-----END ").concat(this.tag,"-----");default:return i.ToBase64(this.raw)}};n.prototype.downloadAsPEM=function(t){h.crl.asPEM(this.toString("pem"),t||this.commonName)};n.prototype.downloadAsDER=function(t){h.crl.asDER(this.raw,t||this.commonName)};return n}(n);t("a",m)}}}));
|
|
20
|
+
//# sourceMappingURL=p-163a3052.system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__extends","X509AttributeCertificate","_super","raw","_this","call","this","certificateRawToBuffer","AttributeCertificate","thumbprints","type","tag","acinfo","asn","serialNumber","Convert","ToHex","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","Object","defineProperty","prototype","_b","signatureValue","signatureAlgorithm","value","algorithm","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","parseAttributes","attributes","Attribute","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","concat","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","name","Download","attrCert","asPEM","commonName","downloadAsDER","asDER","AsnData","X509Crl","CertificateList","tbsCertList","Name","toJSON","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","error_2","signature","i","length","shortName","crlExtensions","crl"],"sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\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 { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = 'ATTRIBUTE CERTIFICATE';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\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 */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = 'X509 CRL';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;kBA8B8CA,UAAAC,EAAAC,GAyB5C,SAAAD,EAAYE,G,MACV,IAAAC,EAAAF,EAAKG,KAAAC,KAACC,EAAuBJ,GAAMK,IAAqBF,KAXnDF,EAAAK,YAAsC,GAM7BL,EAAAM,KAAO,8BAEPN,EAAAO,IAAM,wBAKZ,IAAAC,EAAWR,EAAKS,IAAGD,OAE3BR,EAAKU,aAAeC,EAAQC,MAAMJ,EAAOE,cACzCV,EAAKa,QAAUL,EAAOK,QAEtB,IAAMC,EAAYN,EAAOO,uBAAuBC,cAEhD,IAAKF,EAAW,CACd,MAAM,IAAIG,MAAM,+B,CAGlBjB,EAAKc,UAAYA,EAEjB,IAAMI,EA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xD,KAAKH,K,EAI5BqE,EAAAtC,UAAA6B,cAAA,SAAcC,GACnBC,EAAS2B,IAAIzB,MACX7D,KAAKoD,SAAS,OACdM,GAAQ1D,KAAK8D,W,EAIVI,EAAAtC,UAAAmC,cAAA,SAAcL,GACnBC,EAAS2B,IAAItB,MACXhE,KAAKH,IACL6D,GAAQ1D,KAAK8D,W,YA3GUG,G"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(t,e,r,a){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function n(t){try{c(a.next(t))}catch(t){i(t)}}function s(t){try{c(a["throw"](t))}catch(t){i(t)}}function c(t){t.done?r(t.value):o(t.value).then(n,s)}c((a=a.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(t){return function(e){return c([t,e])}}function c(s){if(a)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(a=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){r.label=s[1];break}if(s[0]===6&&r.label<i[1]){r.label=i[1];i=s;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(s);break}if(i[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-821bdcdc.system.js","./p-
|
|
4
|
+
*/System.register(["./p-821bdcdc.system.js","./p-d1066b51.system.js","./p-163a3052.system.js","./p-52f13c4a.system.js","./p-9712b827.system.js","./p-a06f51a2.system.js","./p-243244af.system.js","./p-8bbee8f4.system.js"],(function(t){"use strict";var e,r,a,o,i,n,s,c,v,p,l,h,d,g,u,b,f,y,w,m,x,z,k,L,I,j,S,N,_,A,K,D,P,E,C,O,T,H,V;return{setters:[function(t){e=t.h;r=t.r;a=t.H},function(t){o=t.$;i=t.Z;n=t.a0;s=t.n;c=t.W;v=t.I;p=t.T;l=t.V;h=t.U;d=t.s;g=t.C;u=t._;b=t.a1;f=t.a2;y=t.a3},function(t){w=t.X;m=t.a},function(t){x=t.g;z=t.R;k=t.c;L=t.T;I=t.G;j=t.a;S=t.B;N=t.S;_=t.b;A=t.d;K=t.e;D=t.f;P=t.E;E=t.M;C=t.I;O=t.h;T=t.P},function(t){H=t.T},function(t){V=t.P},function(){},function(){}],execute:function(){
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -108,4 +108,4 @@ var q=function(t,r){var a=t.attribute;return[e(z,{name:"Name",value:x(a.asn.type
|
|
|
108
108
|
* This source code is licensed under the MIT license found in the
|
|
109
109
|
* LICENSE file in the root directory of this source tree.
|
|
110
110
|
*/var et=function(t){var r=t.issuer;if(!r){return null}return[e(j,{value:i.getString("issuer")}),r.map((function(t){return e(I,{generalName:t,getDNSNameLink:function(){return""},getIPAddressLink:function(){return""}})}))]};var rt="*{-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 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}";var at=rt;var ot=t("peculiar_attribute_certificate_viewer",function(){function t(t){var e=this;r(this,t);this.getAuthKeyIdParentLink=function(t){var r;return(r=e.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var r;return(r=e.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getSubjectKeyIdChildrenLink=function(t){var r;return(r=e.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var r;return(r=e.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof w){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new w(t)}else{return[2]}this.certificateDecoded.parseExtensions();this.certificateDecoded.parseAttributes();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof w&&e instanceof w){if(t.serialNumber!==e.serialNumber){this.decodeCertificate(t)}}};t.prototype.renderErrorState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There was an error decoding this attribute certificate."))};t.prototype.renderEmptyState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There is no attribute certificate available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return e(a,{"data-mobile-screen-view":String(this.mobileScreenView)},e("table",null,e(S,Object.assign({},this.certificateDecoded)),e(et,{issuer:this.certificateDecoded.issuer}),e(tt,{holder:this.certificateDecoded.holder}),e(N,{signature:this.certificateDecoded.signature}),e(_,{thumbprints:this.certificateDecoded.thumbprints}),e(Z,{attributes:this.certificateDecoded.attributes,getLEILink:A,getDNSNameLink:K,getIPAddressLink:D,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),e(P,{extensions:this.certificateDecoded.extensions,getLEILink:A,getDNSNameLink:K,getIPAddressLink:D,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&e(E,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}());ot.style=at;var it="*{-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 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}";var nt=it;var st=t("peculiar_crl_viewer",function(){function t(t){var e=this;r(this,t);this.getAuthKeyIdParentLink=function(t){var r;return(r=e.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.getAuthKeyIdSiblingsLink=function(t){var r;return(r=e.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",t)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.issuerDnLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof m){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new m(t)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.getIssuerDnLink=function(){return this.issuerDnLink};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof m&&e instanceof m){if(t.commonName!==e.commonName){this.decodeCertificate(t)}}};t.prototype.renderErrorState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There was an error decoding this certificate revocation list."))};t.prototype.renderEmptyState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There is no certificate revocation list available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return e(a,{"data-mobile-screen-view":String(this.mobileScreenView)},e("table",null,e(S,Object.assign({},this.certificateDecoded)),e(C,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),e(N,{signature:this.certificateDecoded.signature}),e(_,{thumbprints:this.certificateDecoded.thumbprints}),e(P,{extensions:this.certificateDecoded.extensions,getLEILink:A,getDNSNameLink:K,getIPAddressLink:D,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink}),e($,{revokedCertificates:this.certificateDecoded.revokedCertificates,getDNSNameLink:K,getIPAddressLink:D}),this.download&&e(E,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}());st.style=nt;var ct="*{-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 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}";var vt=ct;var pt=t("peculiar_csr_viewer",function(){function t(t){var e=this;r(this,t);this.getAuthKeyIdParentLink=function(t){return t};this.getAuthKeyIdSiblingsLink=function(t){return t};this.getSubjectKeyIdChildrenLink=function(t){var r;return(r=e.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.getSubjectKeyIdSiblingsLink=function(t){var r;return(r=e.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",t)};this.certificate=undefined;this.download=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}t.prototype.handleMediaQueryChange=function(t){this.mobileScreenView=t.matches};t.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};t.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};t.prototype.decodeCertificate=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(t instanceof V){this.certificateDecoded=t}else if(typeof t==="string"){this.certificateDecoded=new V(t)}else{return[2]}this.certificateDecoded.parseAttributes();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:e=r.sent();this.certificateDecodeError=e;console.error("Error certificate parse:",e);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};t.prototype.watchCertificateAndDecode=function(t,e){if(typeof t==="string"&&typeof e==="string"){if(t!==e){this.decodeCertificate(t)}return}if(t instanceof V&&e instanceof V){if(t.commonName!==e.commonName){this.decodeCertificate(t)}}};t.prototype.renderErrorState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There was an error decoding this certificate request."))};t.prototype.renderEmptyState=function(){return e("div",{class:"status_wrapper"},e(H,null,"There is no certificate request available."))};t.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return e(a,{"data-mobile-screen-view":String(this.mobileScreenView)},e("table",null,e(S,Object.assign({},this.certificateDecoded)),e(O,{name:this.certificateDecoded.subject}),e(T,{publicKey:this.certificateDecoded.publicKey}),e(N,{signature:this.certificateDecoded.signature}),e(_,{thumbprints:this.certificateDecoded.thumbprints}),e(Z,{attributes:this.certificateDecoded.attributes,getLEILink:A,getDNSNameLink:K,getIPAddressLink:D,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),e(P,{extensions:this.certificateDecoded.extensions,title:"Extension Request",getLEILink:A,getDNSNameLink:K,getIPAddressLink:D,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&e(E,{certificate:this.certificateDecoded})))};Object.defineProperty(t,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return t}());pt.style=vt}}}));
|
|
111
|
-
//# sourceMappingURL=p-
|
|
111
|
+
//# sourceMappingURL=p-2d9c40d6.system.entry.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import{r as e,c as t,h as r,H as a}from"./p-3cb79cd9.js";import{a as o}from"./p-25a532a3.js";import"./p-666438a8.js";import{X as c}from"./p-80477c05.js";import{X as s,a as i}from"./p-5a699274.js";import{P as n}from"./p-b6d5e413.js";import{T as v,B as p}from"./p-4bc5ddbe.js";const l="*{-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%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";const h=l;const d=class{constructor(r){e(this,r);this.successParse=t(this,"successParse",7);this.clearCertificate=t(this,"clearCertificate",7);this.handleClickDecode=()=>{const{value:e}=this.inputPaste;if(e){this.decode(e)}};this.handleClickClear=()=>{this.clearValue()};this.handleChangeInputFile=async e=>{const t=e.target;if(t.files){const e=await o(t.files[0]);if(typeof e.value==="string"){this.decode(e.value)}t.value=""}};this.handleChangeExample=e=>{if(e.target.value){this.decode(e.target.value)}else{this.clearValue()}};this.handleDropFile=async e=>{e.stopPropagation();e.preventDefault();const t=e.dataTransfer;if(t.files){const e=await o(t.files[0]);if(typeof e.value==="string"){this.decode(e.value)}}};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}componentDidLoad(){if(this.defaultCertificate){setTimeout((()=>this.decode(this.defaultCertificate)),100)}}clearValue(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()}setValue(e){this.certificateDecoded=e;this.inputPaste.value=e.toString("pem");this.successParse.emit(e.toString("base64"))}decode(e){new Promise((t=>{t(new c(e))})).catch((()=>new s(e))).catch((()=>new n(e))).catch((()=>new i(e))).then((e=>this.setValue(e))).catch((e=>{this.clearValue();console.log(e);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}))}render(){var e;return r(a,{key:"7c3bfca68882e39705e9640f76754cce2e5d6c6a"},r("textarea",{key:"4d24f4b914f7f118efde2144e7597e0767d59ce8",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:e=>{this.inputPaste=e},onDrop:this.handleDropFile}),r("div",{key:"06ba6e2b5658225a585ec9711e6f3f945ef3a840",class:"controls"},r("div",{key:"df2e115ea04d4eae7985f6ee57bfe47354f50240",class:"control_row"},r(v,{key:"05c30b2956055455cdb1f52b40995752dd0d7da4",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),r("input",{key:"cca59d7c59d9917e728f9795bcfbd546d4cf75b8",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&r("div",{class:"control_row"},r(v,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),r("select",{onChange:this.handleChangeExample},r("option",{value:""},"None"),this.certificateExamples.map((e=>r("option",{value:e.value},e.title))))),r("div",{key:"6d1f010e03d7836459214e5c0abe1af7fbbe2a10",class:"control_row"},r(p,{key:"4038db36b62ff11f592f380f5c98bebb0014585e",onClick:this.handleClickDecode},"Decode"),r(p,{key:"fb7c30e61b10194b5f02a2cefa06191904f5ce46",onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof c&&r("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof s&&r("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof n&&r("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof i&&r("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))}};d.style=h;export{d as peculiar_certificate_decoder};
|
|
5
|
+
//# sourceMappingURL=p-494d26fb.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["certificateDecoderCss","PeculiarCertificateDecoderStyle0","CertificateDecoder","this","handleClickDecode","value","inputPaste","decode","handleClickClear","clearValue","handleChangeInputFile","async","event","element","target","files","file","readAsBinaryString","handleChangeExample","handleDropFile","stopPropagation","preventDefault","dataTransfer","componentDidLoad","defaultCertificate","setTimeout","certificateDecoded","clearCertificate","emit","setValue","toString","successParse","certificate","Promise","resolve","X509Certificate","catch","X509AttributeCertificate","Pkcs10CertificateRequest","X509Crl","then","res","err","console","log","alert","render","h","Host","key","placeholder","class","ref","el","onDrop","Typography","variant","color","type","accept","onChange","_a","certificateExamples","length","map","example","title","Button","onClick","download"],"sources":["src/components/certificate-decoder/certificate-decoder.scss?tag=peculiar-certificate-decoder&encapsulation=shadow","src/components/certificate-decoder/certificate-decoder.tsx"],"sourcesContent":["@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.viewer {\n margin-top: var(--pv-size-base-12);\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}\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';\n\nimport { readAsBinaryString } from '../../utils';\nimport {\n X509Certificate,\n X509AttributeCertificate,\n Pkcs10CertificateRequest,\n X509Crl,\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() defaultCertificate?: string;\n\n @State() certificateDecoded: X509Certificate\n | X509AttributeCertificate\n | Pkcs10CertificateRequest\n | X509Crl;\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.defaultCertificate) {\n /**\n * Prevent Stencil warning about re-render\n */\n setTimeout(() => this.decode(this.defaultCertificate), 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 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 private handleChangeExample = (event: any) => {\n if (event.target.value) {\n this.decode(event.target.value);\n } else {\n this.clearValue();\n }\n };\n\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 setValue(value: typeof this.certificateDecoded) {\n this.certificateDecoded = value;\n this.inputPaste.value = value.toString('pem');\n this.successParse.emit(value.toString('base64'));\n }\n\n decode(certificate: string) {\n new Promise((resolve) => {\n resolve(new X509Certificate(certificate));\n })\n .catch(() => new X509AttributeCertificate(certificate))\n .catch(() => new Pkcs10CertificateRequest(certificate))\n .catch(() => new X509Crl(certificate))\n .then((res: typeof this.certificateDecoded) => this.setValue(res))\n .catch((err) => {\n this.clearValue();\n\n console.log(err);\n alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.');\n });\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\"\n onChange={this.handleChangeInputFile}\n value=\"\"\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.certificateDecoded instanceof X509Certificate && (\n <peculiar-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509AttributeCertificate && (\n <peculiar-attribute-certificate-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof Pkcs10CertificateRequest && (\n <peculiar-csr-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n {this.certificateDecoded instanceof X509Crl && (\n <peculiar-crl-viewer\n certificate={this.certificateDecoded}\n class=\"viewer\"\n download\n />\n )}\n </Host>\n );\n }\n}\n"],"mappings":";;;mRAAA,MAAMA,EAAwB,knQAC9B,MAAAC,EAAeD,E,MCgCFE,EAAkB,M,uHAwCrBC,KAAAC,kBAAoB,KAC1B,MAAMC,MAAEA,GAAUF,KAAKG,WAEvB,GAAID,EAAO,CACTF,KAAKI,OAAOF,E,GAIRF,KAAAK,iBAAmB,KACzBL,KAAKM,YAAY,EAGXN,KAAAO,sBAAwBC,MAAOC,IACrC,MAAMC,EAAUD,EAAME,OAEtB,GAAID,EAAQE,MAAO,CACjB,MAAMC,QAAaC,EAAmBJ,EAAQE,MAAM,IAEpD,UAAWC,EAAKX,QAAU,SAAU,CAClCF,KAAKI,OAAOS,EAAKX,M,CAGnBQ,EAAQR,MAAQ,E,GAIZF,KAAAe,oBAAuBN,IAC7B,GAAIA,EAAME,OAAOT,MAAO,CACtBF,KAAKI,OAAOK,EAAME,OAAOT,M,KACpB,CACLF,KAAKM,Y,GAIDN,KAAAgB,eAAiBR,MAAOC,IAC9BA,EAAMQ,kBACNR,EAAMS,iBAEN,MAAMR,EAAUD,EAAMU,aAEtB,GAAIT,EAAQE,MAAO,CACjB,M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AAKI,MAAM,eACTJ,EAACQ,EAAU,CACTC,QAAQ,KACRC,MAAM,oBAAkB,kBAI1BV,EAAA,UAAQa,SAAUzD,KAAKe,qBACrB6B,EAAA,UAAQ1C,MAAM,IAAE,QACfF,KAAK2D,oBAAoBE,KAAKC,GAC7BlB,EAAA,UAAQ1C,MAAO4D,EAAQ5D,OACpB4D,EAAQC,WAMnBnB,EAAA,OAAAE,IAAA,2CAAKE,MAAM,eACTJ,EAACoB,EAAM,CAAAlB,IAAA,2CACLmB,QAASjE,KAAKC,mBAAiB,UAIjC2C,EAACoB,EAAM,CAAAlB,IAAA,2CACLmB,QAASjE,KAAKK,kBAAgB,WAMnCL,KAAKuB,8BAA8BS,GAClCY,EAAA,+BACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8BW,GAClCU,EAAA,yCACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8BY,GAClCS,EAAA,uBACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,OAGXlE,KAAKuB,8BAA8Ba,GAClCQ,EAAA,uBACEf,YAAa7B,KAAKuB,mBAClByB,MAAM,SACNkB,SAAQ,O"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __extends=this&&this.__extends||function(){var e=function(n,a){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var a in n)if(Object.prototype.hasOwnProperty.call(n,a))e[a]=n[a]};return e(n,a)};return function(n,a){if(typeof a!=="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(n,a);function r(){this.constructor=n}n.prototype=a===null?Object.create(a):(r.prototype=a.prototype,new r)}}();
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/System.register(["./p-821bdcdc.system.js","./p-
|
|
4
|
+
*/System.register(["./p-821bdcdc.system.js","./p-d1066b51.system.js","./p-243244af.system.js","./p-9712b827.system.js","./p-8bbee8f4.system.js"],(function(e){"use strict";var n,a,r,t,c,u,f,i,o,l,d,b,s,v,m,p,g,x,y,h,C,S,N,A,j,I,D,O,T,G,P,R,V,k,_,L,B,E,U,w,H,M,X,Y,q,K,Q,W,z,F,Z,$,J,ee,ne,ae,re,te,ce,ue,fe,ie,oe;return{setters:[function(e){n=e.h},function(e){a=e.$;r=e.Z;t=e._;c=e.C;u=e.a0;f=e.a4;i=e.b;o=e.a5;l=e.a6;d=e.a7;b=e.a8;s=e.a9;v=e.aa;m=e.ab;p=e.ac;g=e.ad;x=e.ae;y=e.af;h=e.ag;C=e.ah;S=e.ai;N=e.aj;A=e.ak;j=e.al;I=e.am;D=e.an;O=e.ao;T=e.ap;G=e.aq;P=e.ar;R=e.as;V=e.at;k=e.au;_=e.av;L=e.aw;B=e.ax;E=e.ay;U=e.az;w=e.aA;H=e.aB;M=e.aC;X=e.aD;Y=e.aE;q=e.aF;K=e.aG;Q=e.a1;W=e.aH;z=e.aI;F=e.aJ;Z=e.aK;$=e.aL;J=e.aM;ee=e.aN;ne=e.aO;ae=e.aP;re=e.aQ;te=e.aR;ce=e.aS},function(e){ue=e.L},function(e){fe=e.T;ie=e.B},function(e){oe=e.D}],execute:function(){e({c:de,g:le});
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -366,4 +366,4 @@ var __extends=this&&this.__extends||function(){var e=function(n,a){e=Object.setP
|
|
|
366
366
|
* This source code is licensed under the MIT license found in the
|
|
367
367
|
* LICENSE file in the root directory of this source tree.
|
|
368
368
|
*/var Rn=e("M",(function(e){var a=e.certificate;return[n(ge,{value:r.getString("miscellaneous")}),n("tr",null,n("td",null,n(ie,{onClick:function(){return a.downloadAsPEM()},startIcon:n(oe,null)},r.getString("download.pem")))),n("tr",null,n("td",null,n(ie,{onClick:function(){return a.downloadAsDER()},startIcon:n(oe,null)},r.getString("download.der"))))]}))}}}));
|
|
369
|
-
//# sourceMappingURL=p-
|
|
369
|
+
//# sourceMappingURL=p-52f13c4a.system.js.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
3
|
*/
|
|
4
|
-
import{A as t,v as s,
|
|
4
|
+
import{A as t,v as s,X as i,C as e,L as r,G as n,y as a,F as h,H as o,J as c,D as u,Y as l,N as m}from"./p-666438a8.js";import{A as f}from"./p-b6d5e413.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license
|
|
7
7
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/class g extends t{constructor(t){var n;super(s(t),i);this.thumbprints={};this.type="X.509 Attribute Certificate";this.tag="ATTRIBUTE CERTIFICATE";const{acinfo:a}=this.asn;this.serialNumber=e.ToHex(a.serialNumber);this.version=a.version;const h=a.attrCertValidityPeriod.notBeforeTime;if(!h){throw new Error("Cannot get 'notBefore' value")}this.notBefore=h;const o=a.attrCertValidityPeriod.notAfterTime;if(!o){throw new Error("Cannot get 'notAfter' value")}this.notAfter=o;this.validity=r(this.notBefore,this.notAfter);this.issuer=a.issuer.v1Form||((n=a.issuer.v2Form)===null||n===void 0?void 0:n.issuerName);this.holder=a.holder}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}parseExtensions(){const{acinfo:t}=this.asn;if(t.extensions){this.extensions=t.extensions.map((t=>new n(a.serialize(t))))}}parseAttributes(){const{acinfo:t}=this.asn;if(t.attributes){this.attributes=t.attributes.map((t=>new f(a.serialize(t))))}}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.attrCert.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.attrCert.asDER(this.
|
|
11
|
+
*/class g extends t{constructor(t){var n;super(s(t),i);this.thumbprints={};this.type="X.509 Attribute Certificate";this.tag="ATTRIBUTE CERTIFICATE";const{acinfo:a}=this.asn;this.serialNumber=e.ToHex(a.serialNumber);this.version=a.version;const h=a.attrCertValidityPeriod.notBeforeTime;if(!h){throw new Error("Cannot get 'notBefore' value")}this.notBefore=h;const o=a.attrCertValidityPeriod.notAfterTime;if(!o){throw new Error("Cannot get 'notAfter' value")}this.notAfter=o;this.validity=r(this.notBefore,this.notAfter);this.issuer=a.issuer.v1Form||((n=a.issuer.v2Form)===null||n===void 0?void 0:n.issuerName);this.holder=a.holder}get signature(){const{signatureValue:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}parseExtensions(){const{acinfo:t}=this.asn;if(t.extensions){this.extensions=t.extensions.map((t=>new n(a.serialize(t))))}}parseAttributes(){const{acinfo:t}=this.asn;if(t.attributes){this.attributes=t.attributes.map((t=>new f(a.serialize(t))))}}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get commonName(){return`attribute-certificate-${this.thumbprints["SHA-1"]}`}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.attrCert.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.attrCert.asDER(this.raw,t||this.commonName)}}
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/class p extends t{constructor(t){super(s(t),l);this.thumbprints={};this.type="X.509 Certificate Revocation List";this.tag="X509 CRL";const{tbsCertList:i}=this.asn;this.issuer=new m(i.issuer).toJSON();this.version=i.version+1;this.lastUpdate=i.thisUpdate.getTime();this.nextUpdate=i.nextUpdate.getTime();this.revokedCertificates=(i.revokedCertificates||[]).map((t=>{var s;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(s=t.crlEntryExtensions)===null||s===void 0?void 0:s.map((t=>new n(a.serialize(t))))}}))}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get signature(){const{signature:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}get commonName(){if(!this.issuer){return""}for(let t=0;t<this.issuer.length;t+=1){const s=this.issuer[t];if(s.shortName==="CN"||s.shortName==="E"||s.shortName==="O"){return s.value}}return""}parseExtensions(){const{tbsCertList:t}=this.asn;if(t.crlExtensions){this.extensions=t.crlExtensions.map((t=>new n(a.serialize(t))))}}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.crl.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.crl.asDER(this.
|
|
19
|
-
//# sourceMappingURL=p-
|
|
18
|
+
*/class p extends t{constructor(t){super(s(t),l);this.thumbprints={};this.type="X.509 Certificate Revocation List";this.tag="X509 CRL";const{tbsCertList:i}=this.asn;this.issuer=new m(i.issuer).toJSON();this.version=i.version+1;this.lastUpdate=i.thisUpdate.getTime();this.nextUpdate=i.nextUpdate.getTime();this.revokedCertificates=(i.revokedCertificates||[]).map((t=>{var s;return{revocationDate:t.revocationDate,userCertificate:t.userCertificate,crlEntryExtensions:(s=t.crlEntryExtensions)===null||s===void 0?void 0:s.map((t=>new n(a.serialize(t))))}}))}async getThumbprint(t="SHA-1"){try{const s=await h(t,this.raw);if(s){this.thumbprints[t]=e.ToHex(s)}}catch(t){console.error("Error thumbprint get:",t)}}get signature(){const{signature:t,signatureAlgorithm:s}=this.asn;return{value:t,algorithm:s.algorithm}}get commonName(){if(!this.issuer){return""}for(let t=0;t<this.issuer.length;t+=1){const s=this.issuer[t];if(s.shortName==="CN"||s.shortName==="E"||s.shortName==="O"){return s.value}}return""}parseExtensions(){const{tbsCertList:t}=this.asn;if(t.crlExtensions){this.extensions=t.crlExtensions.map((t=>new n(a.serialize(t))))}}toString(t="pem"){switch(t){case"hex":return c(e.ToHex(this.raw));case"pem":return`-----BEGIN ${this.tag}-----\n${o(this.toString("base64"))}\n-----END ${this.tag}-----`;default:return e.ToBase64(this.raw)}}downloadAsPEM(t){u.crl.asPEM(this.toString("pem"),t||this.commonName)}downloadAsDER(t){u.crl.asDER(this.raw,t||this.commonName)}}export{g as X,p as a};
|
|
19
|
+
//# sourceMappingURL=p-5a699274.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["X509AttributeCertificate","AsnData","constructor","raw","super","certificateRawToBuffer","AttributeCertificate","this","thumbprints","type","tag","acinfo","asn","serialNumber","Convert","ToHex","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","signature","signatureValue","signatureAlgorithm","value","algorithm","parseExtensions","extensions","map","e","Extension","AsnConvert","serialize","parseAttributes","attributes","Attribute","getThumbprint","thumbprint","getCertificateThumbprint","error","console","commonName","toString","format","hexFormat","base64Format","ToBase64","downloadAsPEM","name","Download","attrCert","asPEM","downloadAsDER","asDER","X509Crl","CertificateList","tbsCertList","Name","toJSON","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","i","length","shortName","crlExtensions","crl"],"sources":["src/crypto/x509_attribute_certificate.ts","src/crypto/x509_crl.ts"],"sourcesContent":["/**\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 { AsnConvert } from '@peculiar/asn1-schema';\nimport type { GeneralName } from '@peculiar/asn1-x509';\nimport { AttributeCertificate, Holder } from '@peculiar/asn1-x509-attr';\nimport { Convert } from 'pvtsutils';\n\nimport { dateDiff, Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Extension, TExtensionValue } from './extension';\nimport { Attribute, TAttributeValue } from './attribute';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport class X509AttributeCertificate extends AsnData<AttributeCertificate> {\n public readonly serialNumber: string;\n\n public readonly version: number;\n\n public readonly notBefore: Date;\n\n public readonly notAfter: Date;\n\n public readonly validity: string;\n\n public extensions: Extension<TExtensionValue>[];\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly issuer: GeneralName[];\n\n public holder: Holder;\n\n public readonly type = 'X.509 Attribute Certificate';\n\n public readonly tag = 'ATTRIBUTE CERTIFICATE';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), AttributeCertificate);\n\n const { acinfo } = this.asn;\n\n this.serialNumber = Convert.ToHex(acinfo.serialNumber);\n this.version = acinfo.version;\n\n const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;\n\n if (!notBefore) {\n throw new Error(\"Cannot get 'notBefore' value\");\n }\n\n this.notBefore = notBefore;\n\n const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;\n\n if (!notAfter) {\n throw new Error(\"Cannot get 'notAfter' value\");\n }\n\n this.notAfter = notAfter;\n this.validity = dateDiff(this.notBefore, this.notAfter);\n this.issuer = acinfo.issuer.v1Form || acinfo.issuer.v2Form?.issuerName;\n this.holder = acinfo.holder;\n }\n\n public get signature(): ISignature {\n const { signatureValue, signatureAlgorithm } = this.asn;\n\n return {\n value: signatureValue,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public parseExtensions() {\n const { acinfo } = this.asn;\n\n if (acinfo.extensions) {\n this.extensions = acinfo.extensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public parseAttributes() {\n const { acinfo } = this.asn;\n\n if (acinfo.attributes) {\n this.attributes = acinfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.raw,\n name || this.commonName,\n );\n }\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 */\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { CertificateList, Time } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\nimport {\n certificateRawToBuffer,\n hexFormat,\n base64Format,\n getCertificateThumbprint,\n} from './utils';\n\ninterface ISignature {\n algorithm: string;\n value: BufferSource;\n}\n\nexport interface IRevokedCertificate {\n userCertificate: ArrayBuffer;\n revocationDate: Time;\n crlEntryExtensions?: Extension<TExtensionValue>[];\n}\n\nexport class X509Crl extends AsnData<CertificateList> {\n public readonly issuer: INameJSON[];\n\n public readonly version: number;\n\n public readonly lastUpdate: Date;\n\n public readonly nextUpdate: Date;\n\n public extensions: Extension<TExtensionValue>[];\n\n public revokedCertificates: IRevokedCertificate[];\n\n public thumbprints: Record<string, string> = {};\n\n public readonly type = 'X.509 Certificate Revocation List';\n\n public readonly tag = 'X509 CRL';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificateList);\n\n const { tbsCertList } = this.asn;\n\n this.issuer = new Name(tbsCertList.issuer).toJSON();\n this.version = tbsCertList.version + 1;\n this.lastUpdate = tbsCertList.thisUpdate.getTime();\n this.nextUpdate = tbsCertList.nextUpdate.getTime();\n\n this.revokedCertificates = (tbsCertList.revokedCertificates || [])\n .map((revokedCertificate) => ({\n revocationDate: revokedCertificate.revocationDate,\n userCertificate: revokedCertificate.userCertificate,\n crlEntryExtensions: revokedCertificate.crlEntryExtensions\n ?.map((e) => new Extension(AsnConvert.serialize(e))),\n }));\n }\n\n public async getThumbprint(\n algorithm: string = 'SHA-1',\n ): Promise<void> {\n try {\n const thumbprint = await getCertificateThumbprint(algorithm, this.raw);\n\n if (thumbprint) {\n this.thumbprints[algorithm] = Convert.ToHex(thumbprint);\n }\n } catch (error) {\n console.error('Error thumbprint get:', error);\n }\n }\n\n public get signature(): ISignature {\n const { signature, signatureAlgorithm } = this.asn;\n\n return {\n value: signature,\n algorithm: signatureAlgorithm.algorithm,\n };\n }\n\n public get commonName(): string {\n if (!this.issuer) {\n return '';\n }\n\n for (let i = 0; i < this.issuer.length; i += 1) {\n const name = this.issuer[i];\n\n if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {\n return name.value;\n }\n }\n\n return '';\n }\n\n public parseExtensions() {\n const { tbsCertList } = this.asn;\n\n if (tbsCertList.crlExtensions) {\n this.extensions = tbsCertList.crlExtensions\n .map((e) => new Extension(AsnConvert.serialize(e)));\n }\n }\n\n public toString(format: 'hex' | 'pem' | 'base64' = 'pem'): string {\n switch (format) {\n case 'hex':\n return hexFormat(Convert.ToHex(this.raw));\n case 'pem':\n return `-----BEGIN ${this.tag}-----\\n${base64Format(this.toString('base64'))}\\n-----END ${this.tag}-----`;\n default:\n return Convert.ToBase64(this.raw);\n }\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.toString('pem'),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.raw,\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;SA8BaA,UAAiCC,EAyB5C,WAAAC,CAAYC,G,MACVC,MAAMC,EAAuBF,GAAMG,GAX9BC,KAAAC,YAAsC,GAM7BD,KAAAE,KAAO,8BAEPF,KAAAG,IAAM,wBAKpB,MAAMC,OAAEA,GAAWJ,KAAKK,IAExBL,KAAKM,aAAeC,EAAQC,MAAMJ,EAAOE,cACzCN,KAAKS,QAAUL,EAAOK,QAEtB,MAAMC,EAAYN,EAAOO,uBAAuBC,cAEhD,IAAKF,EAAW,CACd,MAAM,IAAIG,MAAM,+B,CAGlBb,KAAKU,UAAYA,EAEjB,MAAMI,EAAWV,EAAOO,uBAAuBI,aAE/C,IAAKD,EAAU,CACb,MAAM,IAAID,MAAM,8B,CAGlBb,KAAKc,SAAWA,EAChBd,KAAKgB,SAAWC,EAASjB,KAAKU,UAAWV,KAAKc,UAC9Cd,KAAKkB,OAASd,EAAOc,OAAOC,UAAUC,EAAAhB,EAAOc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,CAC7B1E,KAAK8B,WAAa6B,EAAYe,cAC3B3C,KAAKC,GAAM,IAAIC,EAAUC,EAAWC,UAAUH,K,EAI9C,QAAAa,CAASC,EAAmC,OACjD,OAAQA,GACN,IAAK,MACH,OAAOC,EAAUxC,EAAQC,MAAMR,KAAKJ,MACtC,IAAK,MACH,MAAO,cAAcI,KAAKG,aAAa6C,EAAahD,KAAK6C,SAAS,wBAAwB7C,KAAKG,WACjG,QACE,OAAOI,EAAQ0C,SAASjD,KAAKJ,K,CAI5B,aAAAsD,CAAcC,GACnBC,EAASuB,IAAIrB,MACXtD,KAAK6C,SAAS,OACdM,GAAQnD,KAAK4C,W,CAIV,aAAAW,CAAcJ,GACnBC,EAASuB,IAAInB,MACXxD,KAAKJ,IACLuD,GAAQnD,KAAK4C,W"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,o){function a(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,c){function i(t){try{s(o.next(t))}catch(t){c(t)}}function n(t){try{s(o["throw"](t))}catch(t){c(t)}}function s(t){t.done?r(t.value):a(t.value).then(i,n)}s((o=o.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,a,c,i;return i={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function n(t){return function(e){return s([t,e])}}function s(n){if(o)throw new TypeError("Generator is already executing.");while(i&&(i=0,n[0]&&(r=0)),r)try{if(o=1,a&&(c=n[0]&2?a["return"]:n[0]?a["throw"]||((c=a["return"])&&c.call(a),0):a.next)&&!(c=c.call(a,n[1])).done)return c;if(a=0,c)n=[n[0]&2,c.value];switch(n[0]){case 0:case 1:c=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;a=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(c=r.trys,c=c.length>0&&c[c.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!c||n[1]>c[0]&&n[1]<c[3])){r.label=n[1];break}if(n[0]===6&&r.label<c[1]){r.label=c[1];c=n;break}if(c&&r.label<c[2]){r.label=c[2];r.ops.push(n);break}if(c[2])r.ops.pop();r.trys.pop();continue}n=e.call(t,r)}catch(t){n=[6,t];a=0}finally{o=c=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
|
|
2
|
+
/*!
|
|
3
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
+
*/System.register(["./p-821bdcdc.system.js","./p-55303453.system.js","./p-d1066b51.system.js","./p-05af3b74.system.js","./p-163a3052.system.js","./p-a06f51a2.system.js","./p-9712b827.system.js"],(function(t){"use strict";var e,r,o,a,c,i,n,s,v,p,l;return{setters:[function(t){e=t.r;r=t.c;o=t.h;a=t.H},function(t){c=t.a},function(){},function(t){i=t.X},function(t){n=t.X;s=t.a},function(t){v=t.P},function(t){p=t.T;l=t.B}],execute:function(){var h="*{-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%}.textarea{min-height:300px;width:100%;border-radius:4px;border:1px solid var(--pv-color-gray-5);padding:14px;font-family:monospace;resize:vertical}.viewer{margin-top:var(--pv-size-base-12)}.controls{margin-top:var(--pv-size-base-2);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--pv-size-base-2)}.control_row{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:var(--pv-size-base)}";var b=h;var f=t("peculiar_certificate_decoder",function(){function t(t){var o=this;e(this,t);this.successParse=r(this,"successParse",7);this.clearCertificate=r(this,"clearCertificate",7);this.handleClickDecode=function(){var t=o.inputPaste.value;if(t){o.decode(t)}};this.handleClickClear=function(){o.clearValue()};this.handleChangeInputFile=function(t){return __awaiter(o,void 0,void 0,(function(){var e,r;return __generator(this,(function(o){switch(o.label){case 0:e=t.target;if(!e.files)return[3,2];return[4,c(e.files[0])];case 1:r=o.sent();if(typeof r.value==="string"){this.decode(r.value)}e.value="";o.label=2;case 2:return[2]}}))}))};this.handleChangeExample=function(t){if(t.target.value){o.decode(t.target.value)}else{o.clearValue()}};this.handleDropFile=function(t){return __awaiter(o,void 0,void 0,(function(){var e,r;return __generator(this,(function(o){switch(o.label){case 0:t.stopPropagation();t.preventDefault();e=t.dataTransfer;if(!e.files)return[3,2];return[4,c(e.files[0])];case 1:r=o.sent();if(typeof r.value==="string"){this.decode(r.value)}o.label=2;case 2:return[2]}}))}))};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}t.prototype.componentDidLoad=function(){var t=this;if(this.defaultCertificate){setTimeout((function(){return t.decode(t.defaultCertificate)}),100)}};t.prototype.clearValue=function(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()};t.prototype.setValue=function(t){this.certificateDecoded=t;this.inputPaste.value=t.toString("pem");this.successParse.emit(t.toString("base64"))};t.prototype.decode=function(t){var e=this;new Promise((function(e){e(new i(t))})).catch((function(){return new n(t)})).catch((function(){return new v(t)})).catch((function(){return new s(t)})).then((function(t){return e.setValue(t)})).catch((function(t){e.clearValue();console.log(t);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}))};t.prototype.render=function(){var t=this;var e;return o(a,{key:"7c3bfca68882e39705e9640f76754cce2e5d6c6a"},o("textarea",{key:"4d24f4b914f7f118efde2144e7597e0767d59ce8",placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(e){t.inputPaste=e},onDrop:this.handleDropFile}),o("div",{key:"06ba6e2b5658225a585ec9711e6f3f945ef3a840",class:"controls"},o("div",{key:"df2e115ea04d4eae7985f6ee57bfe47354f50240",class:"control_row"},o(p,{key:"05c30b2956055455cdb1f52b40995752dd0d7da4",variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),o("input",{key:"cca59d7c59d9917e728f9795bcfbd546d4cf75b8",type:"file",accept:"application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl",onChange:this.handleChangeInputFile,value:""})),((e=this.certificateExamples)===null||e===void 0?void 0:e.length)&&o("div",{class:"control_row"},o(p,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),o("select",{onChange:this.handleChangeExample},o("option",{value:""},"None"),this.certificateExamples.map((function(t){return o("option",{value:t.value},t.title)})))),o("div",{key:"6d1f010e03d7836459214e5c0abe1af7fbbe2a10",class:"control_row"},o(l,{key:"4038db36b62ff11f592f380f5c98bebb0014585e",onClick:this.handleClickDecode},"Decode"),o(l,{key:"fb7c30e61b10194b5f02a2cefa06191904f5ce46",onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof i&&o("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof n&&o("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof v&&o("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof s&&o("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))};return t}());f.style=b}}}));
|
|
5
|
+
//# sourceMappingURL=p-6221d0a4.system.entry.js.map
|