@peculiar/certificates-viewer 3.10.1-alpha.12 → 3.10.1-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/attribute-certificate-viewer.js +1 -1
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/certificate-viewer.js +1 -1
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +1 -1
- package/components/crl-viewer.js.map +1 -1
- package/components/csr-viewer.js +1 -1
- package/components/csr-viewer.js.map +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +3 -3
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
- package/dist/collection/components/certificate-viewer/certificate-viewer.css +2 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +3 -3
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/peculiar/p-3788176f.system.entry.js +111 -0
- package/dist/peculiar/p-3788176f.system.entry.js.map +1 -0
- package/dist/peculiar/{p-9b4a8101.system.entry.js → p-4562ae8b.system.entry.js} +2 -2
- package/dist/peculiar/p-4562ae8b.system.entry.js.map +1 -0
- package/dist/peculiar/{p-a41ecd82.entry.js → p-7215de9c.entry.js} +2 -2
- package/dist/peculiar/p-7215de9c.entry.js.map +1 -0
- package/dist/peculiar/p-79d470a8.entry.js +110 -0
- package/dist/peculiar/p-79d470a8.entry.js.map +1 -0
- package/dist/peculiar/p-80832207.system.js +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/hydrate/index.js +4 -4
- package/package.json +3 -3
- package/dist/peculiar/p-99e3aa0c.system.entry.js +0 -111
- package/dist/peculiar/p-99e3aa0c.system.entry.js.map +0 -1
- package/dist/peculiar/p-9b4a8101.system.entry.js.map +0 -1
- package/dist/peculiar/p-a41ecd82.entry.js.map +0 -1
- package/dist/peculiar/p-e2cc7410.entry.js +0 -110
- package/dist/peculiar/p-e2cc7410.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BasicAttribute","props","children","attribute","h","RowValue","name","value","getStringByOID","asn","type","colSpan","class","NamePart","map","relativeDistinguishedName","attributeTypeAndValue","OIDs","toString","NameAttribute","ActivityDescriptionAttribute","GeneralNamePart","generalName","codeAuthority","getDNSNameLink","getIPAddressLink","codeId","shortName","shortDescription","WebGdprAttribute","assessmentAuthority","assessmentLocation","assessmentRef","dataStorageTerritory","description","InsuranceValueAttribute","concat","base","degree","location","TypeRelationshipAttribute","Object","keys","keyName","toNumber","l10n","getString","getValueRank","ratio","ValuationRankingAttribute","values","AsStringAttribute","monospace","UnstructuredNameAttribute","utf8String","ChallengePasswordAttribute","Attributes","attributes","length","RowTitle","Name","ActivityDescription","WebGDPR","InsuranceValue","TypeRelationship","ValuationRanking","UnstructuredName","ChallengePassword","error","console","RevokedCertificates","revokedCertificates","certificate","Convert","ToHex","userCertificate","dateShort","revocationDate","getTime","crlEntryExtensions","TableRowTable","extension","CRLReason","extnID","toJSON","reason","InvalidityDate","CertificateIssuer","gn","extnValue","Holder","holder","baseCertificateID","objectDigestInfo","issuer","item","serial","digestAlgorithm","algorithm","objectDigest","digestedObjectType","Issuer","certificateViewerCss","AttributeCertificateViewer","this","getAuthKeyIdParentLink","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509AttributeCertificate","certificateDecoded","parseExtensions","parseAttributes","getThumbprint","_b","sent","certificateDecodeError","error_1","watchCertificateAndDecode","newValue","oldValue","serialNumber","renderErrorState","Typography","renderEmptyState","render","Host","String","BasicInformation","assign","Signature","signature","Thumbprints","thumbprints","getLEILink","Extensions","extensions","download","Miscellaneous","CrlViewer","class_2","CRL","error_2","getIssuerDnLink","issuerDnLink","commonName","IssuerName","CsrViewer","class_3","CSR","error_3","getExtensionRequestAttribute","undefined","find","extensionRequestAttribute","SubjectName","subject","PublicKey","publicKey","title"],"sources":["src/components/certificate-details-parts/attributes/basic_attribute.tsx","src/components/certificate-details-parts/attributes/name_part.tsx","src/components/certificate-details-parts/attributes/name_attribute.tsx","src/components/certificate-details-parts/attributes/activity_description_attribute.tsx","src/components/certificate-details-parts/attributes/web_gdpr_attribute.tsx","src/components/certificate-details-parts/attributes/insurance_value_attribute.tsx","src/components/certificate-details-parts/attributes/type_relationship_attribute.tsx","src/components/certificate-details-parts/attributes/valuation_ranking_attribute.tsx","src/components/certificate-details-parts/attributes/as_string_attribute.tsx","src/components/certificate-details-parts/attributes/unstructured_name_attribute.tsx","src/components/certificate-details-parts/attributes/challenge_password_attribute.tsx","src/components/certificate-details-parts/attributes/index.tsx","src/components/certificate-details-parts/revoked_certificates.tsx","src/components/certificate-details-parts/holder.tsx","src/components/certificate-details-parts/issuer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-attribute-certificate-viewer&encapsulation=shadow","src/components/attribute-certificate-viewer/attribute-certificate-viewer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-crl-viewer&encapsulation=shadow","src/components/crl-viewer/crl-viewer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-csr-viewer&encapsulation=shadow","src/components/csr-viewer/csr-viewer.tsx"],"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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { Attribute, TAttributeValue } from '../../../crypto/attribute';\nimport { getStringByOID } from '../../../utils';\nimport { RowValue } from '../row';\n\ninterface IBasicAttributeProps {\n attribute: Attribute<TAttributeValue>;\n}\n\nexport const BasicAttribute: FunctionalComponent<IBasicAttributeProps> = (props, children) => {\n const { attribute } = props;\n\n return ([\n <RowValue\n name=\"Name\"\n value={getStringByOID(attribute.asn.type)}\n />,\n children,\n <tr>\n <td colSpan={2} class=\"divider\">\n <span />\n </td>\n </tr>,\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { Name } from '@peculiar/asn1-x509';\n\nimport { OIDs } from '../../../constants/oids';\nimport { RowValue } from '../row';\n\ninterface INamePartProps {\n name: Name;\n}\n\nexport const NamePart: FunctionalComponent<INamePartProps> = (props): any[] => {\n const { name } = props;\n\n if (!name) {\n return null;\n }\n\n return name.map((relativeDistinguishedName) => (\n relativeDistinguishedName.map((attributeTypeAndValue) => (\n <RowValue\n name={OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type}\n value={attributeTypeAndValue.value.toString()}\n />\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { Name } from '@peculiar/asn1-x509';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { BasicAttribute } from './basic_attribute';\nimport { NamePart } from './name_part';\n\ninterface INameAttributeProps {\n attribute: Attribute<Name>;\n}\n\nexport const NameAttribute:\nFunctionalComponent<INameAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <NamePart\n name={attribute.value}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ActivityDescription } from '@peculiar/asn1-ntqwac';\n\nimport { Attribute } from '../../../crypto/attribute';\nimport { GeneralNamePart } from '../extensions/general_name_part';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IActivityDescriptionAttributeProps {\n attribute: Attribute<ActivityDescription>;\n}\n\nexport const ActivityDescriptionAttribute:\nFunctionalComponent<IActivityDescriptionAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Code Authority\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.codeAuthority}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Code Id\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.codeId}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Short Name\"\n value={attribute.value.shortName}\n />\n <RowValue\n name=\"Short Description\"\n value={attribute.value.shortDescription}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { WebGDPR } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { GeneralNamePart } from '../extensions/general_name_part';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IWebGdprAttributeProps {\n attribute: Attribute<WebGDPR>;\n}\n\nexport const WebGdprAttribute:\nFunctionalComponent<IWebGdprAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Assessment Authority\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentAuthority}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Assessment Location\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentLocation}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Assessment Ref\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentRef}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Data Storage Territory\"\n value={attribute.value.dataStorageTerritory}\n />\n <RowValue\n name=\"Description\"\n value={attribute.value.description}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { InsuranceValue } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IInsuranceValueAttributeProps {\n attribute: Attribute<InsuranceValue>;\n}\n\nexport const InsuranceValueAttribute:\nFunctionalComponent<IInsuranceValueAttributeProps> = (props) => {\n const { attribute } = props;\n const value = `${attribute.value.base} * 10^${attribute.value.degree} ${attribute.value.location}`;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={value}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { TypeRelationship } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { l10n } from '../../../utils';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface ITypeRelationshipAttributeProps {\n attribute: Attribute<TypeRelationship>;\n}\n\nexport const TypeRelationshipAttribute:\nFunctionalComponent<ITypeRelationshipAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n {Object.keys(attribute.value).map((keyName) => (\n <RowValue\n name={keyName}\n value={attribute.value[keyName].toNumber() ? l10n.getString('yes') : l10n.getString('no')}\n />\n ))}\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ValuationRanking } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IValuationRankingAttributeProps {\n attribute: Attribute<ValuationRanking>;\n}\n\nconst getValueRank = (value: number): string => {\n let ratio = 1;\n\n if (value / 100 > 1) {\n ratio = 100;\n } else if (value / 10 > 1) {\n ratio = 10;\n }\n\n return `${value}/${5 * ratio}`;\n};\n\nexport const ValuationRankingAttribute:\nFunctionalComponent<IValuationRankingAttributeProps> = (props) => {\n const { attribute } = props;\n const values = Object.keys(attribute.value).map((keyName) => ([\n getValueRank(attribute.value[keyName]),\n <br />,\n ]));\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={values as any}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IAsStringAttributeProps {\n attribute: Attribute<string>;\n}\n\nexport const AsStringAttribute:\nFunctionalComponent<IAsStringAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value}\n monospace\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { UnstructuredName } from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IUnstructuredNameAttributeProps {\n attribute: Attribute<UnstructuredName>;\n}\n\nexport const UnstructuredNameAttribute:\nFunctionalComponent<IUnstructuredNameAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value.utf8String}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ChallengePassword } from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IChallengePasswordAttributeProps {\n attribute: Attribute<ChallengePassword>;\n}\n\nexport const ChallengePasswordAttribute:\nFunctionalComponent<IChallengePasswordAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value.toString()}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport { Name } from '@peculiar/asn1-x509';\nimport {\n TypeRelationship,\n ActivityDescription,\n WebGDPR,\n InsuranceValue,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n UnstructuredName,\n ChallengePassword,\n} from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute, TAttributeValue } from '../../../crypto/attribute';\nimport { RowTitle } from '../row';\nimport { NameAttribute } from './name_attribute';\nimport { ActivityDescriptionAttribute } from './activity_description_attribute';\nimport { WebGdprAttribute } from './web_gdpr_attribute';\nimport { InsuranceValueAttribute } from './insurance_value_attribute';\nimport { TypeRelationshipAttribute } from './type_relationship_attribute';\nimport { ValuationRankingAttribute } from './valuation_ranking_attribute';\nimport { BasicAttribute } from './basic_attribute';\nimport { AsStringAttribute } from './as_string_attribute';\nimport { UnstructuredNameAttribute } from './unstructured_name_attribute';\nimport { ChallengePasswordAttribute } from './challenge_password_attribute';\n\ninterface IAttributesPtops extends\n IGeneralNameOptions,\n ILeiOptions,\n IAuthorityKeyIdentifierOptions,\n ISubjectKeyIdentifierOptions {\n attributes: Attribute<TAttributeValue>[];\n}\n\nexport const Attributes: FunctionalComponent<IAttributesPtops> = (props) => {\n const { attributes } = props;\n\n if (!attributes || !attributes.length) {\n return null;\n }\n\n return ([\n <RowTitle\n value=\"Attributes\"\n />,\n attributes.map((attribute) => {\n try {\n if (attribute.value instanceof Name) {\n return (\n <NameAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ActivityDescription) {\n return (\n <ActivityDescriptionAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof WebGDPR) {\n return (\n <WebGdprAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof InsuranceValue) {\n return (\n <InsuranceValueAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof TypeRelationship) {\n return (\n <TypeRelationshipAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ValuationRanking) {\n return (\n <ValuationRankingAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof UnstructuredName) {\n return (\n <UnstructuredNameAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ChallengePassword) {\n return (\n <ChallengePasswordAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (typeof attribute.value === 'string') {\n return (\n <AsStringAttribute\n attribute={attribute as any}\n />\n );\n }\n\n return (\n <BasicAttribute\n attribute={attribute}\n />\n );\n } catch (error) {\n console.error('Error render attribute:', attribute.asn.type);\n\n return null;\n }\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 { h, FunctionalComponent } from '@stencil/core';\nimport { CRLReason, InvalidityDate, CertificateIssuer } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateShort, l10n, getStringByOID } from '../../utils';\nimport { IRevokedCertificate } from '../../crypto';\nimport { GeneralNamePart } from './extensions/general_name_part';\nimport { RowTitle, RowValue, TableRowTable } from './row';\n\ninterface IRevokedCertificatesProps extends IGeneralNameOptions {\n revokedCertificates: IRevokedCertificate[];\n}\n\nexport const RevokedCertificates: FunctionalComponent<IRevokedCertificatesProps> = (props) => {\n const {\n revokedCertificates,\n getDNSNameLink,\n getIPAddressLink,\n } = props;\n\n if (!revokedCertificates || !revokedCertificates.length) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('revokedCertificates')}\n />,\n revokedCertificates.map((certificate) => ([\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(certificate.userCertificate)}\n monospace\n />,\n <RowValue\n name={l10n.getString('revocationDate')}\n value={dateShort(certificate.revocationDate.getTime())}\n />,\n (certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([\n <RowValue\n name={`${l10n.getString('crlEntryExtensions')}:`}\n value=\"\"\n />,\n <TableRowTable>\n {\n certificate.crlEntryExtensions.map((extension) => {\n if (extension.value instanceof CRLReason) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.toJSON() || extension.value.reason}\n />\n );\n }\n\n if (extension.value instanceof InvalidityDate) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.value.getTime()}\n />\n );\n }\n\n if (extension.value instanceof CertificateIssuer && extension.value.length) {\n return ([\n <RowValue\n name={`${getStringByOID(extension.asn.extnID)}:`}\n value=\"\"\n />,\n extension.value.map((gn) => (\n <TableRowTable>\n <GeneralNamePart\n generalName={gn}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n </TableRowTable>\n )),\n ]);\n }\n\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={Convert.ToHex(extension.asn.extnValue)}\n monospace\n />\n );\n })\n }\n </TableRowTable>,\n ])),\n <tr>\n <td colSpan={2} class=\"divider\">\n <span />\n </td>\n </tr>,\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 { h, FunctionalComponent } from '@stencil/core';\nimport { Convert } from 'pvtsutils';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n, getStringByOID } from '../../utils';\nimport { RowTitle, RowValue } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IHolderProps {\n holder: X509AttributeCertificate['holder'];\n}\n\nexport const Holder: FunctionalComponent<IHolderProps> = (props) => {\n const { holder } = props;\n\n if (!holder) {\n return null;\n }\n\n const { baseCertificateID, objectDigestInfo } = holder;\n\n return [\n <RowTitle\n value={l10n.getString('holder')}\n />,\n baseCertificateID && ([\n baseCertificateID.issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n <tr>\n <td />\n <td />\n </tr>,\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(baseCertificateID.serial)}\n monospace\n />,\n <tr>\n <td />\n <td />\n </tr>,\n ]),\n objectDigestInfo && ([\n <RowValue\n name={l10n.getString('digestInfo')}\n value=\"\"\n />,\n <RowValue\n name={l10n.getString('algorithm')}\n value={getStringByOID(objectDigestInfo.digestAlgorithm.algorithm)}\n />,\n <RowValue\n name={l10n.getString('value')}\n value={Convert.ToHex(objectDigestInfo.objectDigest)}\n monospace\n />,\n <RowValue\n name={l10n.getString('type')}\n value={objectDigestInfo.digestedObjectType}\n />,\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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n } from '../../utils';\nimport { RowTitle } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IIssuerProps {\n issuer: X509AttributeCertificate['issuer'];\n}\n\nexport const Issuer: FunctionalComponent<IIssuerProps> = (props) => {\n const { issuer } = props;\n\n if (!issuer) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('issuer')}\n />,\n issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n ];\n};\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n word-wrap: break-word;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { X509AttributeCertificate } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n Attributes,\n Holder,\n Issuer,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type AttributeCertificateProp = string | X509AttributeCertificate;\n\n@Component({\n tag: 'peculiar-attribute-certificate-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class AttributeCertificateViewer {\n private certificateDecoded: X509AttributeCertificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificate: AttributeCertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: AttributeCertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509AttributeCertificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509AttributeCertificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n this.certificateDecoded.parseAttributes();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: AttributeCertificateProp,\n oldValue: AttributeCertificateProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof X509AttributeCertificate\n && oldValue instanceof X509AttributeCertificate\n ) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this attribute certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no attribute certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <Issuer\n issuer={this.certificateDecoded.issuer}\n />\n\n <Holder\n holder={this.certificateDecoded.holder}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Attributes\n attributes={this.certificateDecoded.attributes}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n word-wrap: break-word;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { CRL } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n IssuerName,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n RevokedCertificates,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CrlProp = string | CRL;\n\n@Component({\n tag: 'peculiar-crl-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class CrlViewer {\n private certificateDecoded: CRL;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CrlProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CrlProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof CRL) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new CRL(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: CrlProp,\n oldValue: CrlProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof CRL\n && oldValue instanceof CRL\n ) {\n if (newValue.commonName !== oldValue.commonName) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate revocation list.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate revocation list available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n />\n\n <RevokedCertificates\n revokedCertificates={this.certificateDecoded.revokedCertificates}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n word-wrap: break-word;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { CSR } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n PublicKey,\n Attributes,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CsrProp = string | CSR;\n\n@Component({\n tag: 'peculiar-csr-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class CsrViewer {\n private certificateDecoded: CSR;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CsrProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CsrProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof CSR) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new CSR(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseAttributes();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: CsrProp,\n oldValue: CsrProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof CSR\n && oldValue instanceof CSR\n ) {\n if (newValue.commonName !== oldValue.commonName) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private getAuthKeyIdParentLink = (value: string) => value;\n\n // eslint-disable-next-line class-methods-use-this\n private getAuthKeyIdSiblingsLink = (value: string) => value;\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate request.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate request available.\n </Typography>\n </div>\n );\n }\n\n private getExtensionRequestAttribute() {\n if (!this.certificateDecoded) {\n return undefined;\n }\n\n return this.certificateDecoded.attributes\n .find((attribute) => attribute.asn.type === '1.2.840.113549.1.9.14');\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n const extensionRequestAttribute = this.getExtensionRequestAttribute();\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Attributes\n attributes={this.certificateDecoded.attributes}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n <Extensions\n extensions={extensionRequestAttribute?.value as any}\n title=\"Extension Request\"\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;;;;;GAkBO,IAAMA,eAA4D,SAACC,EAAOC,GACvE,IAAAC,EAAcF,EAAKE,UAE3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/C,KAAKgB,mBAErCpH,EAAA,aACEA,EAACoJ,iBAAgB/G,OAAAgH,OAAA,GACXjD,KAAK8B,qBAGXlI,EAAC+K,YAAW,CACV7K,KAAMkG,KAAK8B,mBAAmB8C,UAGhChL,EAACiL,UAAS,CACRC,UAAW9E,KAAK8B,mBAAmBgD,YAGrClL,EAACsJ,UAAS,CACRC,UAAWnD,KAAK8B,mBAAmBqB,YAGrCvJ,EAACwJ,YAAW,CACVC,YAAarD,KAAK8B,mBAAmBuB,cAGvCzJ,EAACoD,WAAU,CACTC,WAAY+C,KAAK8B,mBAAmB7E,WACpCqG,WAAYA,WACZtI,eAAgBA,eAChBC,iBAAkBA,iBAClBgF,uBAAwBD,KAAKC,uBAC7BK,yBAA0BN,KAAKM,yBAC/BE,4BAA6BR,KAAKQ,4BAClCE,4BAA6BV,KAAKU,8BAGpC9G,EAAC2J,WAAU,CACTC,WAAYkB,IAAyB,MAAzBA,SAAyB,SAAzBA,EAA2B3K,MACvCgL,MAAM,oBACNzB,WAAYA,WACZtI,eAAgBA,eAChBC,iBAAkBA,iBAClBgF,uBAAwBD,KAAKC,uBAC7BK,yBAA0BN,KAAKM,yBAC/BE,4BAA6BR,KAAKQ,4BAClCE,4BAA6BV,KAAKU,8BAGnCV,KAAKyD,UACJ7J,EAAC8J,cAAa,CACZ1F,YAAagC,KAAK8B,sB,sJA5NV,G"}
|
|
1
|
+
{"version":3,"names":["BasicAttribute","props","children","attribute","h","RowValue","name","value","getStringByOID","asn","type","colSpan","class","NamePart","map","relativeDistinguishedName","attributeTypeAndValue","OIDs","toString","NameAttribute","ActivityDescriptionAttribute","GeneralNamePart","generalName","codeAuthority","getDNSNameLink","getIPAddressLink","codeId","shortName","shortDescription","WebGdprAttribute","assessmentAuthority","assessmentLocation","assessmentRef","dataStorageTerritory","description","InsuranceValueAttribute","concat","base","degree","location","TypeRelationshipAttribute","Object","keys","keyName","toNumber","l10n","getString","getValueRank","ratio","ValuationRankingAttribute","values","AsStringAttribute","monospace","UnstructuredNameAttribute","utf8String","ChallengePasswordAttribute","Attributes","attributes","length","RowTitle","Name","ActivityDescription","WebGDPR","InsuranceValue","TypeRelationship","ValuationRanking","UnstructuredName","ChallengePassword","error","console","RevokedCertificates","revokedCertificates","certificate","Convert","ToHex","userCertificate","dateShort","revocationDate","getTime","crlEntryExtensions","TableRowTable","extension","CRLReason","extnID","toJSON","reason","InvalidityDate","CertificateIssuer","gn","extnValue","Holder","holder","baseCertificateID","objectDigestInfo","issuer","item","serial","digestAlgorithm","algorithm","objectDigest","digestedObjectType","Issuer","certificateViewerCss","AttributeCertificateViewer","this","getAuthKeyIdParentLink","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509AttributeCertificate","certificateDecoded","parseExtensions","parseAttributes","getThumbprint","_b","sent","certificateDecodeError","error_1","watchCertificateAndDecode","newValue","oldValue","serialNumber","renderErrorState","Typography","renderEmptyState","render","Host","String","BasicInformation","assign","Signature","signature","Thumbprints","thumbprints","getLEILink","Extensions","extensions","download","Miscellaneous","CrlViewer","class_2","CRL","error_2","getIssuerDnLink","issuerDnLink","commonName","IssuerName","CsrViewer","class_3","CSR","error_3","getExtensionRequestAttribute","undefined","find","extensionRequestAttribute","SubjectName","subject","PublicKey","publicKey","title"],"sources":["src/components/certificate-details-parts/attributes/basic_attribute.tsx","src/components/certificate-details-parts/attributes/name_part.tsx","src/components/certificate-details-parts/attributes/name_attribute.tsx","src/components/certificate-details-parts/attributes/activity_description_attribute.tsx","src/components/certificate-details-parts/attributes/web_gdpr_attribute.tsx","src/components/certificate-details-parts/attributes/insurance_value_attribute.tsx","src/components/certificate-details-parts/attributes/type_relationship_attribute.tsx","src/components/certificate-details-parts/attributes/valuation_ranking_attribute.tsx","src/components/certificate-details-parts/attributes/as_string_attribute.tsx","src/components/certificate-details-parts/attributes/unstructured_name_attribute.tsx","src/components/certificate-details-parts/attributes/challenge_password_attribute.tsx","src/components/certificate-details-parts/attributes/index.tsx","src/components/certificate-details-parts/revoked_certificates.tsx","src/components/certificate-details-parts/holder.tsx","src/components/certificate-details-parts/issuer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-attribute-certificate-viewer&encapsulation=shadow","src/components/attribute-certificate-viewer/attribute-certificate-viewer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-crl-viewer&encapsulation=shadow","src/components/crl-viewer/crl-viewer.tsx","src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-csr-viewer&encapsulation=shadow","src/components/csr-viewer/csr-viewer.tsx"],"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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { Attribute, TAttributeValue } from '../../../crypto/attribute';\nimport { getStringByOID } from '../../../utils';\nimport { RowValue } from '../row';\n\ninterface IBasicAttributeProps {\n attribute: Attribute<TAttributeValue>;\n}\n\nexport const BasicAttribute: FunctionalComponent<IBasicAttributeProps> = (props, children) => {\n const { attribute } = props;\n\n return ([\n <RowValue\n name=\"Name\"\n value={getStringByOID(attribute.asn.type)}\n />,\n children,\n <tr>\n <td colSpan={2} class=\"divider\">\n <span />\n </td>\n </tr>,\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { Name } from '@peculiar/asn1-x509';\n\nimport { OIDs } from '../../../constants/oids';\nimport { RowValue } from '../row';\n\ninterface INamePartProps {\n name: Name;\n}\n\nexport const NamePart: FunctionalComponent<INamePartProps> = (props): any[] => {\n const { name } = props;\n\n if (!name) {\n return null;\n }\n\n return name.map((relativeDistinguishedName) => (\n relativeDistinguishedName.map((attributeTypeAndValue) => (\n <RowValue\n name={OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type}\n value={attributeTypeAndValue.value.toString()}\n />\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { Name } from '@peculiar/asn1-x509';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { BasicAttribute } from './basic_attribute';\nimport { NamePart } from './name_part';\n\ninterface INameAttributeProps {\n attribute: Attribute<Name>;\n}\n\nexport const NameAttribute:\nFunctionalComponent<INameAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <NamePart\n name={attribute.value}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ActivityDescription } from '@peculiar/asn1-ntqwac';\n\nimport { Attribute } from '../../../crypto/attribute';\nimport { GeneralNamePart } from '../extensions/general_name_part';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IActivityDescriptionAttributeProps {\n attribute: Attribute<ActivityDescription>;\n}\n\nexport const ActivityDescriptionAttribute:\nFunctionalComponent<IActivityDescriptionAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Code Authority\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.codeAuthority}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Code Id\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.codeId}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Short Name\"\n value={attribute.value.shortName}\n />\n <RowValue\n name=\"Short Description\"\n value={attribute.value.shortDescription}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { WebGDPR } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { GeneralNamePart } from '../extensions/general_name_part';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IWebGdprAttributeProps {\n attribute: Attribute<WebGDPR>;\n}\n\nexport const WebGdprAttribute:\nFunctionalComponent<IWebGdprAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Assessment Authority\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentAuthority}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Assessment Location\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentLocation}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Assessment Ref\"\n value=\"\"\n />\n <GeneralNamePart\n generalName={attribute.value.assessmentRef}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n\n <RowValue\n name=\"Data Storage Territory\"\n value={attribute.value.dataStorageTerritory}\n />\n <RowValue\n name=\"Description\"\n value={attribute.value.description}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { InsuranceValue } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IInsuranceValueAttributeProps {\n attribute: Attribute<InsuranceValue>;\n}\n\nexport const InsuranceValueAttribute:\nFunctionalComponent<IInsuranceValueAttributeProps> = (props) => {\n const { attribute } = props;\n const value = `${attribute.value.base} * 10^${attribute.value.degree} ${attribute.value.location}`;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={value}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { TypeRelationship } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { l10n } from '../../../utils';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface ITypeRelationshipAttributeProps {\n attribute: Attribute<TypeRelationship>;\n}\n\nexport const TypeRelationshipAttribute:\nFunctionalComponent<ITypeRelationshipAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n {Object.keys(attribute.value).map((keyName) => (\n <RowValue\n name={keyName}\n value={attribute.value[keyName].toNumber() ? l10n.getString('yes') : l10n.getString('no')}\n />\n ))}\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ValuationRanking } from '@peculiar/asn1-ntqwac';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IValuationRankingAttributeProps {\n attribute: Attribute<ValuationRanking>;\n}\n\nconst getValueRank = (value: number): string => {\n let ratio = 1;\n\n if (value / 100 > 1) {\n ratio = 100;\n } else if (value / 10 > 1) {\n ratio = 10;\n }\n\n return `${value}/${5 * ratio}`;\n};\n\nexport const ValuationRankingAttribute:\nFunctionalComponent<IValuationRankingAttributeProps> = (props) => {\n const { attribute } = props;\n const values = Object.keys(attribute.value).map((keyName) => ([\n getValueRank(attribute.value[keyName]),\n <br />,\n ]));\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={values as any}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IAsStringAttributeProps {\n attribute: Attribute<string>;\n}\n\nexport const AsStringAttribute:\nFunctionalComponent<IAsStringAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value}\n monospace\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { UnstructuredName } from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IUnstructuredNameAttributeProps {\n attribute: Attribute<UnstructuredName>;\n}\n\nexport const UnstructuredNameAttribute:\nFunctionalComponent<IUnstructuredNameAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value.utf8String}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport type { ChallengePassword } from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute } from '../../../crypto/attribute';\nimport { RowValue } from '../row';\nimport { BasicAttribute } from './basic_attribute';\n\ninterface IChallengePasswordAttributeProps {\n attribute: Attribute<ChallengePassword>;\n}\n\nexport const ChallengePasswordAttribute:\nFunctionalComponent<IChallengePasswordAttributeProps> = (props) => {\n const { attribute } = props;\n\n return (\n <BasicAttribute\n attribute={attribute}\n >\n <RowValue\n name=\"Value\"\n value={attribute.value.toString()}\n />\n </BasicAttribute>\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 { h, FunctionalComponent } from '@stencil/core';\nimport { Name } from '@peculiar/asn1-x509';\nimport {\n TypeRelationship,\n ActivityDescription,\n WebGDPR,\n InsuranceValue,\n ValuationRanking,\n} from '@peculiar/asn1-ntqwac';\nimport {\n UnstructuredName,\n ChallengePassword,\n} from '@peculiar/asn1-pkcs9';\n\nimport type { Attribute, TAttributeValue } from '../../../crypto/attribute';\nimport { RowTitle } from '../row';\nimport { NameAttribute } from './name_attribute';\nimport { ActivityDescriptionAttribute } from './activity_description_attribute';\nimport { WebGdprAttribute } from './web_gdpr_attribute';\nimport { InsuranceValueAttribute } from './insurance_value_attribute';\nimport { TypeRelationshipAttribute } from './type_relationship_attribute';\nimport { ValuationRankingAttribute } from './valuation_ranking_attribute';\nimport { BasicAttribute } from './basic_attribute';\nimport { AsStringAttribute } from './as_string_attribute';\nimport { UnstructuredNameAttribute } from './unstructured_name_attribute';\nimport { ChallengePasswordAttribute } from './challenge_password_attribute';\n\ninterface IAttributesPtops extends\n IGeneralNameOptions,\n ILeiOptions,\n IAuthorityKeyIdentifierOptions,\n ISubjectKeyIdentifierOptions {\n attributes: Attribute<TAttributeValue>[];\n}\n\nexport const Attributes: FunctionalComponent<IAttributesPtops> = (props) => {\n const { attributes } = props;\n\n if (!attributes || !attributes.length) {\n return null;\n }\n\n return ([\n <RowTitle\n value=\"Attributes\"\n />,\n attributes.map((attribute) => {\n try {\n if (attribute.value instanceof Name) {\n return (\n <NameAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ActivityDescription) {\n return (\n <ActivityDescriptionAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof WebGDPR) {\n return (\n <WebGdprAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof InsuranceValue) {\n return (\n <InsuranceValueAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof TypeRelationship) {\n return (\n <TypeRelationshipAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ValuationRanking) {\n return (\n <ValuationRankingAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof UnstructuredName) {\n return (\n <UnstructuredNameAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (attribute.value instanceof ChallengePassword) {\n return (\n <ChallengePasswordAttribute\n attribute={attribute as any}\n />\n );\n }\n\n if (typeof attribute.value === 'string') {\n return (\n <AsStringAttribute\n attribute={attribute as any}\n />\n );\n }\n\n return (\n <BasicAttribute\n attribute={attribute}\n />\n );\n } catch (error) {\n console.error('Error render attribute:', attribute.asn.type);\n\n return null;\n }\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 { h, FunctionalComponent } from '@stencil/core';\nimport { CRLReason, InvalidityDate, CertificateIssuer } from '@peculiar/asn1-x509';\nimport { Convert } from 'pvtsutils';\n\nimport { dateShort, l10n, getStringByOID } from '../../utils';\nimport { IRevokedCertificate } from '../../crypto';\nimport { GeneralNamePart } from './extensions/general_name_part';\nimport { RowTitle, RowValue, TableRowTable } from './row';\n\ninterface IRevokedCertificatesProps extends IGeneralNameOptions {\n revokedCertificates: IRevokedCertificate[];\n}\n\nexport const RevokedCertificates: FunctionalComponent<IRevokedCertificatesProps> = (props) => {\n const {\n revokedCertificates,\n getDNSNameLink,\n getIPAddressLink,\n } = props;\n\n if (!revokedCertificates || !revokedCertificates.length) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('revokedCertificates')}\n />,\n revokedCertificates.map((certificate) => ([\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(certificate.userCertificate)}\n monospace\n />,\n <RowValue\n name={l10n.getString('revocationDate')}\n value={dateShort(certificate.revocationDate.getTime())}\n />,\n (certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([\n <RowValue\n name={`${l10n.getString('crlEntryExtensions')}:`}\n value=\"\"\n />,\n <TableRowTable>\n {\n certificate.crlEntryExtensions.map((extension) => {\n if (extension.value instanceof CRLReason) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.toJSON() || extension.value.reason}\n />\n );\n }\n\n if (extension.value instanceof InvalidityDate) {\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={extension.value.value.getTime()}\n />\n );\n }\n\n if (extension.value instanceof CertificateIssuer && extension.value.length) {\n return ([\n <RowValue\n name={`${getStringByOID(extension.asn.extnID)}:`}\n value=\"\"\n />,\n extension.value.map((gn) => (\n <TableRowTable>\n <GeneralNamePart\n generalName={gn}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n </TableRowTable>\n )),\n ]);\n }\n\n return (\n <RowValue\n name={getStringByOID(extension.asn.extnID)}\n value={Convert.ToHex(extension.asn.extnValue)}\n monospace\n />\n );\n })\n }\n </TableRowTable>,\n ])),\n <tr>\n <td colSpan={2} class=\"divider\">\n <span />\n </td>\n </tr>,\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 { h, FunctionalComponent } from '@stencil/core';\nimport { Convert } from 'pvtsutils';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n, getStringByOID } from '../../utils';\nimport { RowTitle, RowValue } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IHolderProps {\n holder: X509AttributeCertificate['holder'];\n}\n\nexport const Holder: FunctionalComponent<IHolderProps> = (props) => {\n const { holder } = props;\n\n if (!holder) {\n return null;\n }\n\n const { baseCertificateID, objectDigestInfo } = holder;\n\n return [\n <RowTitle\n value={l10n.getString('holder')}\n />,\n baseCertificateID && ([\n baseCertificateID.issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n <tr>\n <td />\n <td />\n </tr>,\n <RowValue\n name={l10n.getString('serialNumber')}\n value={Convert.ToHex(baseCertificateID.serial)}\n monospace\n />,\n <tr>\n <td />\n <td />\n </tr>,\n ]),\n objectDigestInfo && ([\n <RowValue\n name={l10n.getString('digestInfo')}\n value=\"\"\n />,\n <RowValue\n name={l10n.getString('algorithm')}\n value={getStringByOID(objectDigestInfo.digestAlgorithm.algorithm)}\n />,\n <RowValue\n name={l10n.getString('value')}\n value={Convert.ToHex(objectDigestInfo.objectDigest)}\n monospace\n />,\n <RowValue\n name={l10n.getString('type')}\n value={objectDigestInfo.digestedObjectType}\n />,\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 { h, FunctionalComponent } from '@stencil/core';\n\nimport type { X509AttributeCertificate } from '../../crypto';\nimport { l10n } from '../../utils';\nimport { RowTitle } from './row';\nimport { GeneralNamePart } from './extensions/general_name_part';\n\ninterface IIssuerProps {\n issuer: X509AttributeCertificate['issuer'];\n}\n\nexport const Issuer: FunctionalComponent<IIssuerProps> = (props) => {\n const { issuer } = props;\n\n if (!issuer) {\n return null;\n }\n\n return [\n <RowTitle\n value={l10n.getString('issuer')}\n />,\n issuer.map((item) => (\n <GeneralNamePart\n generalName={item}\n getDNSNameLink={() => ''}\n getIPAddressLink={() => ''}\n />\n )),\n ];\n};\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-all;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { X509AttributeCertificate } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n Attributes,\n Holder,\n Issuer,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type AttributeCertificateProp = string | X509AttributeCertificate;\n\n@Component({\n tag: 'peculiar-attribute-certificate-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class AttributeCertificateViewer {\n private certificateDecoded: X509AttributeCertificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop() certificate: AttributeCertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: AttributeCertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509AttributeCertificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509AttributeCertificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n this.certificateDecoded.parseAttributes();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: AttributeCertificateProp,\n oldValue: AttributeCertificateProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof X509AttributeCertificate\n && oldValue instanceof X509AttributeCertificate\n ) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this attribute certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no attribute certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <Issuer\n issuer={this.certificateDecoded.issuer}\n />\n\n <Holder\n holder={this.certificateDecoded.holder}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Attributes\n attributes={this.certificateDecoded.attributes}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-all;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { CRL } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n IssuerName,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n RevokedCertificates,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CrlProp = string | CRL;\n\n@Component({\n tag: 'peculiar-crl-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class CrlViewer {\n private certificateDecoded: CRL;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CrlProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CrlProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof CRL) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new CRL(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: CrlProp,\n oldValue: CrlProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof CRL\n && oldValue instanceof CRL\n ) {\n if (newValue.commonName !== oldValue.commonName) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate revocation list.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate revocation list available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n />\n\n <RevokedCertificates\n revokedCertificates={this.certificateDecoded.revokedCertificates}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n","@import 'base';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-all;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n Host,\n h,\n Prop,\n State,\n Watch,\n Build,\n} from '@stencil/core';\n\nimport { CSR } from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n PublicKey,\n Attributes,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CsrProp = string | CSR;\n\n@Component({\n tag: 'peculiar-csr-viewer',\n styleUrl: '../certificate-viewer/certificate-viewer.scss',\n shadow: true,\n})\nexport class CsrViewer {\n private certificateDecoded: CSR;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CsrProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop() download?: boolean;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CsrProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof CSR) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new CSR(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseAttributes();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(\n newValue: CsrProp,\n oldValue: CsrProp,\n ) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (\n newValue instanceof CSR\n && oldValue instanceof CSR\n ) {\n if (newValue.commonName !== oldValue.commonName) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n // eslint-disable-next-line class-methods-use-this\n private getAuthKeyIdParentLink = (value: string) => value;\n\n // eslint-disable-next-line class-methods-use-this\n private getAuthKeyIdSiblingsLink = (value: string) => value;\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate request.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate request available.\n </Typography>\n </div>\n );\n }\n\n private getExtensionRequestAttribute() {\n if (!this.certificateDecoded) {\n return undefined;\n }\n\n return this.certificateDecoded.attributes\n .find((attribute) => attribute.asn.type === '1.2.840.113549.1.9.14');\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n const extensionRequestAttribute = this.getExtensionRequestAttribute();\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Attributes\n attributes={this.certificateDecoded.attributes}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n <Extensions\n extensions={extensionRequestAttribute?.value as any}\n title=\"Extension Request\"\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":";;;;;;;;;;GAkBO,IAAMA,eAA4D,SAACC,EAAOC,GACvE,IAAAC,EAAcF,EAAKE,UAE3B,OACEC,EAACC,SAAQ,CACPC,KAAK,OACLC,MAAOC,eAAeL,EAAUM,IAAIC,QAEtCR,EACAE,EAAA,UACEA,EAAA,MAAIO,QAAS,EAAGC,MAAM,WACpBR,EAAA,eAIR;;;;;;;GCfO,IAAMS,SAAgD,SAACZ,GACpD,IAAAK,EAASL,EAAKK,KAEtB,IAAKA,EAAM,CACT,OAAO,I,CAGT,OAAOA,EAAKQ,KAAI,SAACC,GAAyB,OACxCA,EAA0BD,KAAI,SAACE,GAAqB,OAClDZ,EAACC,SAAQ,CACPC,KAAMW,KAAKD,EAAsBN,OAASM,EAAsBN,KAChEH,MAAOS,EAAsBT,MAAMW,YAHa,GADZ,GAQ5C;;;;;;;GCdO,IAAMC,cAC8B,SAAClB,GAClC,IAAAE,EAAcF,EAAKE,UAE3B,OACEC,EAACJ,eAAc,CACbG,UAAWA,GAEXC,EAACS,SAAQ,CACPP,KAAMH,EAAUI,QAIxB;;;;;;;GCZO,IAAMa,6BAC6C,SAACnB,GACjD,IAAAE,EAAcF,EAAKE,UAE3B,OACEC,EAACJ,eAAc,CACbG,UAAWA,GAEXC,EAACC,SAAQ,CACPC,KAAK,iBACLC,MAAM,KAERH,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KQ,4BAClCE,4BAA6BV,KAAKU,8BAGnCV,KAAKyD,UACJ7J,EAAC8J,cAAa,CACZ1F,YAAagC,KAAK8B,sB,sJA5NV,G"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var __awaiter=this&&this.__awaiter||function(e,t,r,a){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{c(a.next(e))}catch(e){o(e)}}function s(e){try{c(a["throw"](e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(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(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a,i,o,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,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{a=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};
|
|
2
2
|
/*!
|
|
3
3
|
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
4
|
-
*/import{r as registerInstance,h,H as Host}from"./index-4079bbb5.js";import{X as X509Certificate}from"./x509_certificate-dfae6999.js";import"./certification_request-5cadde9f.js";import"./download-57c5bf8f.js";import{B as BasicInformation,f as SubjectName,I as IssuerName,P as PublicKey,S as Signature,b as Thumbprints,E as Extensions,c as getLEILink,d as getDNSNameLink,e as getIPAddressLink,M as Miscellaneous}from"./miscellaneous-1d4e8b41.js";import{T as Typography}from"./button-35146bdd.js";import"./download-0cc3077a.js";var certificateViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var CertificateViewer=function(){function e(e){var t=this;registerInstance(this,e);this.getAuthKeyIdParentLink=function(e){var r;return(r=t.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",e)};this.getAuthKeyIdSiblingsLink=function(e){var r;return(r=t.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",e)};this.getSubjectKeyIdChildrenLink=function(e){var r;return(r=t.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",e)};this.getSubjectKeyIdSiblingsLink=function(e){var r;return(r=t.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",e)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.issuerDnLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}e.prototype.handleMediaQueryChange=function(e){this.mobileScreenView=e.matches};e.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};e.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};e.prototype.decodeCertificate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(e instanceof X509Certificate){this.certificateDecoded=e}else if(typeof e==="string"){this.certificateDecoded=new X509Certificate(e)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:t=r.sent();this.certificateDecodeError=t;console.error("Error certificate parse:",t);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};e.prototype.watchCertificateAndDecode=function(e,t){if(typeof e==="string"&&typeof t==="string"){if(e!==t){this.decodeCertificate(e)}return}if(e instanceof X509Certificate&&t instanceof X509Certificate){if(e.serialNumber!==t.serialNumber){this.decodeCertificate(e)}}};e.prototype.getIssuerDnLink=function(){return this.issuerDnLink};e.prototype.renderErrorState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There was an error decoding this certificate."))};e.prototype.renderEmptyState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There is no certificate available."))};e.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return h(Host,{"data-mobile-screen-view":String(this.mobileScreenView)},h("table",null,h(BasicInformation,Object.assign({},this.certificateDecoded)),h(SubjectName,{name:this.certificateDecoded.subject}),h(IssuerName,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),h(PublicKey,{publicKey:this.certificateDecoded.publicKey}),h(Signature,{signature:this.certificateDecoded.signature}),h(Thumbprints,{thumbprints:this.certificateDecoded.thumbprints}),h(Extensions,{extensions:this.certificateDecoded.extensions,getLEILink:getLEILink,getDNSNameLink:getDNSNameLink,getIPAddressLink:getIPAddressLink,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&h(Miscellaneous,{certificate:this.certificateDecoded})))};Object.defineProperty(e,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return e}();CertificateViewer.style=certificateViewerCss;export{CertificateViewer as peculiar_certificate_viewer};
|
|
4
|
+
*/import{r as registerInstance,h,H as Host}from"./index-4079bbb5.js";import{X as X509Certificate}from"./x509_certificate-dfae6999.js";import"./certification_request-5cadde9f.js";import"./download-57c5bf8f.js";import{B as BasicInformation,f as SubjectName,I as IssuerName,P as PublicKey,S as Signature,b as Thumbprints,E as Extensions,c as getLEILink,d as getDNSNameLink,e as getIPAddressLink,M as Miscellaneous}from"./miscellaneous-1d4e8b41.js";import{T as Typography}from"./button-35146bdd.js";import"./download-0cc3077a.js";var certificateViewerCss="*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-all}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";var CertificateViewer=function(){function e(e){var t=this;registerInstance(this,e);this.getAuthKeyIdParentLink=function(e){var r;return(r=t.authKeyIdParentLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",e)};this.getAuthKeyIdSiblingsLink=function(e){var r;return(r=t.authKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{authKeyId}}",e)};this.getSubjectKeyIdChildrenLink=function(e){var r;return(r=t.subjectKeyIdChildrenLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",e)};this.getSubjectKeyIdSiblingsLink=function(e){var r;return(r=t.subjectKeyIdSiblingsLink)===null||r===void 0?void 0:r.replace("{{subjectKeyId}}",e)};this.certificate=undefined;this.download=undefined;this.authKeyIdParentLink=undefined;this.authKeyIdSiblingsLink=undefined;this.subjectKeyIdChildrenLink=undefined;this.subjectKeyIdSiblingsLink=undefined;this.issuerDnLink=undefined;this.mobileMediaQueryString="(max-width: 900px)";this.mobileScreenView=false;this.isDecodeInProcess=true}e.prototype.handleMediaQueryChange=function(e){this.mobileScreenView=e.matches};e.prototype.componentWillLoad=function(){this.decodeCertificate(this.certificate);{this.mobileMediaQuery=window.matchMedia(this.mobileMediaQueryString);this.mobileMediaQuery.addEventListener("change",this.handleMediaQueryChange.bind(this));this.mobileScreenView=this.mobileMediaQuery.matches}};e.prototype.disconnectedCallback=function(){this.mobileMediaQuery.removeEventListener("change",this.handleMediaQueryChange.bind(this))};e.prototype.decodeCertificate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:this.isDecodeInProcess=true;r.label=1;case 1:r.trys.push([1,4,,5]);if(e instanceof X509Certificate){this.certificateDecoded=e}else if(typeof e==="string"){this.certificateDecoded=new X509Certificate(e)}else{return[2]}this.certificateDecoded.parseExtensions();return[4,this.certificateDecoded.getThumbprint("SHA-1")];case 2:r.sent();return[4,this.certificateDecoded.getThumbprint("SHA-256")];case 3:r.sent();return[3,5];case 4:t=r.sent();this.certificateDecodeError=t;console.error("Error certificate parse:",t);return[3,5];case 5:this.isDecodeInProcess=false;return[2]}}))}))};e.prototype.watchCertificateAndDecode=function(e,t){if(typeof e==="string"&&typeof t==="string"){if(e!==t){this.decodeCertificate(e)}return}if(e instanceof X509Certificate&&t instanceof X509Certificate){if(e.serialNumber!==t.serialNumber){this.decodeCertificate(e)}}};e.prototype.getIssuerDnLink=function(){return this.issuerDnLink};e.prototype.renderErrorState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There was an error decoding this certificate."))};e.prototype.renderEmptyState=function(){return h("div",{class:"status_wrapper"},h(Typography,null,"There is no certificate available."))};e.prototype.render=function(){if(this.certificateDecodeError){return this.renderErrorState()}if(!this.certificateDecoded){return this.renderEmptyState()}return h(Host,{"data-mobile-screen-view":String(this.mobileScreenView)},h("table",null,h(BasicInformation,Object.assign({},this.certificateDecoded)),h(SubjectName,{name:this.certificateDecoded.subject}),h(IssuerName,{name:this.certificateDecoded.issuer,issuerDnLink:this.getIssuerDnLink()}),h(PublicKey,{publicKey:this.certificateDecoded.publicKey}),h(Signature,{signature:this.certificateDecoded.signature}),h(Thumbprints,{thumbprints:this.certificateDecoded.thumbprints}),h(Extensions,{extensions:this.certificateDecoded.extensions,getLEILink:getLEILink,getDNSNameLink:getDNSNameLink,getIPAddressLink:getIPAddressLink,getAuthKeyIdParentLink:this.getAuthKeyIdParentLink,getAuthKeyIdSiblingsLink:this.getAuthKeyIdSiblingsLink,getSubjectKeyIdChildrenLink:this.getSubjectKeyIdChildrenLink,getSubjectKeyIdSiblingsLink:this.getSubjectKeyIdSiblingsLink}),this.download&&h(Miscellaneous,{certificate:this.certificateDecoded})))};Object.defineProperty(e,"watchers",{get:function(){return{certificate:["watchCertificateAndDecode"]}},enumerable:false,configurable:true});return e}();CertificateViewer.style=certificateViewerCss;export{CertificateViewer as peculiar_certificate_viewer};
|
|
5
5
|
//# sourceMappingURL=peculiar-certificate-viewer.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["certificateViewerCss","CertificateViewer","this","getAuthKeyIdParentLink","value","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","certificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509Certificate","certificateDecoded","parseExtensions","getThumbprint","_b","sent","certificateDecodeError","error_1","console","error","watchCertificateAndDecode","newValue","oldValue","serialNumber","getIssuerDnLink","issuerDnLink","renderErrorState","h","class","Typography","renderEmptyState","render","Host","String","BasicInformation","Object","assign","SubjectName","name","subject","IssuerName","issuer","PublicKey","publicKey","Signature","signature","Thumbprints","thumbprints","Extensions","extensions","getLEILink","getDNSNameLink","getIPAddressLink","download","Miscellaneous"],"sources":["src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-certificate-viewer&encapsulation=shadow","src/components/certificate-viewer/certificate-viewer.tsx"],"sourcesContent":["@import 'base';\n\n:host {\n display: block;\n width: 100%;\n word-wrap: break-word;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n h,\n Prop,\n State,\n Watch,\n Host,\n Build,\n} from '@stencil/core';\n\nimport {\n X509Certificate,\n} from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n IssuerName,\n PublicKey,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CertificateProp = string | X509Certificate;\n\n@Component({\n tag: 'peculiar-certificate-viewer',\n styleUrl: 'certificate-viewer.scss',\n shadow: true,\n})\nexport class CertificateViewer {\n private certificateDecoded: X509Certificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop({ reflect: true }) download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509Certificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509Certificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(newValue: CertificateProp, oldValue: CertificateProp) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":";;;+gBAAA,IAAMA,qBAAuB,6/R,ICyChBC,kBAAiB,W,kDAsIpBC,KAAAC,uBAAyB,SAACC,G,MAAkB,OAAAC,EAAAC,EAAKC,uBAAmB,MAAAF,SAAA,SAAAA,EACxEG,QAAQ,gBAAiBJ,E,EAErBF,KAAAO,yBAA2B,SAACL,G,MAAkB,OAAAC,EAAAC,EAAKI,yBAAqB,MAAAL,SAAA,SAAAA,EAC5EG,QAAQ,gBAAiBJ,E,EAErBF,KAAAS,4BAA8B,SAACP,G,MAAkB,OAAAC,EAAAC,EAAKM,4BAAwB,MAAAP,SAAA,SAAAA,EAClFG,QAAQ,mBAAoBJ,E,EAExBF,KAAAW,4BAA8B,SAACT,G,MAAkB,OAAAC,EAAAC,EAAKQ,4BAAwB,MAAAT,SAAA,SAAAA,EAClFG,QAAQ,mBAAoBJ,E,qQA9E4B,qB,sBAEvB,M,uBAEC,I,CAE9BW,EAAAC,UAAAC,uBAAA,SAAuBC,GAC7BhB,KAAKiB,iBAAmBD,EAAME,O,EAGhCL,EAAAC,UAAAK,kBAAA,WACEnB,KAAKoB,kBAAkBpB,KAAKqB,aAEP,CACnBrB,KAAKsB,iBAAmBC,OAAOC,WAAWxB,KAAKyB,wBAC/CzB,KAAKsB,iBAAiBI,iBAAiB,SAAU1B,KAAKe,uBAAuBY,KAAK3B,OAClFA,KAAKiB,iBAAmBjB,KAAKsB,iBAAiBJ,O,GAIlDL,EAAAC,UAAAc,qBAAA,WACE5B,KAAKsB,iBAAiBO,oBAAoB,SAAU7B,KAAKe,uBAAuBY,KAAK3B,M,EAGzEa,EAAAC,UAAAM,kBAA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C,mBAAmB4B,UAGhCZ,EAACa,WAAU,CACTF,KAAM3D,KAAKgC,mBAAmB8B,OAC9BhB,aAAc9C,KAAK6C,oBAGrBG,EAACe,UAAS,CACRC,UAAWhE,KAAKgC,mBAAmBgC,YAGrChB,EAACiB,UAAS,CACRC,UAAWlE,KAAKgC,mBAAmBkC,YAGrClB,EAACmB,YAAW,CACVC,YAAapE,KAAKgC,mBAAmBoC,cAGvCpB,EAACqB,WAAU,CACTC,WAAYtE,KAAKgC,mBAAmBsC,WACpCC,WAAYA,WACZC,eAAgBA,eAChBC,iBAAkBA,iBAClBxE,uBAAwBD,KAAKC,uBAC7BM,yBAA0BP,KAAKO,yBAC/BE,4BAA6BT,KAAKS,4BAClCE,4BAA6BX,KAAKW,8BAGnCX,KAAK0E,UACJ1B,EAAC2B,cAAa,CACZtD,YAAarB,KAAKgC,sB,sJAhOF,G"}
|
|
1
|
+
{"version":3,"names":["certificateViewerCss","CertificateViewer","this","getAuthKeyIdParentLink","value","_a","_this","authKeyIdParentLink","replace","getAuthKeyIdSiblingsLink","authKeyIdSiblingsLink","getSubjectKeyIdChildrenLink","subjectKeyIdChildrenLink","getSubjectKeyIdSiblingsLink","subjectKeyIdSiblingsLink","class_1","prototype","handleMediaQueryChange","event","mobileScreenView","matches","componentWillLoad","decodeCertificate","certificate","mobileMediaQuery","window","matchMedia","mobileMediaQueryString","addEventListener","bind","disconnectedCallback","removeEventListener","isDecodeInProcess","X509Certificate","certificateDecoded","parseExtensions","getThumbprint","_b","sent","certificateDecodeError","error_1","console","error","watchCertificateAndDecode","newValue","oldValue","serialNumber","getIssuerDnLink","issuerDnLink","renderErrorState","h","class","Typography","renderEmptyState","render","Host","String","BasicInformation","Object","assign","SubjectName","name","subject","IssuerName","issuer","PublicKey","publicKey","Signature","signature","Thumbprints","thumbprints","Extensions","extensions","getLEILink","getDNSNameLink","getIPAddressLink","download","Miscellaneous"],"sources":["src/components/certificate-viewer/certificate-viewer.scss?tag=peculiar-certificate-viewer&encapsulation=shadow","src/components/certificate-viewer/certificate-viewer.tsx"],"sourcesContent":["@import 'base';\n\n:host {\n display: block;\n width: 100%;\n position: relative;\n min-width: 280px;\n min-height: 300px;\n word-wrap: break-word;\n word-break: break-all;\n}\n\nth, td {\n border: none;\n}\n\ntable {\n width: 100%;\n border-spacing: 0;\n border-collapse: collapse;\n\n td {\n padding: var(--pv-size-base-2) var(--pv-size-base-4);\n vertical-align: top;\n\n &:first-child {\n width: 220px;\n }\n\n &:last-child {\n width: calc(100% - 220px)\n }\n\n &.monospace {\n max-width: 0;\n }\n\n &.divider {\n padding: var(--pv-size-base-2) 0;\n\n span {\n height: 1px;\n display: block;\n background-color: var(--pv-color-gray-4);\n }\n }\n }\n\n .title td {\n padding-top: var(--pv-size-base-6);\n padding-bottom: var(--pv-size-base-2);\n }\n\n table {\n border-left: 1px solid var(--pv-color-gray-5);\n }\n}\n\n.status_wrapper {\n min-height: inherit;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n:host([data-mobile-screen-view=\"true\"]) {\n table, tr, td {\n display: block;\n }\n\n table {\n tr {\n padding: var(--pv-size-base-2) 0;\n\n &.title {\n padding-top: var(--pv-size-base-6);\n\n td {\n padding: 0 var(--pv-size-base-4);\n }\n }\n }\n\n td {\n padding: 0 var(--pv-size-base-4);\n width: 100% !important;\n max-width: 100% !important;\n\n &.divider {\n padding: 0;\n }\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 {\n Component,\n h,\n Prop,\n State,\n Watch,\n Host,\n Build,\n} from '@stencil/core';\n\nimport {\n X509Certificate,\n} from '../../crypto';\nimport { getDNSNameLink, getIPAddressLink, getLEILink } from '../../utils/third_party_links';\nimport {\n BasicInformation,\n SubjectName,\n IssuerName,\n PublicKey,\n Signature,\n Thumbprints,\n Extensions,\n Miscellaneous,\n} from '../certificate-details-parts';\nimport { Typography } from '../typography';\n\nexport type CertificateProp = string | X509Certificate;\n\n@Component({\n tag: 'peculiar-certificate-viewer',\n styleUrl: 'certificate-viewer.scss',\n shadow: true,\n})\nexport class CertificateViewer {\n private certificateDecoded: X509Certificate;\n\n private certificateDecodeError: Error;\n\n private mobileMediaQuery: MediaQueryList;\n\n /**\n * The certificate value for decode and show details. Use PEM or DER.\n */\n @Prop({ reflect: true }) certificate: CertificateProp;\n\n /**\n * If `true` - component will show split-button to download certificate as PEM or DER.\n */\n @Prop({ reflect: true }) download?: boolean;\n\n /**\n * Authority Key Identifier extension parent link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.subject_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdParentLink?: string;\n\n /**\n * Authority Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{authKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{authKeyId}}\n */\n @Prop({ reflect: true }) authKeyIdSiblingsLink?: string;\n\n /**\n * Subject Key Identifier extension children link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://censys.io/certificates?q=parsed.extensions.authority_key_id:%20{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdChildrenLink?: string;\n\n /**\n * Subject Key Identifier extension siblings link.\n * <br />\n * **NOTE**: `{{subjectKeyId}}` will be replaced to value from the extension.\n * @example\n * https://some.com/{{subjectKeyId}}\n */\n @Prop({ reflect: true }) subjectKeyIdSiblingsLink?: string;\n\n /**\n * Issuer DN link.\n * **NOTE**: HTML component attribute must be `issuer-dn-link`.\n */\n @Prop({ reflect: true }) issuerDnLink?: string;\n\n /**\n * Mobile media query string to control screen view change.\n * <br />\n * **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.\n * @example\n * (max-width: 900px)\n */\n @Prop({ reflect: false }) mobileMediaQueryString?: string = '(max-width: 900px)';\n\n @State() mobileScreenView: boolean = false;\n\n @State() isDecodeInProcess: boolean = true;\n\n private handleMediaQueryChange(event: MediaQueryListEvent) {\n this.mobileScreenView = event.matches;\n }\n\n componentWillLoad() {\n this.decodeCertificate(this.certificate);\n\n if (Build.isBrowser) {\n this.mobileMediaQuery = window.matchMedia(this.mobileMediaQueryString);\n this.mobileMediaQuery.addEventListener('change', this.handleMediaQueryChange.bind(this));\n this.mobileScreenView = this.mobileMediaQuery.matches;\n }\n }\n\n disconnectedCallback() {\n this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));\n }\n\n private async decodeCertificate(certificate: CertificateProp) {\n this.isDecodeInProcess = true;\n\n try {\n if (certificate instanceof X509Certificate) {\n this.certificateDecoded = certificate;\n } else if (typeof certificate === 'string') {\n this.certificateDecoded = new X509Certificate(certificate);\n } else {\n return;\n }\n\n this.certificateDecoded.parseExtensions();\n await this.certificateDecoded.getThumbprint('SHA-1');\n await this.certificateDecoded.getThumbprint('SHA-256');\n } catch (error) {\n this.certificateDecodeError = error;\n\n console.error('Error certificate parse:', error);\n }\n\n this.isDecodeInProcess = false;\n }\n\n /**\n * Rerun decodeCertificate if previuos value not equal current value\n */\n @Watch('certificate')\n watchCertificateAndDecode(newValue: CertificateProp, oldValue: CertificateProp) {\n if (typeof newValue === 'string' && typeof oldValue === 'string') {\n if (newValue !== oldValue) {\n this.decodeCertificate(newValue);\n }\n\n return;\n }\n\n if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {\n if (newValue.serialNumber !== oldValue.serialNumber) {\n this.decodeCertificate(newValue);\n }\n }\n }\n\n private getAuthKeyIdParentLink = (value: string) => this.authKeyIdParentLink\n ?.replace('{{authKeyId}}', value);\n\n private getAuthKeyIdSiblingsLink = (value: string) => this.authKeyIdSiblingsLink\n ?.replace('{{authKeyId}}', value);\n\n private getSubjectKeyIdChildrenLink = (value: string) => this.subjectKeyIdChildrenLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getSubjectKeyIdSiblingsLink = (value: string) => this.subjectKeyIdSiblingsLink\n ?.replace('{{subjectKeyId}}', value);\n\n private getIssuerDnLink() {\n return this.issuerDnLink;\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderErrorState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There was an error decoding this certificate.\n </Typography>\n </div>\n );\n }\n\n // eslint-disable-next-line class-methods-use-this\n private renderEmptyState() {\n return (\n <div class=\"status_wrapper\">\n <Typography>\n There is no certificate available.\n </Typography>\n </div>\n );\n }\n\n render() {\n if (this.certificateDecodeError) {\n return this.renderErrorState();\n }\n\n if (!this.certificateDecoded) {\n return this.renderEmptyState();\n }\n\n return (\n <Host\n data-mobile-screen-view={String(this.mobileScreenView)}\n >\n <table>\n <BasicInformation\n {...this.certificateDecoded}\n />\n\n <SubjectName\n name={this.certificateDecoded.subject}\n />\n\n <IssuerName\n name={this.certificateDecoded.issuer}\n issuerDnLink={this.getIssuerDnLink()}\n />\n\n <PublicKey\n publicKey={this.certificateDecoded.publicKey}\n />\n\n <Signature\n signature={this.certificateDecoded.signature}\n />\n\n <Thumbprints\n thumbprints={this.certificateDecoded.thumbprints}\n />\n\n <Extensions\n extensions={this.certificateDecoded.extensions}\n getLEILink={getLEILink}\n getDNSNameLink={getDNSNameLink}\n getIPAddressLink={getIPAddressLink}\n getAuthKeyIdParentLink={this.getAuthKeyIdParentLink}\n getAuthKeyIdSiblingsLink={this.getAuthKeyIdSiblingsLink}\n getSubjectKeyIdChildrenLink={this.getSubjectKeyIdChildrenLink}\n getSubjectKeyIdSiblingsLink={this.getSubjectKeyIdSiblingsLink}\n />\n\n {this.download && (\n <Miscellaneous\n certificate={this.certificateDecoded}\n />\n )}\n </table>\n </Host>\n );\n }\n}\n"],"mappings":";;;+gBAAA,IAAMA,qBAAuB,khS,ICyChBC,kBAAiB,W,kDAsIpBC,KAAAC,uBAAyB,SAACC,G,MAAkB,OAAAC,EAAAC,EAAKC,uBA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