@peculiar/certificates-viewer 4.0.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +1 -1
  2. package/components/attribute-certificate-viewer.js +7 -7
  3. package/components/attribute-certificate-viewer.js.map +1 -1
  4. package/components/certificate-viewer.js +5 -5
  5. package/components/certificate-viewer.js.map +1 -1
  6. package/components/crl-viewer.js +6 -6
  7. package/components/crl-viewer.js.map +1 -1
  8. package/components/csr-viewer.js +4 -4
  9. package/components/csr-viewer.js.map +1 -1
  10. package/components/download.js +374 -374
  11. package/components/download.js.map +1 -1
  12. package/components/index2.js +2 -2
  13. package/components/index2.js.map +1 -1
  14. package/components/miscellaneous.js +1320 -810
  15. package/components/miscellaneous.js.map +1 -1
  16. package/components/subject_name.js +2 -2
  17. package/components/subject_name.js.map +1 -1
  18. package/dist/cjs/{certification_request-c0cafa72.js → certification_request-5672c667.js} +1227 -823
  19. package/dist/cjs/certification_request-5672c667.js.map +1 -0
  20. package/dist/cjs/{crl-b4322166.js → crl-3f681d44.js} +14 -14
  21. package/dist/cjs/{crl-b4322166.js.map → crl-3f681d44.js.map} +1 -1
  22. package/dist/cjs/{download-972dda8a.js → download-0fa5b33c.js} +377 -377
  23. package/dist/cjs/download-0fa5b33c.js.map +1 -0
  24. package/dist/cjs/index.cjs.js +1 -1
  25. package/dist/cjs/{miscellaneous-e43aaae5.js → miscellaneous-905ec852.js} +125 -15
  26. package/dist/cjs/miscellaneous-905ec852.js.map +1 -0
  27. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +8 -8
  28. package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
  29. package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +4 -4
  30. package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
  31. package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +3 -3
  32. package/dist/cjs/{x509_certificate-989b1435.js → x509_certificate-69764c52.js} +7 -7
  33. package/dist/cjs/{x509_certificate-989b1435.js.map → x509_certificate-69764c52.js.map} +1 -1
  34. package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js +19 -0
  35. package/dist/collection/components/certificate-details-parts/extensions/cabforganization_identifier_extension.js.map +1 -0
  36. package/dist/collection/components/certificate-details-parts/extensions/index.js +10 -0
  37. package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
  38. package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +80 -0
  39. package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -0
  40. package/dist/collection/constants/logs.js +1 -0
  41. package/dist/collection/constants/logs.js.map +1 -1
  42. package/dist/collection/constants/oids.js +25 -4
  43. package/dist/collection/constants/oids.js.map +1 -1
  44. package/dist/collection/crypto/extension.js +8 -0
  45. package/dist/collection/crypto/extension.js.map +1 -1
  46. package/dist/collection/crypto/extensions/cabforganization_identifier.js +49 -0
  47. package/dist/collection/crypto/extensions/cabforganization_identifier.js.map +1 -0
  48. package/dist/collection/crypto/extensions/index.js +5 -0
  49. package/dist/collection/crypto/extensions/index.js.map +1 -0
  50. package/dist/collection/utils/camel_case_to_words.js +15 -0
  51. package/dist/collection/utils/camel_case_to_words.js.map +1 -0
  52. package/dist/collection/utils/index.js +1 -0
  53. package/dist/collection/utils/index.js.map +1 -1
  54. package/dist/esm/{certification_request-5cadde9f.js → certification_request-d5ea5973.js} +1217 -817
  55. package/dist/esm/certification_request-d5ea5973.js.map +1 -0
  56. package/dist/esm/{crl-11670c3e.js → crl-d13d9ec5.js} +14 -14
  57. package/dist/esm/{crl-11670c3e.js.map → crl-d13d9ec5.js.map} +1 -1
  58. package/dist/esm/{download-57c5bf8f.js → download-aacb6eff.js} +375 -375
  59. package/dist/esm/download-aacb6eff.js.map +1 -0
  60. package/dist/esm/index.js +1 -1
  61. package/dist/esm/{miscellaneous-7793a310.js → miscellaneous-cdfd8905.js} +125 -15
  62. package/dist/esm/miscellaneous-cdfd8905.js.map +1 -0
  63. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +8 -8
  64. package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
  65. package/dist/esm/peculiar-certificate-decoder.entry.js +4 -4
  66. package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
  67. package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
  68. package/dist/esm/{x509_certificate-dfae6999.js → x509_certificate-a9fcab55.js} +7 -7
  69. package/dist/esm/{x509_certificate-dfae6999.js.map → x509_certificate-a9fcab55.js.map} +1 -1
  70. package/dist/esm-es5/certification_request-d5ea5973.js +97 -0
  71. package/dist/esm-es5/certification_request-d5ea5973.js.map +1 -0
  72. package/dist/esm-es5/{crl-11670c3e.js → crl-d13d9ec5.js} +6 -6
  73. package/dist/esm-es5/{crl-11670c3e.js.map → crl-d13d9ec5.js.map} +1 -1
  74. package/dist/esm-es5/download-aacb6eff.js +43 -0
  75. package/dist/esm-es5/download-aacb6eff.js.map +1 -0
  76. package/dist/esm-es5/index.js +1 -1
  77. package/dist/esm-es5/miscellaneous-cdfd8905.js +369 -0
  78. package/dist/esm-es5/miscellaneous-cdfd8905.js.map +1 -0
  79. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +3 -3
  80. package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
  81. package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
  82. package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
  83. package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
  84. package/dist/esm-es5/x509_certificate-a9fcab55.js +12 -0
  85. package/dist/esm-es5/{x509_certificate-dfae6999.js.map → x509_certificate-a9fcab55.js.map} +1 -1
  86. package/dist/peculiar/index.esm.js +1 -1
  87. package/dist/peculiar/p-14f281b0.system.js +43 -0
  88. package/dist/peculiar/p-14f281b0.system.js.map +1 -0
  89. package/dist/peculiar/{p-1844b807.system.entry.js → p-3b395604.system.entry.js} +2 -2
  90. package/dist/peculiar/p-48474b8d.js +12 -0
  91. package/dist/peculiar/{p-6e79b9c8.js.map → p-48474b8d.js.map} +1 -1
  92. package/dist/peculiar/p-4a6ceeda.js +97 -0
  93. package/dist/peculiar/p-4a6ceeda.js.map +1 -0
  94. package/dist/peculiar/p-59e5ac12.js +43 -0
  95. package/dist/peculiar/p-59e5ac12.js.map +1 -0
  96. package/dist/peculiar/{p-7f9fef87.entry.js → p-609ee9f0.entry.js} +2 -2
  97. package/dist/peculiar/p-67156853.js +369 -0
  98. package/dist/peculiar/p-67156853.js.map +1 -0
  99. package/dist/peculiar/p-6daee4d7.system.js +369 -0
  100. package/dist/peculiar/p-6daee4d7.system.js.map +1 -0
  101. package/dist/peculiar/p-6e48afc4.system.js +34 -0
  102. package/dist/peculiar/{p-6667fe6e.system.js.map → p-6e48afc4.system.js.map} +1 -1
  103. package/dist/peculiar/{p-0b475f2a.system.entry.js → p-718982f4.system.entry.js} +4 -4
  104. package/dist/peculiar/{p-0b475f2a.system.entry.js.map → p-718982f4.system.entry.js.map} +1 -1
  105. package/dist/peculiar/p-80832207.system.js +1 -1
  106. package/dist/peculiar/p-8fac1d56.js +33 -0
  107. package/dist/peculiar/{p-43eb3721.js.map → p-8fac1d56.js.map} +1 -1
  108. package/dist/peculiar/{p-1de0381c.system.js → p-a3eeb94b.system.js} +2 -2
  109. package/dist/peculiar/{p-441109db.system.entry.js → p-a67b8793.system.entry.js} +2 -2
  110. package/dist/peculiar/{p-e39de121.system.entry.js → p-a720c0a5.system.entry.js} +2 -2
  111. package/dist/peculiar/{p-882e1281.entry.js → p-a7386b78.entry.js} +2 -2
  112. package/dist/peculiar/p-ab7dc738.system.js +13 -0
  113. package/dist/peculiar/{p-31586b23.system.js.map → p-ab7dc738.system.js.map} +1 -1
  114. package/dist/peculiar/{p-bcc86979.entry.js → p-c35b180c.entry.js} +2 -2
  115. package/dist/peculiar/p-e0f4bda5.system.js +97 -0
  116. package/dist/peculiar/p-e0f4bda5.system.js.map +1 -0
  117. package/dist/peculiar/{p-673336cf.entry.js → p-f86279f6.entry.js} +5 -5
  118. package/dist/peculiar/{p-673336cf.entry.js.map → p-f86279f6.entry.js.map} +1 -1
  119. package/dist/peculiar/peculiar.esm.js +1 -1
  120. package/dist/types/components/certificate-details-parts/extensions/cabforganization_identifier_extension.d.ts +15 -0
  121. package/dist/types/components/certificate-details-parts/extensions/key_description_extension.d.ts +15 -0
  122. package/dist/types/constants/logs.d.ts +1 -0
  123. package/dist/types/constants/oids.d.ts +24 -4
  124. package/dist/types/crypto/extension.d.ts +3 -1
  125. package/dist/types/crypto/extensions/cabforganization_identifier.d.ts +23 -0
  126. package/dist/types/crypto/extensions/index.d.ts +1 -0
  127. package/dist/types/utils/camel_case_to_words.d.ts +8 -0
  128. package/dist/types/utils/index.d.ts +1 -0
  129. package/hydrate/index.js +1710 -1200
  130. package/package.json +22 -21
  131. package/dist/cjs/certification_request-c0cafa72.js.map +0 -1
  132. package/dist/cjs/download-972dda8a.js.map +0 -1
  133. package/dist/cjs/miscellaneous-e43aaae5.js.map +0 -1
  134. package/dist/esm/certification_request-5cadde9f.js.map +0 -1
  135. package/dist/esm/download-57c5bf8f.js.map +0 -1
  136. package/dist/esm/miscellaneous-7793a310.js.map +0 -1
  137. package/dist/esm-es5/certification_request-5cadde9f.js +0 -97
  138. package/dist/esm-es5/certification_request-5cadde9f.js.map +0 -1
  139. package/dist/esm-es5/download-57c5bf8f.js +0 -19
  140. package/dist/esm-es5/download-57c5bf8f.js.map +0 -1
  141. package/dist/esm-es5/miscellaneous-7793a310.js +0 -348
  142. package/dist/esm-es5/miscellaneous-7793a310.js.map +0 -1
  143. package/dist/esm-es5/x509_certificate-dfae6999.js +0 -12
  144. package/dist/peculiar/p-31586b23.system.js +0 -13
  145. package/dist/peculiar/p-43eb3721.js +0 -33
  146. package/dist/peculiar/p-6667fe6e.system.js +0 -34
  147. package/dist/peculiar/p-6e79b9c8.js +0 -12
  148. package/dist/peculiar/p-74c241e7.js +0 -97
  149. package/dist/peculiar/p-74c241e7.js.map +0 -1
  150. package/dist/peculiar/p-a053c132.js +0 -19
  151. package/dist/peculiar/p-a053c132.js.map +0 -1
  152. package/dist/peculiar/p-a6e2e335.js +0 -348
  153. package/dist/peculiar/p-a6e2e335.js.map +0 -1
  154. package/dist/peculiar/p-ae9189f6.system.js +0 -19
  155. package/dist/peculiar/p-ae9189f6.system.js.map +0 -1
  156. package/dist/peculiar/p-c0a298fd.system.js +0 -97
  157. package/dist/peculiar/p-c0a298fd.system.js.map +0 -1
  158. package/dist/peculiar/p-c362dc5e.system.js +0 -348
  159. package/dist/peculiar/p-c362dc5e.system.js.map +0 -1
  160. /package/dist/peculiar/{p-1844b807.system.entry.js.map → p-3b395604.system.entry.js.map} +0 -0
  161. /package/dist/peculiar/{p-7f9fef87.entry.js.map → p-609ee9f0.entry.js.map} +0 -0
  162. /package/dist/peculiar/{p-1de0381c.system.js.map → p-a3eeb94b.system.js.map} +0 -0
  163. /package/dist/peculiar/{p-441109db.system.entry.js.map → p-a67b8793.system.entry.js.map} +0 -0
  164. /package/dist/peculiar/{p-e39de121.system.entry.js.map → p-a720c0a5.system.entry.js.map} +0 -0
  165. /package/dist/peculiar/{p-882e1281.entry.js.map → p-a7386b78.entry.js.map} +0 -0
  166. /package/dist/peculiar/{p-bcc86979.entry.js.map → p-c35b180c.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["Attribute","AsnData","getAsnExtnValue","this","asn","values","constructor","raw","super","AsnAttribute","asnExtnValue","type","id_DomainNameBeneficiary","value","AsnParser","parse","DomainNameBeneficiary","id_DomainNameLegalRepresentative","DomainNameLegalRepresentative","id_DomainNameOwner","DomainNameOwner","id_DomainNameTechnicalOperator","DomainNameTechnicalOperator","id_TypeRelationship","TypeRelationship","id_ActivityDescription","ActivityDescription","id_WebGDPR","WebGDPR","id_InsuranceValue","InsuranceValue","id_ValuationRanking","ValuationRanking","id_pkcs9_at_challengePassword","ChallengePassword","id_pkcs9_at_unstructuredName","UnstructuredName","id_pkcs9_at_extensionRequest","extensionRequest","ExtensionRequest","map","e","Extension","AsnConvert","serialize","Convert","ToHex","X509AttributeCertificate","certificateRawToBuffer","AttributeCertificate","thumbprints","acinfo","serialNumber","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","signature","signatureValue","signatureAlgorithm","algorithm","parseExtensions","extensions","parseAttributes","attributes","getThumbprint","thumbprint","getCertificateThumbprint","error","console","exportAsBase64","ToBase64","exportAsHexFormatted","hexFormat","exportAsPemFormatted","base64Format","commonName","downloadAsPEM","name","Download","attrCert","asPEM","downloadAsDER","asDER","CSR","CertificationRequest","certificationRequestInfo","subject","Name","toJSON","publicKey","subjectPublicKey","subjectPKInfo","params","id_ecPublicKey","parameters","ECParameters","id_rsaEncryption","RSAPublicKey","spki","i","length","shortName","csr","CRL","CertificateList","tbsCertList","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","crlExtensions","crl"],"sources":["src/crypto/attribute.ts","src/crypto/x509_attribute_certificate.ts","src/crypto/csr.ts","src/crypto/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 { Convert } from 'pvtsutils';\nimport { AsnParser, AsnConvert } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\n\nexport type TAttributeValue = DomainNameBeneficiary\n| DomainNameLegalRepresentative\n| DomainNameOwner\n| DomainNameTechnicalOperator\n| TypeRelationship\n| ActivityDescription\n| WebGDPR\n| InsuranceValue\n| ValuationRanking\n| Extension<TExtensionValue>[]\n| ChallengePassword\n| UnstructuredName\n| string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n switch (this.asn.type) {\n case id_DomainNameBeneficiary:\n this.value = AsnParser.parse(asnExtnValue, DomainNameBeneficiary) as T;\n break;\n case id_DomainNameLegalRepresentative:\n this.value = AsnParser.parse(asnExtnValue, DomainNameLegalRepresentative) as T;\n break;\n case id_DomainNameOwner:\n this.value = AsnParser.parse(asnExtnValue, DomainNameOwner) as T;\n break;\n case id_DomainNameTechnicalOperator:\n this.value = AsnParser.parse(asnExtnValue, DomainNameTechnicalOperator) as T;\n break;\n case id_TypeRelationship:\n this.value = AsnParser.parse(asnExtnValue, TypeRelationship) as T;\n break;\n case id_ActivityDescription:\n this.value = AsnParser.parse(asnExtnValue, ActivityDescription) as T;\n break;\n case id_WebGDPR:\n this.value = AsnParser.parse(asnExtnValue, WebGDPR) as T;\n break;\n case id_InsuranceValue:\n this.value = AsnParser.parse(asnExtnValue, InsuranceValue) as T;\n break;\n case id_ValuationRanking:\n this.value = AsnParser.parse(asnExtnValue, ValuationRanking) as T;\n break;\n case id_pkcs9_at_challengePassword:\n this.value = AsnParser.parse(asnExtnValue, ChallengePassword) as T;\n break;\n case id_pkcs9_at_unstructuredName:\n this.value = AsnParser.parse(asnExtnValue, UnstructuredName) as T;\n break;\n case id_pkcs9_at_extensionRequest: {\n const extensionRequest = AsnParser.parse(asnExtnValue, ExtensionRequest);\n\n this.value = extensionRequest\n .map((e) => new Extension(AsnConvert.serialize(e))) as T;\n break;\n }\n default:\n this.value = Convert.ToHex(asnExtnValue) as T;\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 */\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 type: string = 'X.509 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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN ATTRIBUTE CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END ATTRIBUTE CERTIFICATE-----`;\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.exportAsHexFormatted(),\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 */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\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\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class CSR extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public type: string = 'PKCS#10 Certificate Request';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\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 const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\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.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 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 parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN CERTIFICATE REQUEST-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE REQUEST-----`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.exportAsHexFormatted(),\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 CRL 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 type: string = 'X.509 Certificate Revocation List';\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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN X509 CRL-----\\n${base64Format(this.exportAsBase64())}\\n-----END X509 CRL-----`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;SAmEaA,UAA6CC,EAGhD,eAAAC,GACN,OAAOC,KAAKC,IAAIC,OAAO,E,CAGzB,WAAAC,CAAYC,GACVC,MAAMD,EAAKE,GAEX,MAAMC,EAAeP,KAAKD,kBAE1B,OAAQC,KAAKC,IAAIO,MACf,KAAKC,EACHT,KAAKU,MAAQC,EAAUC,MAAML,EAAcM,GAC3C,MACF,KAAKC,EACHd,KAAKU,MAAQC,EAAUC,MAAML,EAAcQ,GAC3C,MACF,KAAKC,EACHhB,KAAKU,MAAQC,EAAUC,MAAML,EAAcU,GAC3C,MACF,KAAKC,EACHlB,KAAKU,MAAQC,EAAUC,MAAML,EAAcY,GAC3C,MACF,KAAKC,EACHpB,KAAKU,MAAQC,EAAUC,MAAML,EAAcc,GAC3C,MACF,KAAKC,EACHtB,KAAKU,MAAQC,EAAUC,MAAML,EAAcgB,GAC3C,MACF,KAAKC,EACHxB,KAAKU,MAAQC,EAAUC,MAAML,EAAckB,GAC3C,MACF,KAAKC,EACH1B,KAAKU,MAAQC,EAAUC,MAAML,EAAcoB,GAC3C,MACF,KAAKC,EACH5B,KAAKU,MAAQC,EAAUC,MAAML,EAAcsB,GAC3C,MACF,KAAKC,EACH9B,KAAKU,MAAQC,EAAUC,MAAML,EAAcwB,GAC3C,MACF,KAAKC,EACHhC,KAAKU,M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K5E,K,EAIhB,MAAO,E,CAGF,eAAA2D,GACL,MAAM6C,YAAEA,GAAgBlH,KAAKC,IAE7B,GAAIiH,EAAYU,cAAe,CAC7B5H,KAAKsE,WAAa4C,EAAYU,cAC3BvF,KAAKC,GAAM,IAAIC,EAAUC,EAAWC,UAAUH,K,EAI9C,cAAAwC,GACL,OAAOpC,UAAQqC,SAAS/E,KAAKI,I,CAGxB,oBAAA4E,GACL,OAAOC,EAAUvC,UAAQC,MAAM3C,KAAKI,K,CAG/B,oBAAA8E,GACL,MAAO,6BAA6BC,EAAanF,KAAK8E,2C,CAGjD,aAAAO,CAAcC,GACnBC,EAASsC,IAAIpC,MACXzF,KAAKkF,uBACLI,GAAQtF,KAAKoF,W,CAIV,aAAAM,CAAcJ,GACnBC,EAASsC,IAAIlC,MACX3F,KAAKgF,uBACLM,GAAQtF,KAAKoF,W"}
1
+ {"version":3,"names":["Attribute","AsnData","getAsnExtnValue","this","asn","values","constructor","raw","super","AsnAttribute","asnExtnValue","type","id_DomainNameBeneficiary","value","AsnParser","parse","DomainNameBeneficiary","id_DomainNameLegalRepresentative","DomainNameLegalRepresentative","id_DomainNameOwner","DomainNameOwner","id_DomainNameTechnicalOperator","DomainNameTechnicalOperator","id_TypeRelationship","TypeRelationship","id_ActivityDescription","ActivityDescription","id_WebGDPR","WebGDPR","id_InsuranceValue","InsuranceValue","id_ValuationRanking","ValuationRanking","id_pkcs9_at_challengePassword","ChallengePassword","id_pkcs9_at_unstructuredName","UnstructuredName","id_pkcs9_at_extensionRequest","extensionRequest","ExtensionRequest","map","e","Extension","AsnConvert","serialize","Convert","ToHex","X509AttributeCertificate","certificateRawToBuffer","AttributeCertificate","thumbprints","acinfo","serialNumber","version","notBefore","attrCertValidityPeriod","notBeforeTime","Error","notAfter","notAfterTime","validity","dateDiff","issuer","v1Form","_a","v2Form","issuerName","holder","signature","signatureValue","signatureAlgorithm","algorithm","parseExtensions","extensions","parseAttributes","attributes","getThumbprint","thumbprint","getCertificateThumbprint","error","console","exportAsBase64","ToBase64","exportAsHexFormatted","hexFormat","exportAsPemFormatted","base64Format","commonName","downloadAsPEM","name","Download","attrCert","asPEM","downloadAsDER","asDER","CSR","CertificationRequest","certificationRequestInfo","subject","Name","toJSON","publicKey","subjectPublicKey","subjectPKInfo","params","id_ecPublicKey","parameters","ECParameters","id_rsaEncryption","RSAPublicKey","spki","i","length","shortName","csr","CRL","CertificateList","tbsCertList","lastUpdate","thisUpdate","getTime","nextUpdate","revokedCertificates","revokedCertificate","revocationDate","userCertificate","crlEntryExtensions","crlExtensions","crl"],"sources":["src/crypto/attribute.ts","src/crypto/x509_attribute_certificate.ts","src/crypto/csr.ts","src/crypto/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 { Convert } from 'pvtsutils';\nimport { AsnParser, AsnConvert } from '@peculiar/asn1-schema';\nimport { Attribute as AsnAttribute } from '@peculiar/asn1-x509';\nimport {\n id_DomainNameBeneficiary,\n DomainNameBeneficiary,\n\n id_DomainNameLegalRepresentative,\n DomainNameLegalRepresentative,\n\n id_DomainNameOwner,\n DomainNameOwner,\n\n id_DomainNameTechnicalOperator,\n DomainNameTechnicalOperator,\n\n id_TypeRelationship,\n TypeRelationship,\n\n id_ActivityDescription,\n ActivityDescription,\n\n id_WebGDPR,\n WebGDPR,\n\n id_InsuranceValue,\n InsuranceValue,\n\n id_ValuationRanking,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n id_pkcs9_at_extensionRequest,\n ExtensionRequest,\n\n id_pkcs9_at_challengePassword,\n ChallengePassword,\n\n id_pkcs9_at_unstructuredName,\n UnstructuredName,\n} from '@peculiar/asn1-pkcs9';\n\nimport { Extension, TExtensionValue } from './extension';\nimport { AsnData } from './asn_data';\n\nexport type TAttributeValue = DomainNameBeneficiary\n| DomainNameLegalRepresentative\n| DomainNameOwner\n| DomainNameTechnicalOperator\n| TypeRelationship\n| ActivityDescription\n| WebGDPR\n| InsuranceValue\n| ValuationRanking\n| Extension<TExtensionValue>[]\n| ChallengePassword\n| UnstructuredName\n| string;\n\nexport class Attribute<T extends TAttributeValue> extends AsnData<AsnAttribute> {\n public readonly value: T;\n\n private getAsnExtnValue() {\n return this.asn.values[0];\n }\n\n constructor(raw: BufferSource) {\n super(raw, AsnAttribute);\n\n const asnExtnValue = this.getAsnExtnValue();\n\n switch (this.asn.type) {\n case id_DomainNameBeneficiary:\n this.value = AsnParser.parse(asnExtnValue, DomainNameBeneficiary) as T;\n break;\n case id_DomainNameLegalRepresentative:\n this.value = AsnParser.parse(asnExtnValue, DomainNameLegalRepresentative) as T;\n break;\n case id_DomainNameOwner:\n this.value = AsnParser.parse(asnExtnValue, DomainNameOwner) as T;\n break;\n case id_DomainNameTechnicalOperator:\n this.value = AsnParser.parse(asnExtnValue, DomainNameTechnicalOperator) as T;\n break;\n case id_TypeRelationship:\n this.value = AsnParser.parse(asnExtnValue, TypeRelationship) as T;\n break;\n case id_ActivityDescription:\n this.value = AsnParser.parse(asnExtnValue, ActivityDescription) as T;\n break;\n case id_WebGDPR:\n this.value = AsnParser.parse(asnExtnValue, WebGDPR) as T;\n break;\n case id_InsuranceValue:\n this.value = AsnParser.parse(asnExtnValue, InsuranceValue) as T;\n break;\n case id_ValuationRanking:\n this.value = AsnParser.parse(asnExtnValue, ValuationRanking) as T;\n break;\n case id_pkcs9_at_challengePassword:\n this.value = AsnParser.parse(asnExtnValue, ChallengePassword) as T;\n break;\n case id_pkcs9_at_unstructuredName:\n this.value = AsnParser.parse(asnExtnValue, UnstructuredName) as T;\n break;\n case id_pkcs9_at_extensionRequest: {\n const extensionRequest = AsnParser.parse(asnExtnValue, ExtensionRequest);\n\n this.value = extensionRequest\n .map((e) => new Extension(AsnConvert.serialize(e))) as T;\n break;\n }\n default:\n this.value = Convert.ToHex(asnExtnValue) as T;\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 */\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 type: string = 'X.509 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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN ATTRIBUTE CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END ATTRIBUTE CERTIFICATE-----`;\n }\n\n public get commonName(): string {\n return `attribute-certificate-${this.thumbprints['SHA-1']}`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.attrCert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.attrCert.asDER(\n this.exportAsHexFormatted(),\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 */\n\nimport { AsnConvert } from '@peculiar/asn1-schema';\nimport { ECParameters, id_ecPublicKey } from '@peculiar/asn1-ecc';\nimport { id_rsaEncryption, RSAPublicKey } from '@peculiar/asn1-rsa';\nimport { CertificationRequest } from '@peculiar/asn1-csr';\nimport { Convert } from 'pvtsutils';\n\nimport { Download } from '../utils';\n\nimport { AsnData } from './asn_data';\nimport { Name, INameJSON } from './name';\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\ninterface IPublicKey {\n algorithm: string;\n value: BufferSource;\n params?: ECParameters | RSAPublicKey;\n}\n\nexport class CSR extends AsnData<CertificationRequest> {\n public readonly subject: INameJSON[];\n\n public readonly version: number;\n\n public attributes: Attribute<TAttributeValue>[];\n\n public thumbprints: Record<string, string> = {};\n\n public type: string = 'PKCS#10 Certificate Request';\n\n constructor(raw: string) {\n super(certificateRawToBuffer(raw), CertificationRequest);\n\n const { certificationRequestInfo } = this.asn;\n\n this.subject = new Name(certificationRequestInfo.subject).toJSON();\n this.version = certificationRequestInfo.version;\n }\n\n public get publicKey(): IPublicKey {\n const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;\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 const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);\n\n return {\n params,\n value: spki,\n algorithm: algorithm.algorithm,\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.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 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 parseAttributes() {\n const { certificationRequestInfo } = this.asn;\n\n if (certificationRequestInfo.attributes) {\n this.attributes = certificationRequestInfo.attributes\n .map((e) => new Attribute(AsnConvert.serialize(e)));\n }\n }\n\n public exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN CERTIFICATE REQUEST-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE REQUEST-----`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.csr.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.csr.asDER(\n this.exportAsHexFormatted(),\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 CRL 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 type: string = 'X.509 Certificate Revocation List';\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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN X509 CRL-----\\n${base64Format(this.exportAsBase64())}\\n-----END X509 CRL-----`;\n }\n\n public downloadAsPEM(name?: string) {\n Download.crl.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.crl.asDER(\n this.exportAsHexFormatted(),\n name || this.comm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cC,GACnBC,EAASsC,IAAIpC,MACXzF,KAAKkF,uBACLI,GAAQtF,KAAKoF,W,CAIV,aAAAM,CAAcJ,GACnBC,EAASsC,IAAIlC,MACX3F,KAAKgF,uBACLM,GAAQtF,KAAKoF,W"}
@@ -1,5 +1,5 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- System.register(["./p-ae9189f6.system.js","./p-2fcad8cb.system.js","./p-6cb88fd6.system.js","./p-ddae2f8e.system.js","./p-e6a3b4d4.system.js","./p-b313be9e.system.js","./p-c99507d4.system.js","./p-5aabeba7.system.js"],(function(n){"use strict";return{setters:[function(s){var o={};o.Download=s.D;o.downloadFromBuffer=s.d;n(o)},function(s){var o={};o.Button=s.B;o.Typography=s.T;n(o)},function(s){n("Link",s.L)},function(s){var o={};o.CrossIcon=s.C;o.DetailsIcon=s.D;o.LinkIcon=s.L;n(o)},function(s){n("DownloadIcon",s.D)},function(s){n("ActionsIcon",s.A)},function(s){var o={};o.ArrowBottomIcon=s.A;o.ArrowTopIcon=s.a;n(o)},function(){}],execute:function(){}}}));
5
- //# sourceMappingURL=p-1de0381c.system.js.map
4
+ System.register(["./p-14f281b0.system.js","./p-2fcad8cb.system.js","./p-6cb88fd6.system.js","./p-ddae2f8e.system.js","./p-e6a3b4d4.system.js","./p-b313be9e.system.js","./p-c99507d4.system.js","./p-5aabeba7.system.js"],(function(n){"use strict";return{setters:[function(s){var o={};o.Download=s.D;o.downloadFromBuffer=s.d;n(o)},function(s){var o={};o.Button=s.B;o.Typography=s.T;n(o)},function(s){n("Link",s.L)},function(s){var o={};o.CrossIcon=s.C;o.DetailsIcon=s.D;o.LinkIcon=s.L;n(o)},function(s){n("DownloadIcon",s.D)},function(s){n("ActionsIcon",s.A)},function(s){var o={};o.ArrowBottomIcon=s.A;o.ArrowTopIcon=s.a;n(o)},function(){}],execute:function(){}}}));
5
+ //# sourceMappingURL=p-a3eeb94b.system.js.map
@@ -1,7 +1,7 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function n(e){try{c(a.next(e))}catch(e){i(e)}}function s(e){try{c(a["throw"](e))}catch(e){i(e)}}function c(e){e.done?r(e.value):o(e.value).then(n,s)}c((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){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(e){return function(t){return c([e,t])}}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=t.call(e,r)}catch(e){s=[6,e];o=0}finally{a=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var a=0,o=t.length,i;a<o;a++){if(i||!(a in t)){if(!i)i=Array.prototype.slice.call(t,0,a);i[a]=t[a]}}return e.concat(i||Array.prototype.slice.call(t))};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */System.register(["./p-5aabeba7.system.js","./p-31586b23.system.js","./p-c0a298fd.system.js","./p-ae9189f6.system.js","./p-2fcad8cb.system.js","./p-ddae2f8e.system.js","./p-e6a3b4d4.system.js","./p-c99507d4.system.js"],(function(e){"use strict";var t,r,a,o,i,n,s,c,l,p,d,v,h,u,b,g;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H},function(e){i=e.X},function(e){n=e.$;s=e.a0;c=e.a1},function(){},function(e){l=e.T;p=e.B},function(e){d=e.D;v=e.L;h=e.C},function(e){u=e.D},function(e){b=e.a;g=e.A}],execute:function(){
4
+ */System.register(["./p-5aabeba7.system.js","./p-ab7dc738.system.js","./p-e0f4bda5.system.js","./p-14f281b0.system.js","./p-2fcad8cb.system.js","./p-ddae2f8e.system.js","./p-e6a3b4d4.system.js","./p-c99507d4.system.js"],(function(e){"use strict";var t,r,a,o,i,n,s,c,l,p,d,v,h,u,b,g;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H},function(e){i=e.X},function(e){n=e.$;s=e.a0;c=e.a1},function(){},function(e){l=e.T;p=e.B},function(e){d=e.D;v=e.L;h=e.C},function(e){u=e.D},function(e){b=e.a;g=e.A}],execute:function(){
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -10,4 +10,4 @@ var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e ins
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var f=function(e){var r=e.certificate,a=e.showIssuer;var o=function(e,r){return t("tr",null,t("td",null,t(l,{variant:"b2",color:"gray-9"},e)),t("td",null,t(l,{variant:"b2",color:"black"},r)))};return t("table",null,t("tbody",null,o(n.getString("subjectName"),r.subjectToString()),a&&o(n.getString("issuerName"),r.issuerToString()),o(n.getString("serialNumber"),r.serialNumber),o(n.getString("version"),r.version),o(n.getString("validity"),r.validity),o(n.getString("issued"),s(r.notBefore)),o(n.getString("expired"),s(r.notAfter))))};var y="*{-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%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:var(--pv-size-base-4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:var(--pv-size-base-8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 var(--pv-size-base-2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:var(--pv-size-base-10)}table td:last-child,table th:last-child{padding-left:0;width:var(--pv-size-base-10)}table th{padding:var(--pv-size-base-2) var(--pv-size-base-4)}table th.col_action{padding:0}table td{padding:var(--pv-size-base-4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:var(--pv-size-base-2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:var(--pv-size-base-16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:var(--pv-size-base-6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:var(--pv-size-base-3) var(--pv-size-base-4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:var(--pv-size-base-2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:var(--pv-size-base-2) var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}";var m=e("peculiar_certificates_viewer",function(){function e(e){var t=this;r(this,e);this.detailsOpen=a(this,"detailsOpen",7);this.detailsClose=a(this,"detailsClose",7);this.isHasRoots=false;this.handleClickDetails=function(e){t.certificateSelectedForDetails=e;t.detailsOpen.emit(e)};this.handleModalClose=function(){t.certificateSelectedForDetails=undefined;t.detailsClose.emit()};this.handleSearch=function(e){t.search=e.target.value.trim()};this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.expandedRow=undefined;this.certificateSelectedForDetails=undefined;this.isDecodeInProcess=true}e.prototype.handleMediaQueryChange=function(e){this.mobileScreenView=e.matches};e.prototype.componentWillLoad=function(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};e.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};e.prototype.watchCertificates=function(e,t){if(JSON.stringify(e)!==JSON.stringify(t)){this.certificatesDecodeAndSet()}};e.prototype.certificatesDecodeAndSet=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,a,o,n,s;return __generator(this,(function(c){switch(c.label){case 0:e=false;if(!Array.isArray(this.certificates)){return[2]}t=[];r=0,a=this.certificates;c.label=1;case 1:if(!(r<a.length))return[3,6];o=a[r];c.label=2;case 2:c.trys.push([2,4,,5]);n=new i(o.value);return[4,n.getThumbprint("SHA-1")];case 3:c.sent();t.push({body:n,tests:o.tests,name:o.name});if(!e&&n.isRoot){e=true}return[3,5];case 4:s=c.sent();console.error("Error certificate parse:",s);return[3,5];case 5:r++;return[3,1];case 6:this.isHasRoots=e;this.isDecodeInProcess=false;this.certificatesDecoded=t;return[2]}}))}))};e.prototype.handleClickDownloadAsPem=function(e){e.body.downloadAsPEM(e.name||e.body.commonName)};e.prototype.handleClickDownloadAsDer=function(e){e.body.downloadAsDER(e.name||e.body.commonName)};e.prototype.handleClickRow=function(e){var t=this.expandedRow===e;this.expandedRow=t?undefined:e};e.prototype.getMaxColSpanValue=function(){var e=5;if(!this.isHasRoots){e+=1}return e};e.prototype.renderCertificateButtonActions=function(e){var r=this;var a,o,i;var s=e.tests&&(e.tests.expired||e.tests.revoked||e.tests.valid);return t("peculiar-button-menu",{class:"button_table_cell",groups:__spreadArray([{title:n.getString("previewCertificate"),options:[{text:n.getString("viewDetails"),startIcon:t(d,null),onClick:function(){return r.handleClickDetails(e.body)}}]},{title:n.getString("downloadOptions"),options:[{text:n.getString("download.pem"),startIcon:t(u,null),onClick:function(){return r.handleClickDownloadAsPem(e)}},{text:n.getString("download.der"),startIcon:t(u,null),onClick:function(){return r.handleClickDownloadAsDer(e)}}]}],s?[{title:n.getString("testURLs"),options:__spreadArray(__spreadArray(__spreadArray([],((a=e.tests)===null||a===void 0?void 0:a.valid)?[{text:n.getString("valid"),href:e.tests.valid,startIcon:t(v,null)}]:[],true),((o=e.tests)===null||o===void 0?void 0:o.revoked)?[{text:n.getString("revoked"),href:e.tests.revoked,startIcon:t(v,null)}]:[],true),((i=e.tests)===null||i===void 0?void 0:i.expired)?[{text:n.getString("expired"),href:e.tests.expired,startIcon:t(v,null)}]:[],true)}]:[],true)})};e.prototype.renderExpandedRow=function(e){var r=this.getMaxColSpanValue()-2;return t("tr",{class:"expanded_summary"},t("td",null),t("td",{colSpan:r},t(f,{certificate:e,showIssuer:!e.isRoot})),t("td",null))};e.prototype.renderCertificatesRows=function(){var e=this;var r=this.highlightWithSearch?this.search:"";var a=[];this.certificatesDecoded.forEach((function(o,i){var s=i===e.expandedRow;var d=c[o.body.signature.algorithm]||o.body.signature.algorithm;if(e.filterWithSearch&&e.search){var v=[d,o.body.issuerCommonName,o.name,o.body.commonName,o.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(v.indexOf(e.search.toLowerCase())===-1){return}}if(e.mobileScreenView){a.push([t("tr",{class:{certificate_row:true,m_expanded:s},key:o.body.thumbprints["SHA-1"]},t("td",null,t("table",null,t("tbody",null,!e.isHasRoots&&t("tr",null,t("td",null,t(l,{variant:"b2",color:"gray-9"},n.getString("issuer"))),t("td",null,t(l,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:r},o.body.issuerCommonName)))),t("tr",null,t("td",null,t(l,{variant:"b2",color:"gray-9"},n.getString("name"))),t("td",null,t(l,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:r},o.name||o.body.commonName)))),t("tr",null,t("td",null,t(l,{variant:"b2",color:"gray-9"},n.getString("publicKey"))),t("td",null,t(l,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:r},d)))),t("tr",null,t("td",null,t(l,{variant:"b2",color:"gray-9"},n.getString("fingerprint"),"  (SHA-1)")),t("td",null,t(l,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:r},o.body.thumbprints["SHA-1"])))),s&&e.renderExpandedRow(o.body),t("tr",{class:"certificate_row_actions"},t("td",null,e.renderCertificateButtonActions(o),t(p,{onClick:e.handleClickRow.bind(e,i),startIcon:s?t(b,null):t(g,null)})))))))]);return}a.push([t("tr",{class:{m_expanded:s},key:o.body.thumbprints["SHA-1"]},t("td",null,t(p,{class:"button_table_cell",onClick:e.handleClickRow.bind(e,i),startIcon:s?t(b,null):t(g,null)})),!e.isHasRoots&&t("td",null,t(l,null,t("peculiar-highlight-words",{search:r},o.body.issuerCommonName))),t("td",null,t(l,null,t("peculiar-highlight-words",{search:r},o.name||o.body.commonName))),t("td",null,t(l,null,t("peculiar-highlight-words",{search:r},d))),t("td",null,t(l,null,t("peculiar-highlight-words",{search:r},o.body.thumbprints["SHA-1"]))),t("td",null,e.renderCertificateButtonActions(o))),s&&e.renderExpandedRow(o.body)])}));return a};e.prototype.renderCertificateDetailsModal=function(){if(!this.certificateSelectedForDetails){return null}return t("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},t("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),t("div",{class:"modal_container",role:"dialog",part:"presentation_container"},t("header",{class:"modal_header"},t(l,{variant:"h4"},n.getString("certificateDetails")),t(p,{onClick:this.handleModalClose,startIcon:t(h,null)})),t("div",{class:"modal_content"},t("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))};e.prototype.renderSearch=function(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return t("div",{class:"search_section"},t("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))};e.prototype.renderEmptyState=function(){var e=this.getMaxColSpanValue();return t("tr",null,t("td",{class:"status_wrapper",colSpan:e},t(l,{variant:"b1"},"There are no certificates available.")))};e.prototype.renderEmptySearchState=function(){var e=this.getMaxColSpanValue();return t("tr",null,t("td",{class:"status_wrapper",colSpan:e},t(l,{variant:"b1"},"No results found for “",this.search,"“")))};e.prototype.renderLoadingState=function(){return t("div",{class:"loading_container"},t("peculiar-circular-progress",null))};e.prototype.renderTableBody=function(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}var e=this.renderCertificatesRows();if(this.search&&!e.length){return this.renderEmptySearchState()}return e};e.prototype.render=function(){return t(o,{"data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),t("table",null,!this.mobileScreenView&&t("thead",null,t("tr",null,t("th",null),!this.isHasRoots&&t("th",{class:"col_issuer"},t(l,{variant:"s2"},n.getString("issuer"))),t("th",{class:"col_name"},t(l,{variant:"s2"},n.getString("name"))),t("th",{class:"col_public_key"},t(l,{variant:"s2"},n.getString("publicKey"))),t("th",{class:"col_fingerprint"},t(l,{variant:"s2"},n.getString("fingerprint"),"  (SHA-1)")),t("th",null))),t("tbody",null,this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())};Object.defineProperty(e,"watchers",{get:function(){return{certificates:["watchCertificates"]}},enumerable:false,configurable:true});return e}());m.style=y}}}));
13
- //# sourceMappingURL=p-441109db.system.entry.js.map
13
+ //# sourceMappingURL=p-a67b8793.system.entry.js.map
@@ -1,7 +1,7 @@
1
1
  var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,i){function c(e){try{s(a.next(e))}catch(e){i(e)}}function n(e){try{s(a["throw"](e))}catch(e){i(e)}}function s(e){e.done?r(e.value):o(e.value).then(c,n)}s((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a,o,i,c;return c={next:n(0),throw:n(1),return:n(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function n(e){return function(t){return s([e,t])}}function s(n){if(a)throw new TypeError("Generator is already executing.");while(c&&(c=0,n[0]&&(r=0)),r)try{if(a=1,o&&(i=n[0]&2?o["return"]:n[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,n[1])).done)return i;if(o=0,i)n=[n[0]&2,i.value];switch(n[0]){case 0:case 1:i=n;break;case 4:r.label++;return{value:n[1],done:false};case 5:r.label++;o=n[1];n=[0];continue;case 7:n=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(n[0]===6||n[0]===2)){r=0;continue}if(n[0]===3&&(!i||n[1]>i[0]&&n[1]<i[3])){r.label=n[1];break}if(n[0]===6&&r.label<i[1]){r.label=i[1];i=n;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(n);break}if(i[2])r.ops.pop();r.trys.pop();continue}n=t.call(e,r)}catch(e){n=[6,e];o=0}finally{a=i=0}if(n[0]&5)throw n[1];return{value:n[0]?n[1]:void 0,done:true}}};
2
2
  /*!
3
3
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
- */System.register(["./p-5aabeba7.system.js","./p-c0a298fd.system.js","./p-ae9189f6.system.js","./p-31586b23.system.js","./p-6667fe6e.system.js","./p-2fcad8cb.system.js"],(function(e){"use strict";var t,r,a,o,i,c,n,s,v,l,p,h,d,u,f;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H},function(e){i=e.i;c=e.a;n=e.b;s=e.c;v=e.d},function(){},function(e){l=e.X},function(e){p=e.X;h=e.C;d=e.a},function(e){u=e.T;f=e.B}],execute:function(){
4
+ */System.register(["./p-5aabeba7.system.js","./p-e0f4bda5.system.js","./p-14f281b0.system.js","./p-ab7dc738.system.js","./p-6e48afc4.system.js","./p-2fcad8cb.system.js"],(function(e){"use strict";var t,r,a,o,i,c,n,s,v,l,p,h,d,u,f;return{setters:[function(e){t=e.r;r=e.c;a=e.h;o=e.H},function(e){i=e.i;c=e.a;n=e.b;s=e.c;v=e.d},function(){},function(e){l=e.X},function(e){p=e.X;h=e.C;d=e.a},function(e){u=e.T;f=e.B}],execute:function(){
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -10,4 +10,4 @@ var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e ins
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  function g(e){return new Promise((function(t,r){var a=new FileReader;a.onload=function(){return t({value:a.result,fileName:e.name,fileSize:e.size,sourceMime:e.type})};a.onerror=function(){return r(a.error)};a.readAsBinaryString(e)}))}var b="*{-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 y=e("peculiar_certificate_decoder",function(){function e(e){var a=this;t(this,e);this.successParse=r(this,"successParse",7);this.clearCertificate=r(this,"clearCertificate",7);this.handleClickDecode=function(){var e=a.inputPaste.value;if(e){a.decode(e)}};this.handleClickClear=function(){a.clearValue()};this.handleChangeInputFile=function(e){return __awaiter(a,void 0,void 0,(function(){var t,r;return __generator(this,(function(a){switch(a.label){case 0:t=e.target;if(!t.files)return[3,2];return[4,g(t.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}t.value="";a.label=2;case 2:return[2]}}))}))};this.handleChangeExample=function(e){if(e.target.value){a.decode(e.target.value)}else{a.clearValue()}};this.handleDropFile=function(e){return __awaiter(a,void 0,void 0,(function(){var t,r;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();e.preventDefault();t=e.dataTransfer;if(!t.files)return[3,2];return[4,g(t.files[0])];case 1:r=a.sent();if(typeof r.value==="string"){this.decode(r.value)}a.label=2;case 2:return[2]}}))}))};this.certificateExamples=undefined;this.defaultCertificate=undefined;this.certificateDecoded=undefined}e.prototype.componentDidLoad=function(){var e=this;if(this.defaultCertificate){setTimeout((function(){return e.decode(e.defaultCertificate)}),100)}};e.prototype.clearValue=function(){this.inputPaste.value="";this.certificateDecoded=null;this.clearCertificate.emit()};e.prototype.setValue=function(e){this.certificateDecoded=e;this.inputPaste.value=e.exportAsPemFormatted();this.successParse.emit(e.exportAsBase64())};e.prototype.decode=function(e){var t=i(e);var r=c(e);var a=n(e);var o=s(e);var u=v(e);var f;var g;if(t&&!(r||o||a||u)){this.clearValue();alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.");return}try{if(r){f=new l(e)}if(o){f=new p(e)}if(a){f=new h(e)}if(u){f=new d(e)}}catch(e){g=e}if(!f){try{f=new l(e)}catch(e){g=e}}if(!f){try{f=new p(e)}catch(e){g=e}}if(!f){try{f=new h(e)}catch(e){g=e}}if(!f){try{f=new d(e)}catch(e){g=e}}if(!f){this.clearValue();console.log(g);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}else{this.setValue(f)}};e.prototype.render=function(){var e=this;var t;return a(o,null,a("textarea",{placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:function(t){e.inputPaste=t},onDrop:this.handleDropFile}),a("div",{class:"controls"},a("div",{class:"control_row"},a(u,{variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),a("input",{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:""})),((t=this.certificateExamples)===null||t===void 0?void 0:t.length)&&a("div",{class:"control_row"},a(u,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),a("select",{onChange:this.handleChangeExample},a("option",{value:""},"None"),this.certificateExamples.map((function(e){return a("option",{value:e.value},e.title)})))),a("div",{class:"control_row"},a(f,{onClick:this.handleClickDecode},"Decode"),a(f,{onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof l&&a("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof p&&a("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof h&&a("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof d&&a("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))};return e}());y.style=b}}}));
13
- //# sourceMappingURL=p-e39de121.system.entry.js.map
13
+ //# sourceMappingURL=p-a720c0a5.system.entry.js.map
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import{r as t,c as e,h as r,H as o}from"./p-0b356bb5.js";import{i as a,a as s,b as c,c as i,d as n}from"./p-74c241e7.js";import"./p-a053c132.js";import{X as v}from"./p-6e79b9c8.js";import{X as p,C as l,a as h}from"./p-43eb3721.js";import{T as g,B as d}from"./p-7f9beaa8.js";
4
+ import{r as t,c as e,h as r,H as o}from"./p-0b356bb5.js";import{i as a,a as s,b as c,c as i,d as n}from"./p-4a6ceeda.js";import"./p-59e5ac12.js";import{X as v}from"./p-48474b8d.js";import{X as p,C as l,a as h}from"./p-8fac1d56.js";import{T as g,B as d}from"./p-7f9beaa8.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -9,4 +9,4 @@ import{r as t,c as e,h as r,H as o}from"./p-0b356bb5.js";import{i as a,a as s,b
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
  */function b(t){return new Promise(((e,r)=>{const o=new FileReader;o.onload=()=>e({value:o.result,fileName:t.name,fileSize:t.size,sourceMime:t.type});o.onerror=()=>r(o.error);o.readAsBinaryString(t)}))}const f="*{-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 y=class{constructor(r){t(this,r);this.successParse=e(this,"successParse",7);this.clearCertificate=e(this,"clearCertificate",7);this.handleClickDecode=()=>{const{value:t}=this.inputPaste;if(t){this.decode(t)}};this.handleClickClear=()=>{this.clearValue()};this.handleChangeInputFile=async t=>{const e=t.target;if(e.files){const t=await b(e.files[0]);if(typeof t.value==="string"){this.decode(t.value)}e.value=""}};this.handleChangeExample=t=>{if(t.target.value){this.decode(t.target.value)}else{this.clearValue()}};this.handleDropFile=async t=>{t.stopPropagation();t.preventDefault();const e=t.dataTransfer;if(e.files){const t=await b(e.files[0]);if(typeof t.value==="string"){this.decode(t.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(t){this.certificateDecoded=t;this.inputPaste.value=t.exportAsPemFormatted();this.successParse.emit(t.exportAsBase64())}decode(t){const e=a(t);const r=s(t);const o=c(t);const g=i(t);const d=n(t);let b;let f;if(e&&!(r||g||o||d)){this.clearValue();alert("Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.");return}try{if(r){b=new v(t)}if(g){b=new p(t)}if(o){b=new l(t)}if(d){b=new h(t)}}catch(t){f=t}if(!b){try{b=new v(t)}catch(t){f=t}}if(!b){try{b=new p(t)}catch(t){f=t}}if(!b){try{b=new l(t)}catch(t){f=t}}if(!b){try{b=new h(t)}catch(t){f=t}}if(!b){this.clearValue();console.log(f);alert("Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest/CRL.")}else{this.setValue(b)}}render(){var t;return r(o,null,r("textarea",{placeholder:"Certificate DER or PEM",class:"textarea t-b2 c-black",ref:t=>{this.inputPaste=t},onDrop:this.handleDropFile}),r("div",{class:"controls"},r("div",{class:"control_row"},r(g,{variant:"b3",color:"secondary-tint-2"},"Drag or load file:"),r("input",{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:""})),((t=this.certificateExamples)===null||t===void 0?void 0:t.length)&&r("div",{class:"control_row"},r(g,{variant:"b3",color:"secondary-tint-2"},"Load examples:"),r("select",{onChange:this.handleChangeExample},r("option",{value:""},"None"),this.certificateExamples.map((t=>r("option",{value:t.value},t.title))))),r("div",{class:"control_row"},r(d,{onClick:this.handleClickDecode},"Decode"),r(d,{onClick:this.handleClickClear},"Clear"))),this.certificateDecoded instanceof v&&r("peculiar-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof p&&r("peculiar-attribute-certificate-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof l&&r("peculiar-csr-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}),this.certificateDecoded instanceof h&&r("peculiar-crl-viewer",{certificate:this.certificateDecoded,class:"viewer",download:true}))}};y.style=f;export{y as peculiar_certificate_decoder};
12
- //# sourceMappingURL=p-882e1281.entry.js.map
12
+ //# sourceMappingURL=p-a7386b78.entry.js.map
@@ -0,0 +1,13 @@
1
+ var __extends=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return t(e,r)};return function(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{u(n.next(t))}catch(t){i(t)}}function s(t){try{u(n["throw"](t))}catch(t){i(t)}}function u(t){t.done?r(t.value):o(t.value).then(a,s)}u((n=n.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:[]},n,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(e){return u([t,e])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(r=0)),r)try{if(n=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{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
2
+ /*!
3
+ * © Peculiar Ventures https://peculiarventures.com/ - MIT License
4
+ */System.register(["./p-e0f4bda5.system.js","./p-14f281b0.system.js"],(function(t){"use strict";var e,r,n,o,i,a,s,u,c,f,l,p,h,m,b,y,v,g,d,w,j;return{setters:[function(t){e=t.A;r=t.e;n=t.C;o=t.N;i=t.f;a=t.E;s=t.g;u=t.h;c=t.j;f=t.k;l=t.R;p=t.l;h=t.m;m=t.n;b=t.o;y=t.p;v=t.q;g=t.r;d=t.s},function(t){w=t.C;j=t.D}],execute:function(){
5
+ /**
6
+ * @license
7
+ * Copyright (c) Peculiar Ventures, LLC.
8
+ *
9
+ * This source code is licensed under the MIT license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ */
12
+ var _=function(t){__extends(e,t);function e(e){var a=t.call(this,r(e),n)||this;a.thumbprints={};a.type="X.509 Certificate";var s=a.asn.tbsCertificate;a.serialNumber=w.ToHex(s.serialNumber);a.subject=new o(s.subject).toJSON();a.issuer=new o(s.issuer).toJSON();a.version=s.version+1;var u=s.validity.notBefore.utcTime||s.validity.notBefore.generalTime;if(!u){throw new Error("Cannot get 'notBefore' value")}a.notBefore=u;var c=s.validity.notAfter.utcTime||s.validity.notAfter.generalTime;if(!c){throw new Error("Cannot get 'notAfter' value")}a.notAfter=c;a.validity=i(a.notBefore,a.notAfter);return a}e.prototype.parseExtensions=function(){var t=this.asn.tbsCertificate;if(t.extensions){this.extensions=t.extensions.map((function(t){return new a(s.serialize(t))}))}};e.prototype.getPublicKeyInfo=function(t){var e=this;var r=t.subjectPublicKey,n=t.algorithm;var o;if(n.algorithm===u&&n.parameters){o=s.parse(n.parameters,c)}if(n.algorithm===f){o=s.parse(r,l)}if(n.algorithm===p){o=s.parse(r,h);o=o.map((function(t){return e.getPublicKeyInfo(t)}))}var i=s.serialize(t);return{params:o,value:i,algorithm:n.algorithm}};Object.defineProperty(e.prototype,"publicKey",{get:function(){return this.getPublicKeyInfo(this.asn.tbsCertificate.subjectPublicKeyInfo)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"signature",{get:function(){var t=this.asn,e=t.signatureValue,r=t.signatureAlgorithm;var n;if(r.algorithm===m){var o=s.parse(e,b);var i=s.parse(r.parameters,y);n=i.map((function(t,e){return Object.assign(Object.assign({},t),{value:o[e]})}))}return{params:n,value:e,algorithm:r.algorithm}},enumerable:false,configurable:true});e.prototype.exportAsBase64=function(){return w.ToBase64(this.raw)};e.prototype.exportAsHexFormatted=function(){return v(w.ToHex(this.raw))};e.prototype.exportAsPemFormatted=function(){return"-----BEGIN CERTIFICATE-----\n".concat(g(this.exportAsBase64()),"\n-----END CERTIFICATE-----")};e.prototype.getThumbprint=function(t){if(t===void 0){t="SHA-1"}return __awaiter(this,void 0,void 0,(function(){var e,r;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,d(t,this.raw)];case 1:e=n.sent();if(e){this.thumbprints[t]=w.ToHex(e)}return[3,3];case 2:r=n.sent();console.error("Error thumbprint get:",r);return[3,3];case 3:return[2]}}))}))};Object.defineProperty(e.prototype,"commonName",{get:function(){if(!this.subject){return""}for(var t=0;t<this.subject.length;t+=1){var e=this.subject[t];if(e.shortName==="CN"||e.shortName==="E"||e.shortName==="O"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"issuerCommonName",{get:function(){if(!this.issuer){return""}for(var t=0;t<this.issuer.length;t+=1){var e=this.issuer[t];if(e.shortName==="CN"){return e.value}if(e.shortName==="E"){return e.value}}return""},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isRoot",{get:function(){return JSON.stringify(this.issuer)===JSON.stringify(this.subject)},enumerable:false,configurable:true});e.prototype.subjectToString=function(){if(!this.subject){return""}return this.subject.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.issuerToString=function(){if(!this.issuer){return""}return this.issuer.map((function(t){return"".concat(t.shortName,"=").concat(t.value)})).join(", ")};e.prototype.downloadAsPEM=function(t){j.cert.asPEM(this.exportAsPemFormatted(),t||this.commonName)};e.prototype.downloadAsDER=function(t){j.cert.asDER(this.exportAsHexFormatted(),t||this.commonName)};return e}(e);t("X",_)}}}));
13
+ //# sourceMappingURL=p-ab7dc738.system.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__extends","X509Certificate","_super","raw","_this","call","this","certificateRawToBuffer","Certificate","thumbprints","type","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","exportAsBase64","ToBase64","exportAsHexFormatted","hexFormat","exportAsPemFormatted","concat","base64Format","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","i","length","name","shortName","JSON","stringify","subjectToString","join","issuerToString","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 type: string = 'X.509 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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE-----`;\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 downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;kBAgDqCA,UAAAC,EAAAC,GAqBnC,SAAAD,EAAYE,GAAZ,IAAAC,EACEF,EAAAG,KAAAC,KAAMC,EAAuBJ,GAAMK,IAAYF,KAL1CF,EAAAK,YAAsC,GAEtCL,EAAAM,KAAe,oBAKZ,IAAAC,EAAmBP,EAAKQ,IAAGD,eAEnCP,EAAKS,aAAeC,UAAQC,MAAMJ,EAAeE,cACjDT,EAAKY,QAAU,IAAIC,EA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NkBG,G"}
1
+ {"version":3,"names":["__extends","X509Certificate","_super","raw","_this","call","this","certificateRawToBuffer","Certificate","thumbprints","type","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","exportAsBase64","ToBase64","exportAsHexFormatted","hexFormat","exportAsPemFormatted","concat","base64Format","getThumbprint","getCertificateThumbprint","thumbprint","sent","console","error","error_1","i","length","name","shortName","JSON","stringify","subjectToString","join","issuerToString","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 type: string = 'X.509 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 exportAsBase64() {\n return Convert.ToBase64(this.raw);\n }\n\n public exportAsHexFormatted() {\n return hexFormat(Convert.ToHex(this.raw));\n }\n\n public exportAsPemFormatted() {\n return `-----BEGIN CERTIFICATE-----\\n${base64Format(this.exportAsBase64())}\\n-----END CERTIFICATE-----`;\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 downloadAsPEM(name?: string) {\n Download.cert.asPEM(\n this.exportAsPemFormatted(),\n name || this.commonName,\n );\n }\n\n public downloadAsDER(name?: string) {\n Download.cert.asDER(\n this.exportAsHexFormatted(),\n name || this.commonName,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;kBAgDqCA,UAAAC,EAAAC,GAqBnC,SAAAD,EAAYE,GAAZ,IAAAC,EACEF,EAAAG,KAAAC,KAAMC,EAAuBJ,GAAMK,IAAYF,KAL1CF,EAAAK,YAAsC,GAEtCL,EAAAM,KAAe,oBAKZ,IAAAC,EAAmBP,EAAKQ,IAAGD,eAEnCP,EAAKS,aAAeC,EAAQC,MAAMJ,EAAeE,cACjDT,EAAKY,QAAU,IAAIC,EAAKN,EAAeK,SAASE,SAChDd,EAAKe,OAAS,IAAIF,EAAKN,EAAeQ,QAAQD,SAC9Cd,EAAKgB,QAAUT,EAAeS,QAAU,EAExC,IAAMC,EAAYV,EAAeW,SAASD,UAAUE,SAC/CZ,EAAeW,SAASD,UAAUG,YAEvC,IAAKH,EAAW,CACd,MAAM,IAAII,MAAM,+B,CAGlBrB,EAAKiB,UAAYA,EAEjB,IAAMK,EAAWf,EAAeW,SAASI,SAASH,SAC7CZ,EAAeW,SAASI,SAASF,YAEtC,IAAKE,EAAU,CACb,MAAM,IAAID,MAAM,8B,CAGlBrB,EAAKsB,SAAWA,EAChBtB,EAAKkB,SAAWK,EAASvB,EAAKiB,UAAWjB,EA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C,YAAc,IAAK,CAC1B,OAAOD,EAAK9B,K,EAIhB,MAAO,E,uCAGTC,OAAAC,eAAWpD,EAAA2B,UAAA,SAAM,C,IAAjB,WACE,OAAOuD,KAAKC,UAAU9E,KAAKa,UAAYgE,KAAKC,UAAU9E,KAAKU,Q,uCAGtDf,EAAA2B,UAAAyD,gBAAA,WACL,IAAK/E,KAAKU,QAAS,CACjB,MAAO,E,CAGT,OAAOV,KAAKU,QACTe,KAAI,SAACkD,GAAI,MACR,GAAAX,OAAGW,EAAKC,UAAS,KAAAZ,OAAIW,EAAK9B,MADlB,IAGTmC,KAAK,K,EAGHrF,EAAA2B,UAAA2D,eAAA,WACL,IAAKjF,KAAKa,OAAQ,CAChB,MAAO,E,CAGT,OAAOb,KAAKa,OACTY,KAAI,SAACkD,GAAI,MACR,GAAAX,OAAGW,EAAKC,UAAS,KAAAZ,OAAIW,EAAK9B,MADlB,IAGTmC,KAAK,K,EAGHrF,EAAA2B,UAAA4D,cAAA,SAAcP,GACnBQ,EAASC,KAAKC,MACZrF,KAAK+D,uBACLY,GAAQ3E,KAAKsF,W,EAIV3F,EAAA2B,UAAAiE,cAAA,SAAcZ,GACnBQ,EAASC,KAAKI,MACZxF,KAAK6D,uBACLc,GAAQ3E,KAAKsF,W,YApNkBG,G"}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * © Peculiar Ventures https://peculiarventures.com/ - MIT License
3
3
  */
4
- import{h as t,r as e,c as a,H as r}from"./p-0b356bb5.js";import{X as o}from"./p-6e79b9c8.js";import{$ as s,a0 as i,a1 as n}from"./p-74c241e7.js";import"./p-a053c132.js";import{T as c,B as l}from"./p-7f9beaa8.js";import{D as p,L as v,C as h}from"./p-370cee20.js";import{D as d}from"./p-17e3c47b.js";import{a as b,A as g}from"./p-0fc2e2b4.js";
4
+ import{h as t,r as e,c as a,H as r}from"./p-0b356bb5.js";import{X as o}from"./p-48474b8d.js";import{$ as s,a0 as i,a1 as n}from"./p-4a6ceeda.js";import"./p-59e5ac12.js";import{T as c,B as l}from"./p-7f9beaa8.js";import{D as p,L as v,C as h}from"./p-370cee20.js";import{D as d}from"./p-17e3c47b.js";import{a as b,A as g}from"./p-0fc2e2b4.js";
5
5
  /**
6
6
  * @license
7
7
  * Copyright (c) Peculiar Ventures, LLC.
@@ -9,4 +9,4 @@ import{h as t,r as e,c as a,H as r}from"./p-0b356bb5.js";import{X as o}from"./p-
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
  */const u=e=>{const{certificate:a,showIssuer:r}=e;const o=(e,a)=>t("tr",null,t("td",null,t(c,{variant:"b2",color:"gray-9"},e)),t("td",null,t(c,{variant:"b2",color:"black"},a)));return t("table",null,t("tbody",null,o(s.getString("subjectName"),a.subjectToString()),r&&o(s.getString("issuerName"),a.issuerToString()),o(s.getString("serialNumber"),a.serialNumber),o(s.getString("version"),a.version),o(s.getString("validity"),a.validity),o(s.getString("issued"),i(a.notBefore)),o(s.getString("expired"),i(a.notAfter))))};const m="*{-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%;word-wrap:break-word;min-width:280px;overflow:auto;position:relative}.search_section{padding:var(--pv-size-base-4);border-bottom:1px solid var(--pv-color-gray-4)}.input_search{height:var(--pv-size-base-8);width:100%;outline:none;background-color:var(--pv-color-gray-1);padding:0 var(--pv-size-base-2);border:1px solid var(--pv-color-gray-7);border-radius:4px;-webkit-transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s;transition:background-color 200ms ease 0s, color 200ms ease 0s, border-color 200ms ease 0s}.input_search::-webkit-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-moz-placeholder{color:var(--pv-color-gray-9)}.input_search:-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::-ms-input-placeholder{color:var(--pv-color-gray-9)}.input_search::placeholder{color:var(--pv-color-gray-9)}table{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0}table td,table th{border-bottom:1px solid var(--pv-color-gray-4);vertical-align:top;text-align:left}table td:first-child,table th:first-child{padding-right:0;width:var(--pv-size-base-10)}table td:last-child,table th:last-child{padding-left:0;width:var(--pv-size-base-10)}table th{padding:var(--pv-size-base-2) var(--pv-size-base-4)}table th.col_action{padding:0}table td{padding:var(--pv-size-base-4)}table tr.m_expanded{background:var(--pv-color-gray-1)}table tr.m_expanded>td{border-bottom:none}table tr.expanded_summary{background:var(--pv-color-gray-1)}table tr.expanded_summary table{table-layout:initial}table tr.expanded_summary table td{border-bottom:none;padding:var(--pv-size-base-2)}table tr.expanded_summary table td:first-child{width:200px}table tr.expanded_summary table td:last-child{width:auto}.button_table_cell{margin-top:-3px}.status_wrapper{text-align:center;height:var(--pv-size-base-16);vertical-align:middle}.modal_wrapper{position:fixed;top:0;left:0;width:100%;height:100%;z-index:1;-webkit-animation:fadeIn 200ms;animation:fadeIn 200ms;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.modal_backdrop{background:var(--pv-color-black);z-index:-1;position:fixed;top:0;right:0;bottom:0;left:0;opacity:0.5}.modal_container{background:var(--pv-color-white);width:100%;display:-ms-flexbox;display:flex;max-height:calc(100% - 60px);-ms-flex-direction:column;flex-direction:column;margin:var(--pv-size-base-6);position:relative;outline:none;-webkit-box-shadow:var(--pv-shadow-dark-hight);box-shadow:var(--pv-shadow-dark-hight);overflow:hidden;border:0px;padding:0px;max-width:640px;border-radius:4px}.modal_header{padding:var(--pv-size-base-3) var(--pv-size-base-4);display:-ms-flexbox;display:flex;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;gap:var(--pv-size-base-2);border-bottom:1px solid var(--pv-color-gray-5)}.modal_content{-ms-flex:1 1 auto;flex:1 1 auto;overflow:auto}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tbody,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block;width:100% !important;padding:0;border:none}:host([data-mobile-screen-view=true]) thead{display:none}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table .expanded_summary{padding:0}:host([data-mobile-screen-view=true]) table .certificate_row{border-bottom:1px solid var(--pv-color-gray-5);padding:var(--pv-size-base-2) var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table .certificate_row_actions{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table .certificate_row_actions td{display:-ms-flexbox;display:flex;-ms-flex-pack:right;justify-content:right;gap:var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) .button_table_cell{margin-top:0}";const x=class{constructor(t){e(this,t);this.detailsOpen=a(this,"detailsOpen",7);this.detailsClose=a(this,"detailsClose",7);this.isHasRoots=false;this.handleClickDetails=t=>{this.certificateSelectedForDetails=t;this.detailsOpen.emit(t)};this.handleModalClose=()=>{this.certificateSelectedForDetails=undefined;this.detailsClose.emit()};this.handleSearch=t=>{this.search=t.target.value.trim()};this.certificates=[];this.filterWithSearch=true;this.highlightWithSearch=true;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.search="";this.certificatesDecoded=[];this.expandedRow=undefined;this.certificateSelectedForDetails=undefined;this.isDecodeInProcess=true}handleMediaQueryChange(t){this.mobileScreenView=t.matches}componentWillLoad(){this.certificatesDecodeAndSet();{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}}disconnectedCallback(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))}watchCertificates(t,e){if(JSON.stringify(t)!==JSON.stringify(e)){this.certificatesDecodeAndSet()}}async certificatesDecodeAndSet(){let t=false;if(!Array.isArray(this.certificates)){return}const e=[];for(const a of this.certificates){try{const r=new o(a.value);await r.getThumbprint("SHA-1");e.push({body:r,tests:a.tests,name:a.name});if(!t&&r.isRoot){t=true}}catch(t){console.error("Error certificate parse:",t)}}this.isHasRoots=t;this.isDecodeInProcess=false;this.certificatesDecoded=e}handleClickDownloadAsPem(t){t.body.downloadAsPEM(t.name||t.body.commonName)}handleClickDownloadAsDer(t){t.body.downloadAsDER(t.name||t.body.commonName)}handleClickRow(t){const e=this.expandedRow===t;this.expandedRow=e?undefined:t}getMaxColSpanValue(){let t=5;if(!this.isHasRoots){t+=1}return t}renderCertificateButtonActions(e){var a,r,o;const i=e.tests&&(e.tests.expired||e.tests.revoked||e.tests.valid);return t("peculiar-button-menu",{class:"button_table_cell",groups:[{title:s.getString("previewCertificate"),options:[{text:s.getString("viewDetails"),startIcon:t(p,null),onClick:()=>this.handleClickDetails(e.body)}]},{title:s.getString("downloadOptions"),options:[{text:s.getString("download.pem"),startIcon:t(d,null),onClick:()=>this.handleClickDownloadAsPem(e)},{text:s.getString("download.der"),startIcon:t(d,null),onClick:()=>this.handleClickDownloadAsDer(e)}]},...i?[{title:s.getString("testURLs"),options:[...((a=e.tests)===null||a===void 0?void 0:a.valid)?[{text:s.getString("valid"),href:e.tests.valid,startIcon:t(v,null)}]:[],...((r=e.tests)===null||r===void 0?void 0:r.revoked)?[{text:s.getString("revoked"),href:e.tests.revoked,startIcon:t(v,null)}]:[],...((o=e.tests)===null||o===void 0?void 0:o.expired)?[{text:s.getString("expired"),href:e.tests.expired,startIcon:t(v,null)}]:[]]}]:[]]})}renderExpandedRow(e){const a=this.getMaxColSpanValue()-2;return t("tr",{class:"expanded_summary"},t("td",null),t("td",{colSpan:a},t(u,{certificate:e,showIssuer:!e.isRoot})),t("td",null))}renderCertificatesRows(){const e=this.highlightWithSearch?this.search:"";const a=[];this.certificatesDecoded.forEach(((r,o)=>{const i=o===this.expandedRow;const p=n[r.body.signature.algorithm]||r.body.signature.algorithm;if(this.filterWithSearch&&this.search){const t=[p,r.body.issuerCommonName,r.name,r.body.commonName,r.body.thumbprints["SHA-1"]].join(" ").toLowerCase();if(t.indexOf(this.search.toLowerCase())===-1){return}}if(this.mobileScreenView){a.push([t("tr",{class:{certificate_row:true,m_expanded:i},key:r.body.thumbprints["SHA-1"]},t("td",null,t("table",null,t("tbody",null,!this.isHasRoots&&t("tr",null,t("td",null,t(c,{variant:"b2",color:"gray-9"},s.getString("issuer"))),t("td",null,t(c,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:e},r.body.issuerCommonName)))),t("tr",null,t("td",null,t(c,{variant:"b2",color:"gray-9"},s.getString("name"))),t("td",null,t(c,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:e},r.name||r.body.commonName)))),t("tr",null,t("td",null,t(c,{variant:"b2",color:"gray-9"},s.getString("publicKey"))),t("td",null,t(c,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:e},p)))),t("tr",null,t("td",null,t(c,{variant:"b2",color:"gray-9"},s.getString("fingerprint"),"  (SHA-1)")),t("td",null,t(c,{variant:"b2",color:"black"},t("peculiar-highlight-words",{search:e},r.body.thumbprints["SHA-1"])))),i&&this.renderExpandedRow(r.body),t("tr",{class:"certificate_row_actions"},t("td",null,this.renderCertificateButtonActions(r),t(l,{onClick:this.handleClickRow.bind(this,o),startIcon:i?t(b,null):t(g,null)})))))))]);return}a.push([t("tr",{class:{m_expanded:i},key:r.body.thumbprints["SHA-1"]},t("td",null,t(l,{class:"button_table_cell",onClick:this.handleClickRow.bind(this,o),startIcon:i?t(b,null):t(g,null)})),!this.isHasRoots&&t("td",null,t(c,null,t("peculiar-highlight-words",{search:e},r.body.issuerCommonName))),t("td",null,t(c,null,t("peculiar-highlight-words",{search:e},r.name||r.body.commonName))),t("td",null,t(c,null,t("peculiar-highlight-words",{search:e},p))),t("td",null,t(c,null,t("peculiar-highlight-words",{search:e},r.body.thumbprints["SHA-1"]))),t("td",null,this.renderCertificateButtonActions(r))),i&&this.renderExpandedRow(r.body)])}));return a}renderCertificateDetailsModal(){if(!this.certificateSelectedForDetails){return null}return t("div",{class:"modal_wrapper",role:"presentation","aria-hidden":"false",part:"presentation"},t("div",{class:"modal_backdrop",onClick:this.handleModalClose,"aria-hidden":"true"}),t("div",{class:"modal_container",role:"dialog",part:"presentation_container"},t("header",{class:"modal_header"},t(c,{variant:"h4"},s.getString("certificateDetails")),t(l,{onClick:this.handleModalClose,startIcon:t(h,null)})),t("div",{class:"modal_content"},t("peculiar-certificate-viewer",{certificate:this.certificateSelectedForDetails,mobileMediaQueryString:this.mobileMediaQueryString}))))}renderSearch(){if(!this.filterWithSearch&&!this.highlightWithSearch){return null}return t("div",{class:"search_section"},t("input",{onInput:this.handleSearch,type:"search",value:"",class:"input_search t-b3 c-black",disabled:!this.certificatesDecoded.length,placeholder:"Search"}))}renderEmptyState(){const e=this.getMaxColSpanValue();return t("tr",null,t("td",{class:"status_wrapper",colSpan:e},t(c,{variant:"b1"},"There are no certificates available.")))}renderEmptySearchState(){const e=this.getMaxColSpanValue();return t("tr",null,t("td",{class:"status_wrapper",colSpan:e},t(c,{variant:"b1"},"No results found for “",this.search,"“")))}renderLoadingState(){return t("div",{class:"loading_container"},t("peculiar-circular-progress",null))}renderTableBody(){if(this.isDecodeInProcess){return null}if(!this.certificatesDecoded.length){return this.renderEmptyState()}const t=this.renderCertificatesRows();if(this.search&&!t.length){return this.renderEmptySearchState()}return t}render(){return t(r,{"data-mobile-screen-view":String(this.mobileScreenView)},this.renderSearch(),t("table",null,!this.mobileScreenView&&t("thead",null,t("tr",null,t("th",null),!this.isHasRoots&&t("th",{class:"col_issuer"},t(c,{variant:"s2"},s.getString("issuer"))),t("th",{class:"col_name"},t(c,{variant:"s2"},s.getString("name"))),t("th",{class:"col_public_key"},t(c,{variant:"s2"},s.getString("publicKey"))),t("th",{class:"col_fingerprint"},t(c,{variant:"s2"},s.getString("fingerprint"),"  (SHA-1)")),t("th",null))),t("tbody",null,this.renderTableBody())),this.renderCertificateDetailsModal(),this.isDecodeInProcess&&this.renderLoadingState())}static get watchers(){return{certificates:["watchCertificates"]}}};x.style=m;export{x as peculiar_certificates_viewer};
12
- //# sourceMappingURL=p-bcc86979.entry.js.map
12
+ //# sourceMappingURL=p-c35b180c.entry.js.map