@peculiar/certificates-viewer 2.0.1 → 3.0.1
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/README.md +3 -3
- package/dist/cjs/_commonjsHelpers-cb1f949a.js +23 -0
- package/dist/cjs/{download-cd98aa01.js → certification_request-96951e7b.js} +2880 -3313
- package/dist/cjs/{dom-760f300f.js → dom-f57e260e.js} +4 -1
- package/dist/cjs/download-5e7d5455.js +438 -0
- package/dist/cjs/{index-2973f90a.js → index-064e95c7.js} +287 -634
- package/dist/cjs/index.cjs.js +12 -0
- package/dist/cjs/{l10n-e971a5ac.js → l10n-2e7def18.js} +72 -90
- package/dist/cjs/loader.cjs.js +12 -3
- package/dist/cjs/peculiar-attribute-certificate-viewer_9.cjs.entry.js +1426 -1391
- package/dist/cjs/peculiar-certificate-summary_3.cjs.entry.js +66 -62
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +222 -217
- package/dist/cjs/peculiar.cjs.js +70 -3
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/attribute-certificate-viewer/attribute-certificate-viewer.js +220 -205
- package/dist/collection/components/attribute-certificate-viewer/holder.js +27 -24
- package/dist/collection/components/attribute-certificate-viewer/issuer.js +11 -8
- package/dist/collection/components/button/button.css +2 -7
- package/dist/collection/components/button/button.js +125 -122
- package/dist/collection/components/button-split/button-split.js +103 -100
- package/dist/collection/components/certificate-decoder/certificate-decoder.css +1 -3
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +158 -155
- package/dist/collection/components/certificate-summary/certificate-summary.js +75 -72
- package/dist/collection/components/certificate-viewer/attributes/activity_description_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/as_string_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/basic_attribute.js +11 -8
- package/dist/collection/components/certificate-viewer/attributes/challenge_password_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/index.js +45 -42
- package/dist/collection/components/certificate-viewer/attributes/insurance_value_attribute.js +7 -4
- package/dist/collection/components/certificate-viewer/attributes/name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/name_part.js +8 -5
- package/dist/collection/components/certificate-viewer/attributes/type_relationship_attribute.js +5 -2
- package/dist/collection/components/certificate-viewer/attributes/unstructured_name_attribute.js +6 -3
- package/dist/collection/components/certificate-viewer/attributes/valuation_ranking_attribute.js +18 -15
- package/dist/collection/components/certificate-viewer/attributes/web_gdpr_attribute.js +13 -10
- package/dist/collection/components/certificate-viewer/basic_information.js +13 -10
- package/dist/collection/components/certificate-viewer/certificate-viewer.js +255 -240
- package/dist/collection/components/certificate-viewer/extensions/archive_rev_info_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/as_string_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/attribute_value.js +4 -1
- package/dist/collection/components/certificate-viewer/extensions/authority_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/basic_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/basic_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/biometric_syntax_extension.js +12 -9
- package/dist/collection/components/certificate-viewer/extensions/ca_version_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_policies_extension.js +28 -25
- package/dist/collection/components/certificate-viewer/extensions/certificate_template_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/certificate_transparency_extension.js +13 -10
- package/dist/collection/components/certificate-viewer/extensions/crl_distribution_points_extension.js +11 -8
- package/dist/collection/components/certificate-viewer/extensions/crl_reason_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/enroll_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/entrust_version_info_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/extended_key_usage_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/general_name_part.js +55 -52
- package/dist/collection/components/certificate-viewer/extensions/index.js +112 -109
- package/dist/collection/components/certificate-viewer/extensions/info_access_syntax_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/key_usage_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/lei_role_extennsion.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/logotype_extension.js +49 -46
- package/dist/collection/components/certificate-viewer/extensions/name_constraints_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/netscape_cert_type_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/netscape_comment_extension.js +6 -3
- package/dist/collection/components/certificate-viewer/extensions/policy_constraints_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/policy_mappings_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/private_key_usage_period_extension.js +7 -4
- package/dist/collection/components/certificate-viewer/extensions/qc_statements_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_alternative_name_extension.js +5 -2
- package/dist/collection/components/certificate-viewer/extensions/subject_directory_attributes_extension.js +9 -6
- package/dist/collection/components/certificate-viewer/extensions/subject_key_identifier_extension.js +18 -15
- package/dist/collection/components/certificate-viewer/extensions/timestamp_extension.js +8 -5
- package/dist/collection/components/certificate-viewer/extensions/tn_auth_list_extension.js +10 -7
- package/dist/collection/components/certificate-viewer/get_string_by_oid.js +8 -5
- package/dist/collection/components/certificate-viewer/issuer_name.js +9 -6
- package/dist/collection/components/certificate-viewer/miscellaneous.js +29 -26
- package/dist/collection/components/certificate-viewer/public_key.js +31 -28
- package/dist/collection/components/certificate-viewer/row.js +35 -32
- package/dist/collection/components/certificate-viewer/signature.js +12 -9
- package/dist/collection/components/certificate-viewer/subject_name.js +8 -5
- package/dist/collection/components/certificate-viewer/thumbprints.js +15 -12
- package/dist/collection/components/certificates-viewer/certificates-viewer.css +1 -19
- package/dist/collection/components/certificates-viewer/certificates-viewer.js +384 -381
- package/dist/collection/components/circular-progress/circular-progress.css +2 -24
- package/dist/collection/components/circular-progress/circular-progress.js +73 -70
- package/dist/collection/components/csr-viewer/csr-viewer.js +197 -188
- package/dist/collection/components/highlight-words/highlight-words.js +56 -53
- package/dist/collection/components/link/link.css +1 -3
- package/dist/collection/components/link/link.js +60 -57
- package/dist/collection/components/text-hider/text-hider.js +75 -72
- package/dist/collection/components/typography/typography.css +1 -3
- package/dist/collection/components/typography/typography.js +126 -123
- package/dist/collection/constants/logs.js +79 -76
- package/dist/collection/constants/oids.js +2301 -2298
- package/dist/collection/crypto/asn_data.js +33 -32
- package/dist/collection/crypto/attribute.js +52 -49
- package/dist/collection/crypto/csr.js +64 -61
- package/dist/collection/crypto/extension.js +126 -123
- package/dist/collection/crypto/index.js +3 -0
- package/dist/collection/crypto/name.js +33 -32
- package/dist/collection/crypto/provider.js +28 -25
- package/dist/collection/crypto/utils.js +24 -21
- package/dist/collection/crypto/x509_attribute_certificate.js +61 -58
- package/dist/collection/crypto/x509_certificate.js +107 -104
- package/dist/collection/index.js +5 -1
- package/dist/collection/utils/date_formatter.js +19 -16
- package/dist/collection/utils/download.js +18 -15
- package/dist/collection/utils/download_from_buffer.js +30 -25
- package/dist/collection/utils/history.js +5 -2
- package/dist/collection/utils/index.js +3 -0
- package/dist/collection/utils/is_link.js +4 -1
- package/dist/collection/utils/l10n.js +28 -25
- package/dist/collection/utils/parse_hash.js +16 -13
- package/dist/collection/utils/query_stringify.js +12 -9
- package/dist/collection/utils/read_file.js +43 -40
- package/dist/collection/utils/third_party_links.js +3 -0
- package/dist/collection/utils/validator.js +15 -12
- package/dist/esm/_commonjsHelpers-bfbd2ad8.js +20 -0
- package/dist/esm/{download-1ff0a3be.js → certification_request-48e8b956.js} +2898 -3328
- package/dist/esm/{dom-91ed8d21.js → dom-f1b08a97.js} +4 -1
- package/dist/esm/download-cf68ac2c.js +434 -0
- package/dist/esm/{index-5ef692cc.js → index-bbd484d9.js} +278 -624
- package/dist/esm/index.js +5 -0
- package/dist/esm/{l10n-c8cf6930.js → l10n-ead9928b.js} +71 -86
- package/dist/esm/{loader.mjs → loader.js} +11 -2
- package/dist/esm/peculiar-attribute-certificate-viewer_9.entry.js +1425 -1390
- package/dist/esm/peculiar-certificate-summary_3.entry.js +66 -62
- package/dist/esm/peculiar-certificates-viewer.entry.js +222 -217
- package/dist/esm/peculiar.js +73 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/index.js +2 -2
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -1
- package/dist/peculiar/index.esm.js +4 -0
- package/dist/peculiar/p-452d69af.entry.js +113 -0
- package/dist/peculiar/p-886e9c53.js +87 -0
- package/dist/peculiar/p-9ae6b1f8.entry.js +4 -0
- package/dist/peculiar/{p-3d1015c2.js → p-9f4ee110.js} +5 -2
- package/dist/peculiar/p-c774ec0b.js +18 -0
- package/dist/peculiar/p-d09b762f.js +33 -0
- package/dist/peculiar/p-d0b55fbb.js +4 -0
- package/dist/peculiar/p-e5f99586.entry.js +4 -0
- package/dist/peculiar/p-f7683ba5.js +5 -0
- package/dist/peculiar/peculiar.esm.js +4 -1
- package/dist/types/components/attribute-certificate-viewer/attribute-certificate-viewer.d.ts +56 -56
- package/dist/types/components/attribute-certificate-viewer/holder.d.ts +1 -1
- package/dist/types/components/attribute-certificate-viewer/issuer.d.ts +1 -1
- package/dist/types/components/button/button.d.ts +17 -17
- package/dist/types/components/button-split/button-split.d.ts +10 -10
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +16 -16
- package/dist/types/components/certificate-summary/certificate-summary.d.ts +4 -4
- package/dist/types/components/certificate-viewer/attributes/activity_description_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/as_string_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/basic_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/challenge_password_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/index.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/insurance_value_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/type_relationship_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/unstructured_name_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/valuation_ranking_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/attributes/web_gdpr_attribute.d.ts +1 -1
- package/dist/types/components/certificate-viewer/basic_information.d.ts +6 -6
- package/dist/types/components/certificate-viewer/certificate-viewer.d.ts +66 -66
- package/dist/types/components/certificate-viewer/extensions/archive_rev_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/as_string_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/authority_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/basic_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/biometric_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/ca_version_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_policies_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_template_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/certificate_transparency_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_distribution_points_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/crl_reason_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/enroll_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/entrust_version_info_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/extended_key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/general_name_part.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/index.d.ts +2 -2
- package/dist/types/components/certificate-viewer/extensions/info_access_syntax_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/key_usage_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/lei_role_extennsion.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/logotype_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/name_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_cert_type_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/netscape_comment_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_constraints_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/policy_mappings_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/private_key_usage_period_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/qc_statements_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_alternative_name_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_directory_attributes_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/subject_key_identifier_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/timestamp_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/extensions/tn_auth_list_extension.d.ts +1 -1
- package/dist/types/components/certificate-viewer/issuer_name.d.ts +2 -2
- package/dist/types/components/certificate-viewer/miscellaneous.d.ts +1 -1
- package/dist/types/components/certificate-viewer/public_key.d.ts +1 -1
- package/dist/types/components/certificate-viewer/row.d.ts +7 -7
- package/dist/types/components/certificate-viewer/signature.d.ts +1 -1
- package/dist/types/components/certificate-viewer/subject_name.d.ts +1 -1
- package/dist/types/components/certificate-viewer/thumbprints.d.ts +1 -1
- package/dist/types/components/certificate-viewer/types.d.ts +26 -0
- package/dist/types/components/certificates-viewer/certificates-viewer.d.ts +64 -64
- package/dist/types/components/circular-progress/circular-progress.d.ts +10 -10
- package/dist/types/components/csr-viewer/csr-viewer.d.ts +45 -45
- package/dist/types/components/highlight-words/highlight-words.d.ts +8 -8
- package/dist/types/components/link/link.d.ts +6 -6
- package/dist/types/components/text-hider/text-hider.d.ts +4 -4
- package/dist/types/components/typography/typography.d.ts +18 -18
- package/dist/types/components.d.ts +11 -3
- package/dist/types/constants/logs.d.ts +76 -76
- package/dist/types/constants/oids.d.ts +2293 -2293
- package/dist/types/crypto/asn_data.d.ts +6 -6
- package/dist/types/crypto/attribute.d.ts +3 -3
- package/dist/types/crypto/csr.d.ts +19 -19
- package/dist/types/crypto/extension.d.ts +3 -3
- package/dist/types/crypto/name.d.ts +7 -7
- package/dist/types/crypto/provider.d.ts +15 -15
- package/dist/types/crypto/x509_attribute_certificate.d.ts +22 -22
- package/dist/types/crypto/x509_certificate.d.ts +28 -28
- package/dist/types/index.d.ts +2 -1
- package/dist/types/interface.d.ts +3 -0
- package/dist/types/stencil-public-runtime.d.ts +230 -217
- package/dist/types/utils/download.d.ts +8 -8
- package/dist/types/utils/download_from_buffer.d.ts +3 -3
- package/dist/types/utils/l10n.d.ts +43 -43
- package/dist/types/utils/read_file.d.ts +7 -7
- package/loader/cdn.js +3 -1
- package/loader/index.cjs.js +3 -1
- package/loader/index.d.ts +0 -1
- package/loader/index.es2017.js +5 -0
- package/loader/{index.mjs → index.js} +4 -2
- package/loader/package.json +4 -5
- package/package.json +14 -15
- package/dist/cjs/css-shim-1b988199.js +0 -6
- package/dist/cjs/patch-15ea31af.js +0 -112
- package/dist/cjs/shadow-css-376763e9.js +0 -385
- package/dist/esm/css-shim-5ce2b5c4.js +0 -4
- package/dist/esm/index.mjs +0 -1
- package/dist/esm/patch-f8a17185.js +0 -109
- package/dist/esm/peculiar.mjs +0 -6
- package/dist/esm/shadow-css-95922619.js +0 -383
- package/dist/esm-es5/css-shim-5ce2b5c4.js +0 -122
- package/dist/esm-es5/dom-91ed8d21.js +0 -468
- package/dist/esm-es5/download-1ff0a3be.js +0 -12692
- package/dist/esm-es5/index-5ef692cc.js +0 -1839
- package/dist/esm-es5/index.mjs +0 -0
- package/dist/esm-es5/l10n-c8cf6930.js +0 -758
- package/dist/esm-es5/loader.mjs +0 -10
- package/dist/esm-es5/patch-f8a17185.js +0 -106
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_9.entry.js +0 -2168
- package/dist/esm-es5/peculiar-certificate-summary_3.entry.js +0 -83
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +0 -290
- package/dist/esm-es5/peculiar.mjs +0 -5
- package/dist/esm-es5/shadow-css-95922619.js +0 -408
- package/dist/index.mjs +0 -1
- package/dist/peculiar/p-0ad0b6e8.js +0 -1
- package/dist/peculiar/p-198d9121.js +0 -1
- package/dist/peculiar/p-294c4ef9.entry.js +0 -1
- package/dist/peculiar/p-3d339152.system.entry.js +0 -1
- package/dist/peculiar/p-4b7cd42f.js +0 -12
- package/dist/peculiar/p-50ea2036.system.js +0 -1
- package/dist/peculiar/p-557d912f.system.js +0 -1
- package/dist/peculiar/p-75076c56.system.js +0 -21
- package/dist/peculiar/p-84e8326d.entry.js +0 -110
- package/dist/peculiar/p-94f96303.system.js +0 -100
- package/dist/peculiar/p-983b5210.system.entry.js +0 -1
- package/dist/peculiar/p-9f815f76.system.js +0 -1
- package/dist/peculiar/p-aa0a9b36.system.js +0 -1
- package/dist/peculiar/p-bd1f9066.system.js +0 -36
- package/dist/peculiar/p-bd949790.js +0 -1
- package/dist/peculiar/p-cf1841f8.js +0 -30
- package/dist/peculiar/p-dbdd61e7.entry.js +0 -1
- package/dist/peculiar/p-dc6b70b2.js +0 -100
- package/dist/peculiar/p-fb53799e.system.js +0 -1
- package/dist/peculiar/p-fc92385a.system.entry.js +0 -457
- package/dist/peculiar/p-fdad110e.system.js +0 -13
- package/dist/peculiar/peculiar.js +0 -132
- package/dist/peculiar.js +0 -30
- package/loader/index.es2017.mjs +0 -3
- package/loader/node-main.js +0 -3
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* © Peculiar Ventures https://peculiarventures.com/ - MIT License
|
|
3
|
+
*/
|
|
4
|
+
import { h, r as registerInstance, H as Host, c as createEvent } from './index-bbd484d9.js';
|
|
5
|
+
import { A as AsnData, a as Attribute$1, i as id_pkcs9_at_extensionRequest, b as AsnParser, E as ExtensionRequest, c as Extension, d as AsnConvert, e as id_pkcs9_at_unstructuredName, U as UnstructuredName, f as id_pkcs9_at_challengePassword, C as ChallengePassword, g as id_ValuationRanking, V as ValuationRanking, h as id_InsuranceValue, I as InsuranceValue, j as id_WebGDPR, W as WebGDPR, k as id_ActivityDescription, l as ActivityDescription, m as id_TypeRelationship, T as TypeRelationship, n as id_DomainNameTechnicalOperator, D as DomainNameTechnicalOperator, o as id_DomainNameOwner, p as DomainNameOwner, q as id_DomainNameLegalRepresentative, r as DomainNameLegalRepresentative, s as id_DomainNameBeneficiary, t as DomainNameBeneficiary, u as certificateRawToBuffer, v as AttributeCertificate, w as getCertificateThumbprint, x as hexFormat, y as base64Format, z as CertificationRequest, N as Name, B as id_ecPublicKey, F as ECParameters, G as id_rsaEncryption, R as RSAPublicKey, O as OIDs, H as Name$1, J as OtherName, K as DisplayText, L as UserNotice, M as EDIPartyName, P as AsnIntegerArrayBufferConverter, Q as KeyUsage, S as BasicConstraints, X as ExtendedKeyUsage, Y as SubjectKeyIdentifier, Z as AuthorityKeyIdentifier, _ as CRLDistributionPoints, $ as AuthorityInfoAccessSyntax, a0 as SubjectInfoAccessSyntax, a1 as SubjectAlternativeName, a2 as CertificatePolicies, a3 as CertificateTransparency, a4 as NameConstraints, a5 as CertificateTemplate, a6 as EnrollCertTypeChoice, a7 as CaVersion, a8 as QCStatements, a9 as NetscapeComment, aa as NetscapeCertType, ab as LeiRole, ac as LeiChoice, ad as Timestamp, ae as ArchiveRevInfo, af as CRLReason, ag as SubjectDirectoryAttributes, ah as PrivateKeyUsagePeriod, ai as EntrustVersionInfo, aj as BiometricSyntax, ak as LogotypeExtn, al as TNAuthorizationList, am as PolicyConstraints, an as PolicyMappings, ao as isPem, ap as isX509Pem, aq as isPkcs10Pem, ar as isX509AttributePem, as as X509Certificate } from './certification_request-48e8b956.js';
|
|
6
|
+
import { b as build, D as Download } from './download-cf68ac2c.js';
|
|
7
|
+
import { d as dateDiff, l as l10n, a as dateShort, h as history } from './l10n-ead9928b.js';
|
|
8
|
+
import './_commonjsHelpers-bfbd2ad8.js';
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* @license
|
|
@@ -21,17 +26,17 @@ import { A as AsnData, a as Attribute$1, b as build_2, i as id_pkcs9_at_extensio
|
|
|
21
26
|
* ```
|
|
22
27
|
*/
|
|
23
28
|
function readAsBinaryString(file) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
reader.onerror = () => reject(reader.error);
|
|
33
|
-
reader.readAsBinaryString(file);
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
const reader = new FileReader();
|
|
31
|
+
reader.onload = () => resolve({
|
|
32
|
+
value: reader.result,
|
|
33
|
+
fileName: file.name,
|
|
34
|
+
fileSize: file.size,
|
|
35
|
+
sourceMime: file.type,
|
|
34
36
|
});
|
|
37
|
+
reader.onerror = () => reject(reader.error);
|
|
38
|
+
reader.readAsBinaryString(file);
|
|
39
|
+
});
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
/**
|
|
@@ -42,56 +47,56 @@ function readAsBinaryString(file) {
|
|
|
42
47
|
* LICENSE file in the root directory of this source tree.
|
|
43
48
|
*/
|
|
44
49
|
class Attribute extends AsnData {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
50
|
+
constructor(raw) {
|
|
51
|
+
super(raw, Attribute$1);
|
|
52
|
+
const asnExtnValue = this.getAsnExtnValue();
|
|
53
|
+
switch (this.asn.type) {
|
|
54
|
+
case id_DomainNameBeneficiary:
|
|
55
|
+
this.value = AsnParser.parse(asnExtnValue, DomainNameBeneficiary);
|
|
56
|
+
break;
|
|
57
|
+
case id_DomainNameLegalRepresentative:
|
|
58
|
+
this.value = AsnParser.parse(asnExtnValue, DomainNameLegalRepresentative);
|
|
59
|
+
break;
|
|
60
|
+
case id_DomainNameOwner:
|
|
61
|
+
this.value = AsnParser.parse(asnExtnValue, DomainNameOwner);
|
|
62
|
+
break;
|
|
63
|
+
case id_DomainNameTechnicalOperator:
|
|
64
|
+
this.value = AsnParser.parse(asnExtnValue, DomainNameTechnicalOperator);
|
|
65
|
+
break;
|
|
66
|
+
case id_TypeRelationship:
|
|
67
|
+
this.value = AsnParser.parse(asnExtnValue, TypeRelationship);
|
|
68
|
+
break;
|
|
69
|
+
case id_ActivityDescription:
|
|
70
|
+
this.value = AsnParser.parse(asnExtnValue, ActivityDescription);
|
|
71
|
+
break;
|
|
72
|
+
case id_WebGDPR:
|
|
73
|
+
this.value = AsnParser.parse(asnExtnValue, WebGDPR);
|
|
74
|
+
break;
|
|
75
|
+
case id_InsuranceValue:
|
|
76
|
+
this.value = AsnParser.parse(asnExtnValue, InsuranceValue);
|
|
77
|
+
break;
|
|
78
|
+
case id_ValuationRanking:
|
|
79
|
+
this.value = AsnParser.parse(asnExtnValue, ValuationRanking);
|
|
80
|
+
break;
|
|
81
|
+
case id_pkcs9_at_challengePassword:
|
|
82
|
+
this.value = AsnParser.parse(asnExtnValue, ChallengePassword);
|
|
83
|
+
break;
|
|
84
|
+
case id_pkcs9_at_unstructuredName:
|
|
85
|
+
this.value = AsnParser.parse(asnExtnValue, UnstructuredName);
|
|
86
|
+
break;
|
|
87
|
+
case id_pkcs9_at_extensionRequest: {
|
|
88
|
+
const extensionRequest = AsnParser.parse(asnExtnValue, ExtensionRequest);
|
|
89
|
+
this.value = extensionRequest
|
|
90
|
+
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
default:
|
|
94
|
+
this.value = build.Convert.ToHex(asnExtnValue);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
getAsnExtnValue() {
|
|
98
|
+
return this.asn.values[0];
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
/**
|
|
@@ -102,70 +107,70 @@ class Attribute extends AsnData {
|
|
|
102
107
|
* LICENSE file in the root directory of this source tree.
|
|
103
108
|
*/
|
|
104
109
|
class X509AttributeCertificate extends AsnData {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
110
|
+
constructor(raw) {
|
|
111
|
+
var _a;
|
|
112
|
+
super(certificateRawToBuffer(raw), AttributeCertificate);
|
|
113
|
+
this.thumbprints = {};
|
|
114
|
+
this.type = 'X.509 Attribute Certificate';
|
|
115
|
+
const { acinfo } = this.asn;
|
|
116
|
+
this.serialNumber = build.Convert.ToHex(acinfo.serialNumber);
|
|
117
|
+
this.version = acinfo.version;
|
|
118
|
+
const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
119
|
+
if (!notBefore) {
|
|
120
|
+
throw new Error("Cannot get 'notBefore' value");
|
|
121
|
+
}
|
|
122
|
+
this.notBefore = notBefore;
|
|
123
|
+
const notAfter = acinfo.attrCertValidityPeriod.notAfterTime;
|
|
124
|
+
if (!notAfter) {
|
|
125
|
+
throw new Error("Cannot get 'notAfter' value");
|
|
126
|
+
}
|
|
127
|
+
this.notAfter = notAfter;
|
|
128
|
+
this.validity = dateDiff(this.notBefore, this.notAfter);
|
|
129
|
+
this.issuer = acinfo.issuer.v1Form || ((_a = acinfo.issuer.v2Form) === null || _a === void 0 ? void 0 : _a.issuerName);
|
|
130
|
+
this.holder = acinfo.holder;
|
|
131
|
+
}
|
|
132
|
+
get signature() {
|
|
133
|
+
const { signatureValue, signatureAlgorithm } = this.asn;
|
|
134
|
+
return {
|
|
135
|
+
value: signatureValue,
|
|
136
|
+
algorithm: signatureAlgorithm.algorithm,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
parseExtensions() {
|
|
140
|
+
const { acinfo } = this.asn;
|
|
141
|
+
if (acinfo.extensions) {
|
|
142
|
+
this.extensions = acinfo.extensions
|
|
143
|
+
.map((e) => new Extension(AsnConvert.serialize(e)));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
parseAttributes() {
|
|
147
|
+
const { acinfo } = this.asn;
|
|
148
|
+
if (acinfo.attributes) {
|
|
149
|
+
this.attributes = acinfo.attributes
|
|
150
|
+
.map((e) => new Attribute(AsnConvert.serialize(e)));
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async getThumbprint(algorithm = 'SHA-1') {
|
|
154
|
+
try {
|
|
155
|
+
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
156
|
+
this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
console.error('Error thumbprint get:', error);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
exportAsBase64() {
|
|
163
|
+
return build.Convert.ToBase64(this.raw);
|
|
164
|
+
}
|
|
165
|
+
exportAsHexFormatted() {
|
|
166
|
+
return hexFormat(build.Convert.ToHex(this.raw));
|
|
167
|
+
}
|
|
168
|
+
exportAsPemFormatted() {
|
|
169
|
+
return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
|
|
170
|
+
}
|
|
171
|
+
get commonName() {
|
|
172
|
+
return `attribute-certificate-${this.thumbprints['SHA-1']}`;
|
|
173
|
+
}
|
|
169
174
|
}
|
|
170
175
|
|
|
171
176
|
/**
|
|
@@ -176,74 +181,74 @@ class X509AttributeCertificate extends AsnData {
|
|
|
176
181
|
* LICENSE file in the root directory of this source tree.
|
|
177
182
|
*/
|
|
178
183
|
class CSR extends AsnData {
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
184
|
+
constructor(raw) {
|
|
185
|
+
super(certificateRawToBuffer(raw), CertificationRequest);
|
|
186
|
+
this.thumbprints = {};
|
|
187
|
+
this.type = 'PKCS#10 Certificate Request';
|
|
188
|
+
const { certificationRequestInfo } = this.asn;
|
|
189
|
+
this.subject = new Name(certificationRequestInfo.subject).toJSON();
|
|
190
|
+
this.version = certificationRequestInfo.version;
|
|
191
|
+
}
|
|
192
|
+
get publicKey() {
|
|
193
|
+
const { subjectPublicKey, algorithm } = this.asn.certificationRequestInfo.subjectPKInfo;
|
|
194
|
+
let params;
|
|
195
|
+
if (algorithm.algorithm === id_ecPublicKey && algorithm.parameters) {
|
|
196
|
+
params = AsnConvert.parse(algorithm.parameters, ECParameters);
|
|
197
|
+
}
|
|
198
|
+
if (algorithm.algorithm === id_rsaEncryption) {
|
|
199
|
+
params = AsnConvert.parse(subjectPublicKey, RSAPublicKey);
|
|
200
|
+
}
|
|
201
|
+
const spki = AsnConvert.serialize(this.asn.certificationRequestInfo.subjectPKInfo);
|
|
202
|
+
return {
|
|
203
|
+
params,
|
|
204
|
+
value: spki,
|
|
205
|
+
algorithm: algorithm.algorithm,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
get signature() {
|
|
209
|
+
const { signature, signatureAlgorithm } = this.asn;
|
|
210
|
+
return {
|
|
211
|
+
value: signature,
|
|
212
|
+
algorithm: signatureAlgorithm.algorithm,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
get commonName() {
|
|
216
|
+
if (!this.subject) {
|
|
217
|
+
return '';
|
|
218
|
+
}
|
|
219
|
+
for (let i = 0; i < this.subject.length; i += 1) {
|
|
220
|
+
const name = this.subject[i];
|
|
221
|
+
if (name.shortName === 'CN' || name.shortName === 'E' || name.shortName === 'O') {
|
|
222
|
+
return name.value;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return '';
|
|
226
|
+
}
|
|
227
|
+
async getThumbprint(algorithm = 'SHA-1') {
|
|
228
|
+
try {
|
|
229
|
+
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
230
|
+
this.thumbprints[algorithm['name'] || algorithm] = build.Convert.ToHex(thumbprint);
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
console.error('Error thumbprint get:', error);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
parseAttributes() {
|
|
237
|
+
const { certificationRequestInfo } = this.asn;
|
|
238
|
+
if (certificationRequestInfo.attributes) {
|
|
239
|
+
this.attributes = certificationRequestInfo.attributes
|
|
240
|
+
.map((e) => new Attribute(AsnConvert.serialize(e)));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exportAsBase64() {
|
|
244
|
+
return build.Convert.ToBase64(this.raw);
|
|
245
|
+
}
|
|
246
|
+
exportAsHexFormatted() {
|
|
247
|
+
return hexFormat(build.Convert.ToHex(this.raw));
|
|
248
|
+
}
|
|
249
|
+
exportAsPemFormatted() {
|
|
250
|
+
return `-----BEGIN CERTIFICATE REQUEST-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
|
|
251
|
+
}
|
|
247
252
|
}
|
|
248
253
|
|
|
249
254
|
/**
|
|
@@ -254,11 +259,11 @@ class CSR extends AsnData {
|
|
|
254
259
|
* LICENSE file in the root directory of this source tree.
|
|
255
260
|
*/
|
|
256
261
|
function getStringByOID(value) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
+
const oid = OIDs[value];
|
|
263
|
+
if (oid) {
|
|
264
|
+
return `${oid} (${value})`;
|
|
265
|
+
}
|
|
266
|
+
return value;
|
|
262
267
|
}
|
|
263
268
|
|
|
264
269
|
/**
|
|
@@ -269,7 +274,7 @@ function getStringByOID(value) {
|
|
|
269
274
|
* LICENSE file in the root directory of this source tree.
|
|
270
275
|
*/
|
|
271
276
|
function isLink(value) {
|
|
272
|
-
|
|
277
|
+
return value.indexOf('http') === 0;
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
/**
|
|
@@ -280,40 +285,40 @@ function isLink(value) {
|
|
|
280
285
|
* LICENSE file in the root directory of this source tree.
|
|
281
286
|
*/
|
|
282
287
|
const RowTitle = (props) => {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
const { value } = props;
|
|
289
|
+
if (!value) {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
return (h("tr", { class: "title" },
|
|
293
|
+
h("td", { colSpan: 2 },
|
|
294
|
+
h("peculiar-typography", { type: "h6" }, value))));
|
|
290
295
|
};
|
|
291
296
|
const RowValue = (props) => {
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
297
|
+
const { name, value, monospace, collapse, href, extraValue, } = props;
|
|
298
|
+
if (!name) {
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
if (value === undefined || value === null) {
|
|
302
|
+
return null;
|
|
303
|
+
}
|
|
304
|
+
let elementValue;
|
|
305
|
+
if (collapse) {
|
|
306
|
+
elementValue = (h("peculiar-text-hider", null, value));
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
elementValue = value;
|
|
310
|
+
}
|
|
311
|
+
const hasValue = !!value.toString();
|
|
312
|
+
return (h("tr", null,
|
|
313
|
+
h("td", { colSpan: hasValue ? 1 : 2 },
|
|
314
|
+
h("peculiar-typography", { color: "grey_5" },
|
|
315
|
+
name,
|
|
316
|
+
hasValue ? ':' : '')),
|
|
317
|
+
hasValue && (h("td", { class: {
|
|
318
|
+
monospace,
|
|
319
|
+
} }, (isLink(value.toString()) || href) ? (h("peculiar-link", { href: href || value.toString() }, value)) : (h("peculiar-typography", { monospace: monospace },
|
|
320
|
+
elementValue,
|
|
321
|
+
extraValue))))));
|
|
317
322
|
};
|
|
318
323
|
|
|
319
324
|
/**
|
|
@@ -324,15 +329,15 @@ const RowValue = (props) => {
|
|
|
324
329
|
* LICENSE file in the root directory of this source tree.
|
|
325
330
|
*/
|
|
326
331
|
const Signature = (props) => {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
332
|
+
const { signature } = props;
|
|
333
|
+
if (!signature) {
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
return [
|
|
337
|
+
h(RowTitle, { value: l10n.getString('signature') }),
|
|
338
|
+
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(signature.algorithm) }),
|
|
339
|
+
h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(signature.value), monospace: true, collapse: true }),
|
|
340
|
+
];
|
|
336
341
|
};
|
|
337
342
|
|
|
338
343
|
/**
|
|
@@ -343,14 +348,14 @@ const Signature = (props) => {
|
|
|
343
348
|
* LICENSE file in the root directory of this source tree.
|
|
344
349
|
*/
|
|
345
350
|
const BasicAttribute = (props, children) => {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
const { attribute } = props;
|
|
352
|
+
return ([
|
|
353
|
+
h(RowValue, { name: "Name", value: getStringByOID(attribute.asn.type) }),
|
|
354
|
+
children,
|
|
355
|
+
h("tr", null,
|
|
356
|
+
h("td", { colSpan: 2, class: "divider" },
|
|
357
|
+
h("span", { class: "bg_fill" }))),
|
|
358
|
+
]);
|
|
354
359
|
};
|
|
355
360
|
|
|
356
361
|
/**
|
|
@@ -361,11 +366,11 @@ const BasicAttribute = (props, children) => {
|
|
|
361
366
|
* LICENSE file in the root directory of this source tree.
|
|
362
367
|
*/
|
|
363
368
|
const NamePart = (props) => {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
+
const { name } = props;
|
|
370
|
+
if (!name) {
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
return name.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (h(RowValue, { name: OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() })))));
|
|
369
374
|
};
|
|
370
375
|
|
|
371
376
|
/**
|
|
@@ -376,9 +381,9 @@ const NamePart = (props) => {
|
|
|
376
381
|
* LICENSE file in the root directory of this source tree.
|
|
377
382
|
*/
|
|
378
383
|
const NameAttribute = (props) => {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
384
|
+
const { attribute } = props;
|
|
385
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
386
|
+
h(NamePart, { name: attribute.value })));
|
|
382
387
|
};
|
|
383
388
|
|
|
384
389
|
/**
|
|
@@ -389,62 +394,62 @@ const NameAttribute = (props) => {
|
|
|
389
394
|
* LICENSE file in the root directory of this source tree.
|
|
390
395
|
*/
|
|
391
396
|
const names = {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
397
|
+
otherName: 'Other Name',
|
|
398
|
+
rfc822Name: 'RFC 822 Name',
|
|
399
|
+
dNSName: 'DNS Name',
|
|
400
|
+
x400Address: 'X400 Address',
|
|
401
|
+
directoryName: 'Directory Name',
|
|
402
|
+
ediPartyName: 'Edi Party Name ',
|
|
403
|
+
uniformResourceIdentifier: 'URI',
|
|
404
|
+
iPAddress: 'IP Address',
|
|
405
|
+
registeredID: 'Registered ID',
|
|
401
406
|
};
|
|
402
407
|
const GeneralNamePart = (props) => {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
catch (error) {
|
|
430
|
-
//
|
|
431
|
-
}
|
|
432
|
-
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: build_2.ToHex(value.value), monospace: true }));
|
|
433
|
-
}
|
|
434
|
-
if (build_1.isBufferSource(value)) {
|
|
435
|
-
return (h(RowValue, { name: names[name] || name, value: build_2.ToString(value) }));
|
|
436
|
-
}
|
|
437
|
-
if (value instanceof EDIPartyName) {
|
|
438
|
-
return (h(RowValue, { name: names[name] || name, value: build_2.ToString(value.partyName) }));
|
|
439
|
-
}
|
|
440
|
-
if (name === 'dNSName') {
|
|
441
|
-
return (h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
|
|
442
|
-
}
|
|
443
|
-
if (name === 'iPAddress') {
|
|
444
|
-
return (h(RowValue, { name: names[name] || name, value: value, href: getIPAddressLink(value) }));
|
|
408
|
+
const { generalName, getDNSNameLink, getIPAddressLink } = props;
|
|
409
|
+
if (!generalName) {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
return Object.keys(generalName).map((name) => {
|
|
413
|
+
const value = generalName[name];
|
|
414
|
+
if (value instanceof Name$1) {
|
|
415
|
+
return [
|
|
416
|
+
h(RowValue, { name: names[name] || name, value: "" }),
|
|
417
|
+
value.map((relativeDistinguishedName) => (relativeDistinguishedName.map((attributeTypeAndValue) => (h(RowValue, { name: OIDs[attributeTypeAndValue.type] || attributeTypeAndValue.type, value: attributeTypeAndValue.value.toString() }))))),
|
|
418
|
+
];
|
|
419
|
+
}
|
|
420
|
+
if (value instanceof OtherName) {
|
|
421
|
+
try {
|
|
422
|
+
const text = AsnParser.parse(value.value, DisplayText);
|
|
423
|
+
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: text.toString() }));
|
|
424
|
+
}
|
|
425
|
+
catch (error) {
|
|
426
|
+
//
|
|
427
|
+
}
|
|
428
|
+
try {
|
|
429
|
+
const text = AsnParser.parse(value.value, UserNotice);
|
|
430
|
+
if (text.explicitText) {
|
|
431
|
+
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: text.explicitText.toString() }));
|
|
445
432
|
}
|
|
446
|
-
|
|
447
|
-
|
|
433
|
+
}
|
|
434
|
+
catch (error) {
|
|
435
|
+
//
|
|
436
|
+
}
|
|
437
|
+
return (h(RowValue, { name: OIDs[value.typeId] || value.typeId, value: build.Convert.ToHex(value.value), monospace: true }));
|
|
438
|
+
}
|
|
439
|
+
if (build.BufferSourceConverter.isBufferSource(value)) {
|
|
440
|
+
return (h(RowValue, { name: names[name] || name, value: build.Convert.ToString(value) }));
|
|
441
|
+
}
|
|
442
|
+
if (value instanceof EDIPartyName) {
|
|
443
|
+
return (h(RowValue, { name: names[name] || name, value: build.Convert.ToString(value.partyName) }));
|
|
444
|
+
}
|
|
445
|
+
if (name === 'dNSName') {
|
|
446
|
+
return (h(RowValue, { name: names[name] || name, value: value, href: getDNSNameLink(value) }));
|
|
447
|
+
}
|
|
448
|
+
if (name === 'iPAddress') {
|
|
449
|
+
return (h(RowValue, { name: names[name] || name, value: value, href: getIPAddressLink(value) }));
|
|
450
|
+
}
|
|
451
|
+
return (h(RowValue, { name: names[name] || name, value: value }));
|
|
452
|
+
});
|
|
448
453
|
};
|
|
449
454
|
|
|
450
455
|
/**
|
|
@@ -455,14 +460,14 @@ const GeneralNamePart = (props) => {
|
|
|
455
460
|
* LICENSE file in the root directory of this source tree.
|
|
456
461
|
*/
|
|
457
462
|
const ActivityDescriptionAttribute = (props) => {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
const { attribute } = props;
|
|
464
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
465
|
+
h(RowValue, { name: "Code Authority", value: "" }),
|
|
466
|
+
h(GeneralNamePart, { generalName: attribute.value.codeAuthority, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
|
|
467
|
+
h(RowValue, { name: "Code Id", value: "" }),
|
|
468
|
+
h(GeneralNamePart, { generalName: attribute.value.codeId, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
|
|
469
|
+
h(RowValue, { name: "Short Name", value: attribute.value.shortName }),
|
|
470
|
+
h(RowValue, { name: "Short Description", value: attribute.value.shortDescription })));
|
|
466
471
|
};
|
|
467
472
|
|
|
468
473
|
/**
|
|
@@ -473,16 +478,16 @@ const ActivityDescriptionAttribute = (props) => {
|
|
|
473
478
|
* LICENSE file in the root directory of this source tree.
|
|
474
479
|
*/
|
|
475
480
|
const WebGdprAttribute = (props) => {
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
481
|
+
const { attribute } = props;
|
|
482
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
483
|
+
h(RowValue, { name: "Assessment Authority", value: "" }),
|
|
484
|
+
h(GeneralNamePart, { generalName: attribute.value.assessmentAuthority, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
|
|
485
|
+
h(RowValue, { name: "Assessment Location", value: "" }),
|
|
486
|
+
h(GeneralNamePart, { generalName: attribute.value.assessmentLocation, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
|
|
487
|
+
h(RowValue, { name: "Assessment Ref", value: "" }),
|
|
488
|
+
h(GeneralNamePart, { generalName: attribute.value.assessmentRef, getDNSNameLink: () => '', getIPAddressLink: () => '' }),
|
|
489
|
+
h(RowValue, { name: "Data Storage Territory", value: attribute.value.dataStorageTerritory }),
|
|
490
|
+
h(RowValue, { name: "Description", value: attribute.value.description })));
|
|
486
491
|
};
|
|
487
492
|
|
|
488
493
|
/**
|
|
@@ -493,10 +498,10 @@ const WebGdprAttribute = (props) => {
|
|
|
493
498
|
* LICENSE file in the root directory of this source tree.
|
|
494
499
|
*/
|
|
495
500
|
const InsuranceValueAttribute = (props) => {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
501
|
+
const { attribute } = props;
|
|
502
|
+
const value = `${attribute.value.base} * 10^${attribute.value.degree} ${attribute.value.location}`;
|
|
503
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
504
|
+
h(RowValue, { name: "Value", value: value })));
|
|
500
505
|
};
|
|
501
506
|
|
|
502
507
|
/**
|
|
@@ -507,8 +512,8 @@ const InsuranceValueAttribute = (props) => {
|
|
|
507
512
|
* LICENSE file in the root directory of this source tree.
|
|
508
513
|
*/
|
|
509
514
|
const TypeRelationshipAttribute = (props) => {
|
|
510
|
-
|
|
511
|
-
|
|
515
|
+
const { attribute } = props;
|
|
516
|
+
return (h(BasicAttribute, { attribute: attribute }, Object.keys(attribute.value).map((keyName) => (h(RowValue, { name: keyName, value: attribute.value[keyName].toNumber() ? 'YES' : 'NO' })))));
|
|
512
517
|
};
|
|
513
518
|
|
|
514
519
|
/**
|
|
@@ -519,23 +524,23 @@ const TypeRelationshipAttribute = (props) => {
|
|
|
519
524
|
* LICENSE file in the root directory of this source tree.
|
|
520
525
|
*/
|
|
521
526
|
const getValueRank = (value) => {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
let ratio = 1;
|
|
528
|
+
if (value / 100 > 1) {
|
|
529
|
+
ratio = 100;
|
|
530
|
+
}
|
|
531
|
+
else if (value / 10 > 1) {
|
|
532
|
+
ratio = 10;
|
|
533
|
+
}
|
|
534
|
+
return `${value}/${5 * ratio}`;
|
|
530
535
|
};
|
|
531
536
|
const ValuationRankingAttribute = (props) => {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
537
|
+
const { attribute } = props;
|
|
538
|
+
const values = Object.keys(attribute.value).map((keyName) => ([
|
|
539
|
+
getValueRank(attribute.value[keyName]),
|
|
540
|
+
h("br", null),
|
|
541
|
+
]));
|
|
542
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
543
|
+
h(RowValue, { name: "Value", value: values })));
|
|
539
544
|
};
|
|
540
545
|
|
|
541
546
|
/**
|
|
@@ -546,9 +551,9 @@ const ValuationRankingAttribute = (props) => {
|
|
|
546
551
|
* LICENSE file in the root directory of this source tree.
|
|
547
552
|
*/
|
|
548
553
|
const AsStringAttribute = (props) => {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
554
|
+
const { attribute } = props;
|
|
555
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
556
|
+
h(RowValue, { name: "Value", value: attribute.value, monospace: true })));
|
|
552
557
|
};
|
|
553
558
|
|
|
554
559
|
/**
|
|
@@ -559,9 +564,9 @@ const AsStringAttribute = (props) => {
|
|
|
559
564
|
* LICENSE file in the root directory of this source tree.
|
|
560
565
|
*/
|
|
561
566
|
const UnstructuredNameAttribute = (props) => {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
567
|
+
const { attribute } = props;
|
|
568
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
569
|
+
h(RowValue, { name: "Value", value: attribute.value.utf8String })));
|
|
565
570
|
};
|
|
566
571
|
|
|
567
572
|
/**
|
|
@@ -572,9 +577,9 @@ const UnstructuredNameAttribute = (props) => {
|
|
|
572
577
|
* LICENSE file in the root directory of this source tree.
|
|
573
578
|
*/
|
|
574
579
|
const ChallengePasswordAttribute = (props) => {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
580
|
+
const { attribute } = props;
|
|
581
|
+
return (h(BasicAttribute, { attribute: attribute },
|
|
582
|
+
h(RowValue, { name: "Value", value: attribute.value.toString() })));
|
|
578
583
|
};
|
|
579
584
|
|
|
580
585
|
/**
|
|
@@ -585,49 +590,49 @@ const ChallengePasswordAttribute = (props) => {
|
|
|
585
590
|
* LICENSE file in the root directory of this source tree.
|
|
586
591
|
*/
|
|
587
592
|
const Attributes = (props) => {
|
|
588
|
-
|
|
589
|
-
|
|
593
|
+
const { attributes } = props;
|
|
594
|
+
if (!attributes || !attributes.length) {
|
|
595
|
+
return null;
|
|
596
|
+
}
|
|
597
|
+
return ([
|
|
598
|
+
h(RowTitle, { value: "Attributes" }),
|
|
599
|
+
attributes.map((attribute) => {
|
|
600
|
+
try {
|
|
601
|
+
if (attribute.value instanceof Name$1) {
|
|
602
|
+
return (h(NameAttribute, { attribute: attribute }));
|
|
603
|
+
}
|
|
604
|
+
if (attribute.value instanceof ActivityDescription) {
|
|
605
|
+
return (h(ActivityDescriptionAttribute, { attribute: attribute }));
|
|
606
|
+
}
|
|
607
|
+
if (attribute.value instanceof WebGDPR) {
|
|
608
|
+
return (h(WebGdprAttribute, { attribute: attribute }));
|
|
609
|
+
}
|
|
610
|
+
if (attribute.value instanceof InsuranceValue) {
|
|
611
|
+
return (h(InsuranceValueAttribute, { attribute: attribute }));
|
|
612
|
+
}
|
|
613
|
+
if (attribute.value instanceof TypeRelationship) {
|
|
614
|
+
return (h(TypeRelationshipAttribute, { attribute: attribute }));
|
|
615
|
+
}
|
|
616
|
+
if (attribute.value instanceof ValuationRanking) {
|
|
617
|
+
return (h(ValuationRankingAttribute, { attribute: attribute }));
|
|
618
|
+
}
|
|
619
|
+
if (attribute.value instanceof UnstructuredName) {
|
|
620
|
+
return (h(UnstructuredNameAttribute, { attribute: attribute }));
|
|
621
|
+
}
|
|
622
|
+
if (attribute.value instanceof ChallengePassword) {
|
|
623
|
+
return (h(ChallengePasswordAttribute, { attribute: attribute }));
|
|
624
|
+
}
|
|
625
|
+
if (typeof attribute.value === 'string') {
|
|
626
|
+
return (h(AsStringAttribute, { attribute: attribute }));
|
|
627
|
+
}
|
|
628
|
+
return (h(BasicAttribute, { attribute: attribute }));
|
|
629
|
+
}
|
|
630
|
+
catch (error) {
|
|
631
|
+
console.error('Error render attribute:', attribute.asn.type);
|
|
590
632
|
return null;
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
attributes.map((attribute) => {
|
|
595
|
-
try {
|
|
596
|
-
if (attribute.value instanceof Name$1) {
|
|
597
|
-
return (h(NameAttribute, { attribute: attribute }));
|
|
598
|
-
}
|
|
599
|
-
if (attribute.value instanceof ActivityDescription) {
|
|
600
|
-
return (h(ActivityDescriptionAttribute, { attribute: attribute }));
|
|
601
|
-
}
|
|
602
|
-
if (attribute.value instanceof WebGDPR) {
|
|
603
|
-
return (h(WebGdprAttribute, { attribute: attribute }));
|
|
604
|
-
}
|
|
605
|
-
if (attribute.value instanceof InsuranceValue) {
|
|
606
|
-
return (h(InsuranceValueAttribute, { attribute: attribute }));
|
|
607
|
-
}
|
|
608
|
-
if (attribute.value instanceof TypeRelationship) {
|
|
609
|
-
return (h(TypeRelationshipAttribute, { attribute: attribute }));
|
|
610
|
-
}
|
|
611
|
-
if (attribute.value instanceof ValuationRanking) {
|
|
612
|
-
return (h(ValuationRankingAttribute, { attribute: attribute }));
|
|
613
|
-
}
|
|
614
|
-
if (attribute.value instanceof UnstructuredName) {
|
|
615
|
-
return (h(UnstructuredNameAttribute, { attribute: attribute }));
|
|
616
|
-
}
|
|
617
|
-
if (attribute.value instanceof ChallengePassword) {
|
|
618
|
-
return (h(ChallengePasswordAttribute, { attribute: attribute }));
|
|
619
|
-
}
|
|
620
|
-
if (typeof attribute.value === 'string') {
|
|
621
|
-
return (h(AsStringAttribute, { attribute: attribute }));
|
|
622
|
-
}
|
|
623
|
-
return (h(BasicAttribute, { attribute: attribute }));
|
|
624
|
-
}
|
|
625
|
-
catch (error) {
|
|
626
|
-
console.error('Error render attribute:', attribute.asn.type);
|
|
627
|
-
return null;
|
|
628
|
-
}
|
|
629
|
-
}),
|
|
630
|
-
]);
|
|
633
|
+
}
|
|
634
|
+
}),
|
|
635
|
+
]);
|
|
631
636
|
};
|
|
632
637
|
|
|
633
638
|
/**
|
|
@@ -638,18 +643,18 @@ const Attributes = (props) => {
|
|
|
638
643
|
* LICENSE file in the root directory of this source tree.
|
|
639
644
|
*/
|
|
640
645
|
const Thumbprints = (props) => {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
646
|
+
const { thumbprints } = props;
|
|
647
|
+
if (!thumbprints) {
|
|
648
|
+
return null;
|
|
649
|
+
}
|
|
650
|
+
const keys = Object.keys(thumbprints);
|
|
651
|
+
if (!keys.length) {
|
|
652
|
+
return null;
|
|
653
|
+
}
|
|
654
|
+
return [
|
|
655
|
+
h(RowTitle, { value: l10n.getString('fingerprints') }),
|
|
656
|
+
keys.map((name) => (h(RowValue, { name: name, value: thumbprints[name], monospace: true }))),
|
|
657
|
+
];
|
|
653
658
|
};
|
|
654
659
|
|
|
655
660
|
/**
|
|
@@ -660,15 +665,15 @@ const Thumbprints = (props) => {
|
|
|
660
665
|
* LICENSE file in the root directory of this source tree.
|
|
661
666
|
*/
|
|
662
667
|
const BasicExtension = (props, children) => {
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
668
|
+
const { extension } = props;
|
|
669
|
+
return ([
|
|
670
|
+
h(RowValue, { name: "Name", value: getStringByOID(extension.asn.extnID) }),
|
|
671
|
+
h(RowValue, { name: "Critical", value: extension.asn.critical ? 'YES' : 'NO' }),
|
|
672
|
+
children,
|
|
673
|
+
h("tr", null,
|
|
674
|
+
h("td", { colSpan: 2, class: "divider" },
|
|
675
|
+
h("span", { class: "bg_fill" }))),
|
|
676
|
+
]);
|
|
672
677
|
};
|
|
673
678
|
|
|
674
679
|
/**
|
|
@@ -679,9 +684,9 @@ const BasicExtension = (props, children) => {
|
|
|
679
684
|
* LICENSE file in the root directory of this source tree.
|
|
680
685
|
*/
|
|
681
686
|
const KeyUsageExtension = (props) => {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
687
|
+
const { extension } = props;
|
|
688
|
+
return (h(BasicExtension, { extension: extension },
|
|
689
|
+
h(RowValue, { name: "Usage", value: extension.value.toJSON().join(', ') })));
|
|
685
690
|
};
|
|
686
691
|
|
|
687
692
|
/**
|
|
@@ -692,10 +697,10 @@ const KeyUsageExtension = (props) => {
|
|
|
692
697
|
* LICENSE file in the root directory of this source tree.
|
|
693
698
|
*/
|
|
694
699
|
const BasicConstraintsExtension = (props) => {
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
700
|
+
const { extension } = props;
|
|
701
|
+
return (h(BasicExtension, { extension: extension },
|
|
702
|
+
h(RowValue, { name: "Certificate Authority", value: extension.value.cA ? 'YES' : 'NO' }),
|
|
703
|
+
h(RowValue, { name: "Path Length Constraint", value: extension.value.pathLenConstraint })));
|
|
699
704
|
};
|
|
700
705
|
|
|
701
706
|
/**
|
|
@@ -706,8 +711,8 @@ const BasicConstraintsExtension = (props) => {
|
|
|
706
711
|
* LICENSE file in the root directory of this source tree.
|
|
707
712
|
*/
|
|
708
713
|
const ExtendedKeyUsageExtension = (props) => {
|
|
709
|
-
|
|
710
|
-
|
|
714
|
+
const { extension } = props;
|
|
715
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((usage, arrayIndex) => (h(RowValue, { name: `Purpose #${arrayIndex + 1}`, value: getStringByOID(usage) })))));
|
|
711
716
|
};
|
|
712
717
|
|
|
713
718
|
/**
|
|
@@ -718,21 +723,21 @@ const ExtendedKeyUsageExtension = (props) => {
|
|
|
718
723
|
* LICENSE file in the root directory of this source tree.
|
|
719
724
|
*/
|
|
720
725
|
const SubjectKeyIdentifierExtension = (props) => {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
726
|
+
const { extension, getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink } = props;
|
|
727
|
+
const keyId = build.Convert.ToHex(extension.value.buffer);
|
|
728
|
+
const childrenLink = getSubjectKeyIdChildrenLink(keyId);
|
|
729
|
+
const siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
|
|
730
|
+
return (h(BasicExtension, { extension: extension },
|
|
731
|
+
h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
|
|
732
|
+
childrenLink && (h("span", null,
|
|
733
|
+
"\u00A0[",
|
|
734
|
+
h("peculiar-link", { href: childrenLink }, "children"),
|
|
735
|
+
"]")),
|
|
736
|
+
siblingsLink && (h("span", null,
|
|
737
|
+
"\u00A0[",
|
|
738
|
+
h("peculiar-link", { href: siblingsLink }, "siblings"),
|
|
739
|
+
"]")),
|
|
740
|
+
] })));
|
|
736
741
|
};
|
|
737
742
|
|
|
738
743
|
/**
|
|
@@ -743,21 +748,21 @@ const SubjectKeyIdentifierExtension = (props) => {
|
|
|
743
748
|
* LICENSE file in the root directory of this source tree.
|
|
744
749
|
*/
|
|
745
750
|
const AuthorityKeyIdentifierExtension = (props) => {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
751
|
+
const { extension, getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink } = props;
|
|
752
|
+
const keyId = build.Convert.ToHex(extension.value.keyIdentifier.buffer);
|
|
753
|
+
const parentLink = getAuthKeyIdParentLink(keyId);
|
|
754
|
+
const siblingsLink = getAuthKeyIdSiblingsLink(keyId);
|
|
755
|
+
return (h(BasicExtension, { extension: extension },
|
|
756
|
+
h(RowValue, { name: "Key ID", value: keyId, monospace: true, extraValue: [
|
|
757
|
+
parentLink && (h("span", null,
|
|
758
|
+
"\u00A0[",
|
|
759
|
+
h("peculiar-link", { href: parentLink }, "parents"),
|
|
760
|
+
"]")),
|
|
761
|
+
siblingsLink && (h("span", null,
|
|
762
|
+
"\u00A0[",
|
|
763
|
+
h("peculiar-link", { href: siblingsLink }, "siblings"),
|
|
764
|
+
"]")),
|
|
765
|
+
] })));
|
|
761
766
|
};
|
|
762
767
|
|
|
763
768
|
/**
|
|
@@ -768,14 +773,14 @@ const AuthorityKeyIdentifierExtension = (props) => {
|
|
|
768
773
|
* LICENSE file in the root directory of this source tree.
|
|
769
774
|
*/
|
|
770
775
|
const CRLDistributionPointsExtension = (props) => {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
const { extension } = props;
|
|
777
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((point) => {
|
|
778
|
+
var _a, _b;
|
|
779
|
+
return ([
|
|
780
|
+
(_a = point.distributionPoint) === null || _a === void 0 ? void 0 : _a.fullName.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
|
|
781
|
+
(_b = point.cRLIssuer) === null || _b === void 0 ? void 0 : _b.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props)))),
|
|
782
|
+
]);
|
|
783
|
+
})));
|
|
779
784
|
};
|
|
780
785
|
|
|
781
786
|
/**
|
|
@@ -786,12 +791,12 @@ const CRLDistributionPointsExtension = (props) => {
|
|
|
786
791
|
* LICENSE file in the root directory of this source tree.
|
|
787
792
|
*/
|
|
788
793
|
const InfoAccessSyntaxExtension = (props) => {
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
794
|
+
const { extension } = props;
|
|
795
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((description, arrayIndex) => ([
|
|
796
|
+
h(RowValue, { name: `Description #${arrayIndex + 1}`, value: "" }),
|
|
797
|
+
h(RowValue, { name: "Method", value: getStringByOID(description.accessMethod) }),
|
|
798
|
+
h(GeneralNamePart, Object.assign({ generalName: description.accessLocation }, props)),
|
|
799
|
+
]))));
|
|
795
800
|
};
|
|
796
801
|
|
|
797
802
|
/**
|
|
@@ -802,8 +807,8 @@ const InfoAccessSyntaxExtension = (props) => {
|
|
|
802
807
|
* LICENSE file in the root directory of this source tree.
|
|
803
808
|
*/
|
|
804
809
|
const SubjectAlternativeNameExtension = (props) => {
|
|
805
|
-
|
|
806
|
-
|
|
810
|
+
const { extension } = props;
|
|
811
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((gn) => (h(GeneralNamePart, Object.assign({ generalName: gn }, props))))));
|
|
807
812
|
};
|
|
808
813
|
|
|
809
814
|
/**
|
|
@@ -814,31 +819,31 @@ const SubjectAlternativeNameExtension = (props) => {
|
|
|
814
819
|
* LICENSE file in the root directory of this source tree.
|
|
815
820
|
*/
|
|
816
821
|
const CertificatePoliciesExtension = (props) => {
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
822
|
+
const { extension } = props;
|
|
823
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => {
|
|
824
|
+
var _a;
|
|
825
|
+
return ([
|
|
826
|
+
h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
|
|
827
|
+
h(RowValue, { name: "ID", value: getStringByOID(policy.policyIdentifier) }),
|
|
828
|
+
(_a = policy.policyQualifiers) === null || _a === void 0 ? void 0 : _a.map((qualifierInfo, indexInfo) => {
|
|
829
|
+
const data = [
|
|
830
|
+
h(RowValue, { name: `Qualifier #${arrayIndex + 1}.${indexInfo + 1}`, value: "" }),
|
|
831
|
+
h(RowValue, { name: "ID", value: getStringByOID(qualifierInfo.policyQualifierId) }),
|
|
832
|
+
];
|
|
833
|
+
if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.1') {
|
|
834
|
+
const value = AsnParser.parse(qualifierInfo.qualifier, DisplayText);
|
|
835
|
+
data.push(h(RowValue, { name: "Value", value: value.toString() }));
|
|
836
|
+
}
|
|
837
|
+
if (qualifierInfo.policyQualifierId === '1.3.6.1.5.5.7.2.2') {
|
|
838
|
+
const value = AsnParser.parse(qualifierInfo.qualifier, UserNotice);
|
|
839
|
+
if (value.explicitText) {
|
|
840
|
+
data.push(h(RowValue, { name: "Value", value: value.explicitText.toString() }));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
return data;
|
|
844
|
+
}),
|
|
845
|
+
]);
|
|
846
|
+
})));
|
|
842
847
|
};
|
|
843
848
|
|
|
844
849
|
/**
|
|
@@ -849,82 +854,82 @@ const CertificatePoliciesExtension = (props) => {
|
|
|
849
854
|
* LICENSE file in the root directory of this source tree.
|
|
850
855
|
*/
|
|
851
856
|
const logs = {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
857
|
+
'9606c02c690033aa1d145f59c6e2648d0549f0df96aab8db915a70d8ecf390a5': 'Akamai CT',
|
|
858
|
+
'39376f545f7b4607f59742d768cd5d2437bf3473b6534a4834bcf72e681c83c9': 'Alpha CT',
|
|
859
|
+
a577ac9ced7548dd8f025b67a241089df86e0f476ec203c2ecbedb185f282638: 'CNNIC CT',
|
|
860
|
+
cdb5179b7fc1c046feea31136a3f8f002e6182faf8896fecc8b2f5b5ab604900: 'Certly.IO',
|
|
861
|
+
'1fbc36e002ede97f40199e86b3573b8a4217d80187746ad0da03a06054d20df4': 'Cloudflare “Nimbus2017”',
|
|
862
|
+
db74afeecb29ecb1feca3e716d2ce5b9aabb36f7847183c75d9d4f37b61fbf64: 'Cloudflare “Nimbus2018”',
|
|
863
|
+
'747eda8331ad331091219cce254f4270c2bffd5e422008c6373579e6107bcc56': 'Cloudflare “Nimbus2019”',
|
|
864
|
+
'5ea773f9df56c0e7b536487dd049e0327a919a0c84a112128418759681714558': 'Cloudflare “Nimbus2020”',
|
|
865
|
+
'4494652eb0eeceafc44007d8a8fe28c0dae682bed8cb31b53fd33396b5b681a8': 'Cloudflare “Nimbus2021”',
|
|
866
|
+
'41c8cab1df22464a10c6a13a0942875e4e318b1b03ebeb4bc768f090629606f6': 'Cloudflare “Nimbus2022”',
|
|
867
|
+
'7a328c54d8b72db620ea38e0521ee98416703213854d3bd22bc13a57a352eb52': 'Cloudflare “Nimbus2023”',
|
|
868
|
+
'6ff141b5647e4222f7ef052cefae7c21fd608e27d2af5a6e9f4b8a37d6633ee5': 'DigiCert Nessie2018',
|
|
869
|
+
fe446108b1d01ab78a62ccfeab6ab2b2babff3abdad80a4d8b30df2d0008830c: 'DigiCert Nessie2019',
|
|
870
|
+
c652a0ec48ceb3fcab170992c43a87413309e80065a26252401ba3362a17c565: 'DigiCert Nessie2020',
|
|
871
|
+
eec095ee8d72640f92e3c3b91bc712a3696a097b4b6a1a1438e647b2cbedc5f9: 'DigiCert Nessie2021',
|
|
872
|
+
'51a3b0f5fd01799c566db837788f0ca47acc1b27cbf79e88429a0dfed48b05e5': 'DigiCert Nessie2022',
|
|
873
|
+
b3737707e18450f86386d605a9dc11094a792db1670c0b87dcf0030e7936a59a: 'DigiCert Nessie2023',
|
|
874
|
+
'5614069a2fd7c2ecd3f5e1bd44b23ec74676b9bc99115cc0ef949855d689d0dd': 'DigiCert Server',
|
|
875
|
+
'8775bfe7597cf88c43995fbdf36eff568d475636ff4ab560c1b4eaff5ea0830f': 'DigiCert Server 2',
|
|
876
|
+
c1164ae0a772d2d4392dc80ac10770d4f0c49bde991a4840c1fa075164f63360: 'DigiCert Yeti2018',
|
|
877
|
+
e2694bae26e8e94009e8861bb63b83d43ee7fe7488fba48f2893019dddf1dbfe: 'DigiCert Yeti2019',
|
|
878
|
+
f095a459f200d18240102d2f93888ead4bfe1d47e399e1d034a6b0a8aa8eb273: 'DigiCert Yeti2020',
|
|
879
|
+
'5cdc4392fee6ab4544b15e9ad456e61037fbd5fa47dca17394b25ee6f6c70eca': 'DigiCert Yeti2021',
|
|
880
|
+
'2245450759552456963fa12ff1f76d86e0232663adc04b7f5dc6835c6ee20f02': 'DigiCert Yeti2022',
|
|
881
|
+
'35cf191bbfb16c57bf0fad4c6d42cbbbb627202651ea3fe12aefa803c33bd64c': 'DigiCert Yeti2023',
|
|
882
|
+
'717ea7420975be84a2723553f1777c26dd51af4e102144094d9019b462fb6668': 'GDCA 1',
|
|
883
|
+
'14308d90ccd030135005c01ca526d81e84e87624e39b6248e08f724aea3bb42a': 'GDCA 2',
|
|
884
|
+
c9cf890a21109c666cc17a3ed065c930d0e0135a9feba85af14210b8072421aa: 'GDCA CT #1',
|
|
885
|
+
'924a30f909336ff435d6993a10ac75a2c641728e7fc2d659ae6188ffad40ce01': 'GDCA CT #2',
|
|
886
|
+
fad4c97cc49ee2f8ac85c5ea5cea09d0220dbbf4e49c6b50662ff868f86b8c28: 'Google “Argon2017”',
|
|
887
|
+
a4501269055a15545e6211ab37bc103f62ae5576a45e4b1714453e1b22106a25: 'Google “Argon2018”',
|
|
888
|
+
'63f2dbcde83bcc2ccf0b728427576b33a48d61778fbd75a638b1c768544bd88d': 'Google “Argon2019”',
|
|
889
|
+
b21e05cc8ba2cd8a204e8766f92bb98a2520676bdafa70e7b249532def8b905e: 'Google “Argon2020”',
|
|
890
|
+
f65c942fd1773022145418083094568ee34d131933bfdf0c2f200bcc4ef164e3: 'Google “Argon2021”',
|
|
891
|
+
'2979bef09e393921f056739f63a577e5be577d9c600af8f94d5d265c255dc784': 'Google “Argon2022”',
|
|
892
|
+
'68f698f81f6482be3a8ceeb9281d4cfc71515d6793d444d10a67acbb4f4ffbc4': 'Google “Aviator”',
|
|
893
|
+
c3bf03a7e1ca8841c607bae3ff4270fca5ec45b186ebbe4e2cf3fc778630f5f6: 'Google “Crucible”',
|
|
894
|
+
'1d024b8eb1498b344dfd87ea3efc0996f7506f235d1d497061a4773c439c25fb': 'Google “Daedalus”',
|
|
895
|
+
'293c519654c83965baaa50fc5807d4b76fbf587a2972dca4c30cf4e54547f478': 'Google “Icarus”',
|
|
896
|
+
a4b90990b418581487bb13a2cc67700a3c359804f91bdfb8e377cd0ec80ddc10: 'Google “Pilot”',
|
|
897
|
+
ee4bbdb775ce60bae142691fabe19e66a30f7e5fb072d88300c47b897aa8fdcb: 'Google “Rocketeer”',
|
|
898
|
+
bbd9dfbc1f8a71b593942397aa927b473857950aab52e81a909664368e1ed185: 'Google “Skydiver”',
|
|
899
|
+
'52eb4b225ec896974850675f23e43bc1d021e3214ce52ecd5fa87c203cdfca03': 'Google “Solera2018”',
|
|
900
|
+
'0b760e9a8b9a682f88985b15e947501a56446bba8830785c3842994386450c00': 'Google “Solera2019”',
|
|
901
|
+
'1fc72ce5a1b799f400c359bff96ca3913548e8644220610952e9ba1774f7bac7': 'Google “Solera2020”',
|
|
902
|
+
a3c99845e80ab7ce00157b3742df0207dd272b2b602ecf98ee2c12db9c5ae7e7: 'Google “Solera2021”',
|
|
903
|
+
'697aafca1a6b536fae21205046debad7e0eaea13d2432e6e9d8fb379f2b9aaf3': 'Google “Solera2022”',
|
|
904
|
+
a899d8780c9290aaf462f31880ccfbd52451e970d0fbf591ef75b0d99b645681: 'Google “Submariner”',
|
|
905
|
+
b0cc83e5a5f97d6baf7c09cc284904872ac7e88b132c6350b7c6fd26e16c6c77: 'Google “Testtube”',
|
|
906
|
+
b10cd559a6d67846811f7df9a51532739ac48d703bea0323da5d38755bc0ad4e: 'Google “Xenon2018”',
|
|
907
|
+
'084114980071532c16190460bcfc47fdc2653afa292c72b37ff863ae29ccc9f0': 'Google “Xenon2019”',
|
|
908
|
+
'07b75c1be57d68fff1b0c61d2315c7bae6577c5794b76aeebc613a1a69d3a21c': 'Google “Xenon2020”',
|
|
909
|
+
'7d3ef2f88fff88556824c2c0ca9e5289792bc50e78097f2e6a9768997e22f0d7': 'Google “Xenon2021”',
|
|
910
|
+
'46a555eb75fa912030b5a28969f4f37d112c4174befd49b885abf2fc70fe6d47': 'Google “Xenon2022”',
|
|
911
|
+
'7461b4a09cfb3d41d75159575b2e7649a445a8d27709b0cc564a6482b7eb41a3': 'Izenpe',
|
|
912
|
+
'8941449c70742e06b9fc9ce7b116ba0024aa36d59af44f0204404f00f7ea8566': 'Izenpe “Argi”',
|
|
913
|
+
'296afa2d568bca0d2ea844956ae9721fc35fa355ecda99693aafd458a71aefdd': 'Let“s Encrypt ”Clicky”',
|
|
914
|
+
'537b69a3564335a9c04904e39593b2c298eb8d7a6e83023635c627248cd6b440': 'Nordu “flimsy”',
|
|
915
|
+
aae70b7f3cb8d566c86c2f16979c9f445f69ab0eb4535589b2f77a030104f3cd: 'Nordu “plausible”',
|
|
916
|
+
e0127629e90496564e3d0147984498aa48f8adb16600eb7902a1ef9909906273: 'PuChuangSiDa CT',
|
|
917
|
+
cf55e28923497c340d5206d05353aeb25834b52f1f8dc9526809f212efdd7ca6: 'SHECA CT 1',
|
|
918
|
+
'32dc59c2d4c41968d56e14bc61ac8f0e45db39faf3c155aa4252f5001fa0c623': 'SHECA CT 2',
|
|
919
|
+
db76fdadac65e7d09508886e2159bd8b90352f5fead3e3dc5e22eb350acc7b98: 'Sectigo (Comodo) “Dodo” CT',
|
|
920
|
+
'6f5376ac31f03119d89900a45115ff77151c11d902c10029068db2089a37d913': 'Sectigo (Comodo) “Mammoth” CT',
|
|
921
|
+
'5581d4c2169036014aea0b9b573c53f0c0e43878702508172fa3aa1d0713d30c': 'Sectigo (Comodo) “Sabre” CT',
|
|
922
|
+
'34bb6ad6c3df9c03eea8a499ff7891486c9d5e5cac92d01f7bfd1bce19db48ef': 'StartCom',
|
|
923
|
+
ddeb1d2b7a0d4fa6208b81ad8168707e2e8e9d01d55c888d3d11c4cdb6ecbecc: 'Symantec',
|
|
924
|
+
a7ce4a4e6207e0addee5fdaa4b1f86768767b5d002a55d47310e7e670a95eab2: 'Symantec Deneb',
|
|
925
|
+
'15970488d7b997a05beb52512adee8d2e8b4a3165264121a9fabfbd5f85ad93f': 'Symantec “Sirius”',
|
|
926
|
+
bc78e1dfc5f63c684649334da10fa15f0979692009c081b4f3f6917f3ed9b8a5: 'Symantec “Vega”',
|
|
927
|
+
b0b784bc81c0ddc47544e883f05985bb9077d134d8ab88b2b2e533980b8e508b: 'Up In The Air “Behind the Sofa”',
|
|
928
|
+
ac3b9aed7fa9674757159e6d7d575672f9d98100941e9bdeffeca1313b75782d: 'Venafi',
|
|
929
|
+
'03019df3fd85a69a8ebd1facc6da9ba73e469774fe77f579fc5a08b8328c1d6b': 'Venafi Gen2 CT',
|
|
930
|
+
'41b2dc2e89e63ce4af1ba7bb29bf68c6dee6f9f1cc047e30dffae3b3ba259263': 'WoSign',
|
|
931
|
+
'63d0006026dde10bb0601f452446965ee2b6ea2cd4fbc95ac866a550af9075b7': 'WoSign 2',
|
|
932
|
+
'9e4ff73dc3ce220b69217c899e468076abf8d78636d5ccfc85a31a75628ba88b': 'WoSign CT #1',
|
|
928
933
|
};
|
|
929
934
|
|
|
930
935
|
/**
|
|
@@ -935,16 +940,16 @@ const logs = {
|
|
|
935
940
|
* LICENSE file in the root directory of this source tree.
|
|
936
941
|
*/
|
|
937
942
|
const CertificateTransparencyExtension = (props) => {
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
943
|
+
const { extension } = props;
|
|
944
|
+
return (h(BasicExtension, { extension: extension }, extension.value.toJSON().map((signedCertificateTimestamp, arrayIndex) => ([
|
|
945
|
+
h(RowValue, { name: `SCT #${arrayIndex + 1}`, value: "" }),
|
|
946
|
+
h(RowValue, { name: "Version", value: signedCertificateTimestamp.version + 1 }),
|
|
947
|
+
h(RowValue, { name: "Log Operator", value: logs[signedCertificateTimestamp.logId] || signedCertificateTimestamp.logId }),
|
|
948
|
+
h(RowValue, { name: "Log Key ID", value: signedCertificateTimestamp.logId, monospace: true }),
|
|
949
|
+
h(RowValue, { name: "Timestamp", value: dateShort(signedCertificateTimestamp.timestamp) }),
|
|
950
|
+
h(RowValue, { name: "Signature Algorithm", value: `${signedCertificateTimestamp.hashAlgorithm} ${signedCertificateTimestamp.signatureAlgorithm}`.toUpperCase() }),
|
|
951
|
+
h(RowValue, { name: "Signature", value: signedCertificateTimestamp.signature, monospace: true }),
|
|
952
|
+
]))));
|
|
948
953
|
};
|
|
949
954
|
|
|
950
955
|
/**
|
|
@@ -955,11 +960,11 @@ const CertificateTransparencyExtension = (props) => {
|
|
|
955
960
|
* LICENSE file in the root directory of this source tree.
|
|
956
961
|
*/
|
|
957
962
|
const NameConstraintsExtension = (props) => {
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
+
var _a, _b;
|
|
964
|
+
const { extension } = props;
|
|
965
|
+
return (h(BasicExtension, { extension: extension }, (_a = extension.value.excludedSubtrees) === null || _a === void 0 ? void 0 :
|
|
966
|
+
_a.map((generalSubtree) => (h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props)))), (_b = extension.value.permittedSubtrees) === null || _b === void 0 ? void 0 :
|
|
967
|
+
_b.map((generalSubtree) => (h(GeneralNamePart, Object.assign({ generalName: generalSubtree.base }, props))))));
|
|
963
968
|
};
|
|
964
969
|
|
|
965
970
|
/**
|
|
@@ -970,11 +975,11 @@ const NameConstraintsExtension = (props) => {
|
|
|
970
975
|
* LICENSE file in the root directory of this source tree.
|
|
971
976
|
*/
|
|
972
977
|
const CertificateTemplateExtension = (props) => {
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
+
const { extension } = props;
|
|
979
|
+
return (h(BasicExtension, { extension: extension },
|
|
980
|
+
h(RowValue, { name: "Template ID", value: extension.value.templateID }),
|
|
981
|
+
h(RowValue, { name: "Template Major Version", value: extension.value.templateMajorVersion }),
|
|
982
|
+
h(RowValue, { name: "Template Minor Version", value: extension.value.templateMinorVersion })));
|
|
978
983
|
};
|
|
979
984
|
|
|
980
985
|
/**
|
|
@@ -985,9 +990,9 @@ const CertificateTemplateExtension = (props) => {
|
|
|
985
990
|
* LICENSE file in the root directory of this source tree.
|
|
986
991
|
*/
|
|
987
992
|
const EnrollCertTypeChoiceExtension = (props) => {
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
993
|
+
const { extension } = props;
|
|
994
|
+
return (h(BasicExtension, { extension: extension },
|
|
995
|
+
h(RowValue, { name: "Name", value: extension.value.toString() })));
|
|
991
996
|
};
|
|
992
997
|
|
|
993
998
|
/**
|
|
@@ -998,11 +1003,11 @@ const EnrollCertTypeChoiceExtension = (props) => {
|
|
|
998
1003
|
* LICENSE file in the root directory of this source tree.
|
|
999
1004
|
*/
|
|
1000
1005
|
const CaVersionExtension = (props) => {
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
+
const { extension } = props;
|
|
1007
|
+
const version = extension.value.getVersion();
|
|
1008
|
+
return (h(BasicExtension, { extension: extension },
|
|
1009
|
+
h(RowValue, { name: "Certificate Index", value: version.certificateIndex }),
|
|
1010
|
+
h(RowValue, { name: "Key Index", value: version.keyIndex })));
|
|
1006
1011
|
};
|
|
1007
1012
|
|
|
1008
1013
|
/**
|
|
@@ -1013,12 +1018,12 @@ const CaVersionExtension = (props) => {
|
|
|
1013
1018
|
* LICENSE file in the root directory of this source tree.
|
|
1014
1019
|
*/
|
|
1015
1020
|
const QCStatementsExtension = (props) => {
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1021
|
+
const { extension } = props;
|
|
1022
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((statement, arrayIndex) => ([
|
|
1023
|
+
h(RowValue, { name: `Statement #${arrayIndex + 1}`, value: "" }),
|
|
1024
|
+
h(RowValue, { name: "ID", value: getStringByOID(statement.statementId) }),
|
|
1025
|
+
h(RowValue, { name: "Info", value: statement.statementInfo.byteLength ? build.Convert.ToHex(statement.statementInfo) : null, monospace: true }),
|
|
1026
|
+
]))));
|
|
1022
1027
|
};
|
|
1023
1028
|
|
|
1024
1029
|
/**
|
|
@@ -1029,9 +1034,9 @@ const QCStatementsExtension = (props) => {
|
|
|
1029
1034
|
* LICENSE file in the root directory of this source tree.
|
|
1030
1035
|
*/
|
|
1031
1036
|
const NetscapeCommentExtension = (props) => {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1037
|
+
const { extension } = props;
|
|
1038
|
+
return (h(BasicExtension, { extension: extension },
|
|
1039
|
+
h(RowValue, { name: "Comment", value: extension.value.value })));
|
|
1035
1040
|
};
|
|
1036
1041
|
|
|
1037
1042
|
/**
|
|
@@ -1042,9 +1047,9 @@ const NetscapeCommentExtension = (props) => {
|
|
|
1042
1047
|
* LICENSE file in the root directory of this source tree.
|
|
1043
1048
|
*/
|
|
1044
1049
|
const NetscapeCertTypeExtension = (props) => {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1050
|
+
const { extension } = props;
|
|
1051
|
+
return (h(BasicExtension, { extension: extension },
|
|
1052
|
+
h(RowValue, { name: "Type", value: extension.value.toJSON().join(', ') })));
|
|
1048
1053
|
};
|
|
1049
1054
|
|
|
1050
1055
|
/**
|
|
@@ -1055,9 +1060,9 @@ const NetscapeCertTypeExtension = (props) => {
|
|
|
1055
1060
|
* LICENSE file in the root directory of this source tree.
|
|
1056
1061
|
*/
|
|
1057
1062
|
const LeiRoleExtension = (props) => {
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1063
|
+
const { extension } = props;
|
|
1064
|
+
return (h(BasicExtension, { extension: extension },
|
|
1065
|
+
h(RowValue, { name: "Role", value: extension.value.text })));
|
|
1061
1066
|
};
|
|
1062
1067
|
|
|
1063
1068
|
/**
|
|
@@ -1068,9 +1073,9 @@ const LeiRoleExtension = (props) => {
|
|
|
1068
1073
|
* LICENSE file in the root directory of this source tree.
|
|
1069
1074
|
*/
|
|
1070
1075
|
const LeiExtension = (props) => {
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1076
|
+
const { extension, getLEILink } = props;
|
|
1077
|
+
return (h(BasicExtension, { extension: extension },
|
|
1078
|
+
h(RowValue, { name: "Identifier", value: extension.value.text, href: getLEILink(extension.value.text) })));
|
|
1074
1079
|
};
|
|
1075
1080
|
|
|
1076
1081
|
/**
|
|
@@ -1081,11 +1086,11 @@ const LeiExtension = (props) => {
|
|
|
1081
1086
|
* LICENSE file in the root directory of this source tree.
|
|
1082
1087
|
*/
|
|
1083
1088
|
const TimestampExtension = (props) => {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
+
const { extension } = props;
|
|
1090
|
+
return (h(BasicExtension, { extension: extension },
|
|
1091
|
+
h(RowValue, { name: "Version", value: extension.value.version }),
|
|
1092
|
+
h(GeneralNamePart, Object.assign({ generalName: extension.value.location }, props)),
|
|
1093
|
+
h(RowValue, { name: "Requires Auth", value: extension.value.requiresAuth ? 'YES' : 'NO' })));
|
|
1089
1094
|
};
|
|
1090
1095
|
|
|
1091
1096
|
/**
|
|
@@ -1096,9 +1101,9 @@ const TimestampExtension = (props) => {
|
|
|
1096
1101
|
* LICENSE file in the root directory of this source tree.
|
|
1097
1102
|
*/
|
|
1098
1103
|
const ArchiveRevInfoExtension = (props) => {
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1104
|
+
const { extension } = props;
|
|
1105
|
+
return (h(BasicExtension, { extension: extension },
|
|
1106
|
+
h(RowValue, { name: "Version", value: extension.value.version })));
|
|
1102
1107
|
};
|
|
1103
1108
|
|
|
1104
1109
|
/**
|
|
@@ -1109,9 +1114,9 @@ const ArchiveRevInfoExtension = (props) => {
|
|
|
1109
1114
|
* LICENSE file in the root directory of this source tree.
|
|
1110
1115
|
*/
|
|
1111
1116
|
const CRLReasonExtension = (props) => {
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1117
|
+
const { extension } = props;
|
|
1118
|
+
return (h(BasicExtension, { extension: extension },
|
|
1119
|
+
h(RowValue, { name: "Reason", value: extension.value.toJSON() })));
|
|
1115
1120
|
};
|
|
1116
1121
|
|
|
1117
1122
|
/**
|
|
@@ -1122,7 +1127,7 @@ const CRLReasonExtension = (props) => {
|
|
|
1122
1127
|
* LICENSE file in the root directory of this source tree.
|
|
1123
1128
|
*/
|
|
1124
1129
|
function getAttributeValue(attribute) {
|
|
1125
|
-
|
|
1130
|
+
return build.Convert.ToString(attribute.values[0]);
|
|
1126
1131
|
}
|
|
1127
1132
|
|
|
1128
1133
|
/**
|
|
@@ -1133,12 +1138,12 @@ function getAttributeValue(attribute) {
|
|
|
1133
1138
|
* LICENSE file in the root directory of this source tree.
|
|
1134
1139
|
*/
|
|
1135
1140
|
const SubjectDirectoryAttributesExtension = (props) => {
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1141
|
+
const { extension } = props;
|
|
1142
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((attribute, arrayIndex) => ([
|
|
1143
|
+
h(RowValue, { name: `Attribute #${arrayIndex + 1}`, value: "" }),
|
|
1144
|
+
h(RowValue, { name: "Type", value: getStringByOID(attribute.type) }),
|
|
1145
|
+
h(RowValue, { name: "Value", value: getAttributeValue(attribute) }),
|
|
1146
|
+
]))));
|
|
1142
1147
|
};
|
|
1143
1148
|
|
|
1144
1149
|
/**
|
|
@@ -1149,9 +1154,9 @@ const SubjectDirectoryAttributesExtension = (props) => {
|
|
|
1149
1154
|
* LICENSE file in the root directory of this source tree.
|
|
1150
1155
|
*/
|
|
1151
1156
|
const AsStringExtension = (props) => {
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1157
|
+
const { extension } = props;
|
|
1158
|
+
return (h(BasicExtension, { extension: extension },
|
|
1159
|
+
h(RowValue, { name: "Value", value: extension.value, monospace: true })));
|
|
1155
1160
|
};
|
|
1156
1161
|
|
|
1157
1162
|
/**
|
|
@@ -1162,10 +1167,10 @@ const AsStringExtension = (props) => {
|
|
|
1162
1167
|
* LICENSE file in the root directory of this source tree.
|
|
1163
1168
|
*/
|
|
1164
1169
|
const PrivateKeyUsagePeriodExtension = (props) => {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1170
|
+
const { extension } = props;
|
|
1171
|
+
return (h(BasicExtension, { extension: extension },
|
|
1172
|
+
h(RowValue, { name: "Not Before", value: dateShort(extension.value.notBefore) }),
|
|
1173
|
+
h(RowValue, { name: "Not After", value: dateShort(extension.value.notAfter) })));
|
|
1169
1174
|
};
|
|
1170
1175
|
|
|
1171
1176
|
/**
|
|
@@ -1176,10 +1181,10 @@ const PrivateKeyUsagePeriodExtension = (props) => {
|
|
|
1176
1181
|
* LICENSE file in the root directory of this source tree.
|
|
1177
1182
|
*/
|
|
1178
1183
|
const EntrustVersionInfoExtension = (props) => {
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1184
|
+
const { extension } = props;
|
|
1185
|
+
return (h(BasicExtension, { extension: extension },
|
|
1186
|
+
h(RowValue, { name: "Version", value: extension.value.entrustVers }),
|
|
1187
|
+
h(RowValue, { name: "Info Flags", value: extension.value.entrustInfoFlags.toJSON().join(', ') })));
|
|
1183
1188
|
};
|
|
1184
1189
|
|
|
1185
1190
|
/**
|
|
@@ -1190,15 +1195,15 @@ const EntrustVersionInfoExtension = (props) => {
|
|
|
1190
1195
|
* LICENSE file in the root directory of this source tree.
|
|
1191
1196
|
*/
|
|
1192
1197
|
const BiometricSyntaxExtension = (props) => {
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1198
|
+
const { extension } = props;
|
|
1199
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((data, arrayIndex) => ([
|
|
1200
|
+
h(RowValue, { name: `Biometric #${arrayIndex + 1}`, value: "" }),
|
|
1201
|
+
h(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
|
|
1202
|
+
h(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
|
|
1203
|
+
h(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
|
|
1204
|
+
h(RowValue, { name: "Hash", value: build.Convert.ToHex(data.biometricDataHash.buffer), monospace: true }),
|
|
1205
|
+
h(RowValue, { name: "Source Uri", value: data.sourceDataUri }),
|
|
1206
|
+
]))));
|
|
1202
1207
|
};
|
|
1203
1208
|
|
|
1204
1209
|
/**
|
|
@@ -1209,52 +1214,52 @@ const BiometricSyntaxExtension = (props) => {
|
|
|
1209
1214
|
* LICENSE file in the root directory of this source tree.
|
|
1210
1215
|
*/
|
|
1211
1216
|
const LogotypeExtension = (props) => {
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1217
|
+
const { extension } = props;
|
|
1218
|
+
const renderImage = (image) => {
|
|
1219
|
+
if (!image) {
|
|
1220
|
+
return null;
|
|
1221
|
+
}
|
|
1222
|
+
return image.map((img) => {
|
|
1223
|
+
const { imageDetails } = img;
|
|
1224
|
+
return [
|
|
1225
|
+
h(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
|
|
1226
|
+
h(RowValue, { name: "Image Hash", value: build.Convert.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
1227
|
+
h(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
1228
|
+
h(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
1229
|
+
];
|
|
1230
|
+
});
|
|
1231
|
+
};
|
|
1232
|
+
const renderAudio = (audio) => {
|
|
1233
|
+
if (!audio) {
|
|
1234
|
+
return null;
|
|
1235
|
+
}
|
|
1236
|
+
return audio.map((aud) => {
|
|
1237
|
+
const { audioDetails } = aud;
|
|
1238
|
+
return [
|
|
1239
|
+
h(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
|
|
1240
|
+
h(RowValue, { name: "Audio Hash", value: build.Convert.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
1241
|
+
h(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
1242
|
+
h(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
1243
|
+
];
|
|
1244
|
+
});
|
|
1245
|
+
};
|
|
1246
|
+
const renderLogo = (title, info) => {
|
|
1247
|
+
if (!info || !info.direct) {
|
|
1248
|
+
return null;
|
|
1249
|
+
}
|
|
1250
|
+
const { image, audio } = info.direct;
|
|
1251
|
+
return [
|
|
1252
|
+
h(RowValue, { name: "Type", value: title }),
|
|
1253
|
+
renderImage(image),
|
|
1254
|
+
renderAudio(audio),
|
|
1255
|
+
h("tr", null,
|
|
1256
|
+
h("td", null),
|
|
1257
|
+
h("td", null)),
|
|
1258
|
+
];
|
|
1259
|
+
};
|
|
1260
|
+
return (h(BasicExtension, { extension: extension },
|
|
1261
|
+
renderLogo('Subject', extension.value.subjectLogo),
|
|
1262
|
+
renderLogo('Issuer', extension.value.issuerLogo)));
|
|
1258
1263
|
};
|
|
1259
1264
|
|
|
1260
1265
|
/**
|
|
@@ -1265,13 +1270,13 @@ const LogotypeExtension = (props) => {
|
|
|
1265
1270
|
* LICENSE file in the root directory of this source tree.
|
|
1266
1271
|
*/
|
|
1267
1272
|
const TNAuthListExtension = (props) => {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1273
|
+
const { extension } = props;
|
|
1274
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((entry, arrayIndex) => ([
|
|
1275
|
+
h(RowValue, { name: `Entry #${arrayIndex + 1}`, value: "" }),
|
|
1276
|
+
h(RowValue, { name: "SPC", value: entry.spc }),
|
|
1277
|
+
h(RowValue, { name: "Range", value: entry.range ? `start=${entry.range.start} count==${entry.range.count}` : null }),
|
|
1278
|
+
h(RowValue, { name: "One", value: entry.one }),
|
|
1279
|
+
]))));
|
|
1275
1280
|
};
|
|
1276
1281
|
|
|
1277
1282
|
/**
|
|
@@ -1282,10 +1287,10 @@ const TNAuthListExtension = (props) => {
|
|
|
1282
1287
|
* LICENSE file in the root directory of this source tree.
|
|
1283
1288
|
*/
|
|
1284
1289
|
const PolicyConstraintsExtension = (props) => {
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1290
|
+
const { extension } = props;
|
|
1291
|
+
return (h(BasicExtension, { extension: extension },
|
|
1292
|
+
extension.value.requireExplicitPolicy && (h(RowValue, { name: "Require Explicit Policy", value: AsnIntegerArrayBufferConverter.toASN(extension.value.requireExplicitPolicy).valueBlock.toString() })),
|
|
1293
|
+
extension.value.inhibitPolicyMapping && (h(RowValue, { name: "Inhibit Policy Mapping", value: AsnIntegerArrayBufferConverter.toASN(extension.value.inhibitPolicyMapping).valueBlock.toString() }))));
|
|
1289
1294
|
};
|
|
1290
1295
|
|
|
1291
1296
|
/**
|
|
@@ -1296,12 +1301,12 @@ const PolicyConstraintsExtension = (props) => {
|
|
|
1296
1301
|
* LICENSE file in the root directory of this source tree.
|
|
1297
1302
|
*/
|
|
1298
1303
|
const PolicyMappingsExtension = (props) => {
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1304
|
+
const { extension } = props;
|
|
1305
|
+
return (h(BasicExtension, { extension: extension }, extension.value.map((policy, arrayIndex) => ([
|
|
1306
|
+
h(RowValue, { name: `Policy #${arrayIndex + 1}`, value: "" }),
|
|
1307
|
+
h(RowValue, { name: "Issuer Domain", value: getStringByOID(policy.issuerDomainPolicy) }),
|
|
1308
|
+
h(RowValue, { name: "Subject Domain", value: getStringByOID(policy.subjectDomainPolicy) }),
|
|
1309
|
+
]))));
|
|
1305
1310
|
};
|
|
1306
1311
|
|
|
1307
1312
|
/**
|
|
@@ -1312,116 +1317,116 @@ const PolicyMappingsExtension = (props) => {
|
|
|
1312
1317
|
* LICENSE file in the root directory of this source tree.
|
|
1313
1318
|
*/
|
|
1314
1319
|
const Extensions = (props) => {
|
|
1315
|
-
|
|
1316
|
-
|
|
1320
|
+
const { extensions, title } = props;
|
|
1321
|
+
if (!extensions || !extensions.length) {
|
|
1322
|
+
return null;
|
|
1323
|
+
}
|
|
1324
|
+
return ([
|
|
1325
|
+
h(RowTitle, { value: title || 'Extensions' }),
|
|
1326
|
+
extensions.map((extension) => {
|
|
1327
|
+
try {
|
|
1328
|
+
if (extension.value instanceof KeyUsage) {
|
|
1329
|
+
return (h(KeyUsageExtension, { extension: extension }));
|
|
1330
|
+
}
|
|
1331
|
+
if (extension.value instanceof BasicConstraints) {
|
|
1332
|
+
return (h(BasicConstraintsExtension, { extension: extension }));
|
|
1333
|
+
}
|
|
1334
|
+
if (extension.value instanceof ExtendedKeyUsage) {
|
|
1335
|
+
return (h(ExtendedKeyUsageExtension, { extension: extension }));
|
|
1336
|
+
}
|
|
1337
|
+
if (extension.value instanceof SubjectKeyIdentifier) {
|
|
1338
|
+
return (h(SubjectKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
|
|
1339
|
+
}
|
|
1340
|
+
if (extension.value instanceof AuthorityKeyIdentifier) {
|
|
1341
|
+
return (h(AuthorityKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
|
|
1342
|
+
}
|
|
1343
|
+
if (extension.value instanceof CRLDistributionPoints) {
|
|
1344
|
+
return (h(CRLDistributionPointsExtension, Object.assign({ extension: extension }, props)));
|
|
1345
|
+
}
|
|
1346
|
+
if (extension.value instanceof AuthorityInfoAccessSyntax
|
|
1347
|
+
|| extension.value instanceof SubjectInfoAccessSyntax) {
|
|
1348
|
+
return (h(InfoAccessSyntaxExtension, Object.assign({ extension: extension }, props)));
|
|
1349
|
+
}
|
|
1350
|
+
if (extension.value instanceof SubjectAlternativeName) {
|
|
1351
|
+
return (h(SubjectAlternativeNameExtension, Object.assign({ extension: extension }, props)));
|
|
1352
|
+
}
|
|
1353
|
+
if (extension.value instanceof CertificatePolicies) {
|
|
1354
|
+
return (h(CertificatePoliciesExtension, { extension: extension }));
|
|
1355
|
+
}
|
|
1356
|
+
if (extension.value instanceof CertificateTransparency) {
|
|
1357
|
+
return (h(CertificateTransparencyExtension, { extension: extension }));
|
|
1358
|
+
}
|
|
1359
|
+
if (extension.value instanceof NameConstraints) {
|
|
1360
|
+
return (h(NameConstraintsExtension, Object.assign({ extension: extension }, props)));
|
|
1361
|
+
}
|
|
1362
|
+
if (extension.value instanceof CertificateTemplate) {
|
|
1363
|
+
return (h(CertificateTemplateExtension, { extension: extension }));
|
|
1364
|
+
}
|
|
1365
|
+
if (extension.value instanceof EnrollCertTypeChoice) {
|
|
1366
|
+
return (h(EnrollCertTypeChoiceExtension, { extension: extension }));
|
|
1367
|
+
}
|
|
1368
|
+
if (extension.value instanceof CaVersion) {
|
|
1369
|
+
return (h(CaVersionExtension, { extension: extension }));
|
|
1370
|
+
}
|
|
1371
|
+
if (extension.value instanceof QCStatements) {
|
|
1372
|
+
return (h(QCStatementsExtension, { extension: extension }));
|
|
1373
|
+
}
|
|
1374
|
+
if (extension.value instanceof NetscapeComment) {
|
|
1375
|
+
return (h(NetscapeCommentExtension, { extension: extension }));
|
|
1376
|
+
}
|
|
1377
|
+
if (extension.value instanceof NetscapeCertType) {
|
|
1378
|
+
return (h(NetscapeCertTypeExtension, { extension: extension }));
|
|
1379
|
+
}
|
|
1380
|
+
if (extension.value instanceof LeiRole) {
|
|
1381
|
+
return (h(LeiRoleExtension, { extension: extension }));
|
|
1382
|
+
}
|
|
1383
|
+
if (extension.value instanceof LeiChoice) {
|
|
1384
|
+
return (h(LeiExtension, Object.assign({ extension: extension }, props)));
|
|
1385
|
+
}
|
|
1386
|
+
if (extension.value instanceof Timestamp) {
|
|
1387
|
+
return (h(TimestampExtension, Object.assign({ extension: extension }, props)));
|
|
1388
|
+
}
|
|
1389
|
+
if (extension.value instanceof ArchiveRevInfo) {
|
|
1390
|
+
return (h(ArchiveRevInfoExtension, { extension: extension }));
|
|
1391
|
+
}
|
|
1392
|
+
if (extension.value instanceof CRLReason) {
|
|
1393
|
+
return (h(CRLReasonExtension, { extension: extension }));
|
|
1394
|
+
}
|
|
1395
|
+
if (extension.value instanceof SubjectDirectoryAttributes) {
|
|
1396
|
+
return (h(SubjectDirectoryAttributesExtension, { extension: extension }));
|
|
1397
|
+
}
|
|
1398
|
+
if (extension.value instanceof PrivateKeyUsagePeriod) {
|
|
1399
|
+
return (h(PrivateKeyUsagePeriodExtension, { extension: extension }));
|
|
1400
|
+
}
|
|
1401
|
+
if (extension.value instanceof EntrustVersionInfo) {
|
|
1402
|
+
return (h(EntrustVersionInfoExtension, { extension: extension }));
|
|
1403
|
+
}
|
|
1404
|
+
if (extension.value instanceof BiometricSyntax) {
|
|
1405
|
+
return (h(BiometricSyntaxExtension, { extension: extension }));
|
|
1406
|
+
}
|
|
1407
|
+
if (extension.value instanceof LogotypeExtn) {
|
|
1408
|
+
return (h(LogotypeExtension, { extension: extension }));
|
|
1409
|
+
}
|
|
1410
|
+
if (extension.value instanceof TNAuthorizationList) {
|
|
1411
|
+
return (h(TNAuthListExtension, { extension: extension }));
|
|
1412
|
+
}
|
|
1413
|
+
if (extension.value instanceof PolicyConstraints) {
|
|
1414
|
+
return (h(PolicyConstraintsExtension, { extension: extension }));
|
|
1415
|
+
}
|
|
1416
|
+
if (extension.value instanceof PolicyMappings) {
|
|
1417
|
+
return (h(PolicyMappingsExtension, { extension: extension }));
|
|
1418
|
+
}
|
|
1419
|
+
if (typeof extension.value === 'string') {
|
|
1420
|
+
return (h(AsStringExtension, { extension: extension }));
|
|
1421
|
+
}
|
|
1422
|
+
return (h(BasicExtension, { extension: extension }));
|
|
1423
|
+
}
|
|
1424
|
+
catch (error) {
|
|
1425
|
+
console.error('Error render extension:', extension.asn.extnID);
|
|
1317
1426
|
return null;
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
extensions.map((extension) => {
|
|
1322
|
-
try {
|
|
1323
|
-
if (extension.value instanceof KeyUsage) {
|
|
1324
|
-
return (h(KeyUsageExtension, { extension: extension }));
|
|
1325
|
-
}
|
|
1326
|
-
if (extension.value instanceof BasicConstraints) {
|
|
1327
|
-
return (h(BasicConstraintsExtension, { extension: extension }));
|
|
1328
|
-
}
|
|
1329
|
-
if (extension.value instanceof ExtendedKeyUsage) {
|
|
1330
|
-
return (h(ExtendedKeyUsageExtension, { extension: extension }));
|
|
1331
|
-
}
|
|
1332
|
-
if (extension.value instanceof SubjectKeyIdentifier) {
|
|
1333
|
-
return (h(SubjectKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
|
|
1334
|
-
}
|
|
1335
|
-
if (extension.value instanceof AuthorityKeyIdentifier) {
|
|
1336
|
-
return (h(AuthorityKeyIdentifierExtension, Object.assign({ extension: extension }, props)));
|
|
1337
|
-
}
|
|
1338
|
-
if (extension.value instanceof CRLDistributionPoints) {
|
|
1339
|
-
return (h(CRLDistributionPointsExtension, Object.assign({ extension: extension }, props)));
|
|
1340
|
-
}
|
|
1341
|
-
if (extension.value instanceof AuthorityInfoAccessSyntax
|
|
1342
|
-
|| extension.value instanceof SubjectInfoAccessSyntax) {
|
|
1343
|
-
return (h(InfoAccessSyntaxExtension, Object.assign({ extension: extension }, props)));
|
|
1344
|
-
}
|
|
1345
|
-
if (extension.value instanceof SubjectAlternativeName) {
|
|
1346
|
-
return (h(SubjectAlternativeNameExtension, Object.assign({ extension: extension }, props)));
|
|
1347
|
-
}
|
|
1348
|
-
if (extension.value instanceof CertificatePolicies) {
|
|
1349
|
-
return (h(CertificatePoliciesExtension, { extension: extension }));
|
|
1350
|
-
}
|
|
1351
|
-
if (extension.value instanceof CertificateTransparency) {
|
|
1352
|
-
return (h(CertificateTransparencyExtension, { extension: extension }));
|
|
1353
|
-
}
|
|
1354
|
-
if (extension.value instanceof NameConstraints) {
|
|
1355
|
-
return (h(NameConstraintsExtension, Object.assign({ extension: extension }, props)));
|
|
1356
|
-
}
|
|
1357
|
-
if (extension.value instanceof CertificateTemplate) {
|
|
1358
|
-
return (h(CertificateTemplateExtension, { extension: extension }));
|
|
1359
|
-
}
|
|
1360
|
-
if (extension.value instanceof EnrollCertTypeChoice) {
|
|
1361
|
-
return (h(EnrollCertTypeChoiceExtension, { extension: extension }));
|
|
1362
|
-
}
|
|
1363
|
-
if (extension.value instanceof CaVersion) {
|
|
1364
|
-
return (h(CaVersionExtension, { extension: extension }));
|
|
1365
|
-
}
|
|
1366
|
-
if (extension.value instanceof QCStatements) {
|
|
1367
|
-
return (h(QCStatementsExtension, { extension: extension }));
|
|
1368
|
-
}
|
|
1369
|
-
if (extension.value instanceof NetscapeComment) {
|
|
1370
|
-
return (h(NetscapeCommentExtension, { extension: extension }));
|
|
1371
|
-
}
|
|
1372
|
-
if (extension.value instanceof NetscapeCertType) {
|
|
1373
|
-
return (h(NetscapeCertTypeExtension, { extension: extension }));
|
|
1374
|
-
}
|
|
1375
|
-
if (extension.value instanceof LeiRole) {
|
|
1376
|
-
return (h(LeiRoleExtension, { extension: extension }));
|
|
1377
|
-
}
|
|
1378
|
-
if (extension.value instanceof LeiChoice) {
|
|
1379
|
-
return (h(LeiExtension, Object.assign({ extension: extension }, props)));
|
|
1380
|
-
}
|
|
1381
|
-
if (extension.value instanceof Timestamp) {
|
|
1382
|
-
return (h(TimestampExtension, Object.assign({ extension: extension }, props)));
|
|
1383
|
-
}
|
|
1384
|
-
if (extension.value instanceof ArchiveRevInfo) {
|
|
1385
|
-
return (h(ArchiveRevInfoExtension, { extension: extension }));
|
|
1386
|
-
}
|
|
1387
|
-
if (extension.value instanceof CRLReason) {
|
|
1388
|
-
return (h(CRLReasonExtension, { extension: extension }));
|
|
1389
|
-
}
|
|
1390
|
-
if (extension.value instanceof SubjectDirectoryAttributes) {
|
|
1391
|
-
return (h(SubjectDirectoryAttributesExtension, { extension: extension }));
|
|
1392
|
-
}
|
|
1393
|
-
if (extension.value instanceof PrivateKeyUsagePeriod) {
|
|
1394
|
-
return (h(PrivateKeyUsagePeriodExtension, { extension: extension }));
|
|
1395
|
-
}
|
|
1396
|
-
if (extension.value instanceof EntrustVersionInfo) {
|
|
1397
|
-
return (h(EntrustVersionInfoExtension, { extension: extension }));
|
|
1398
|
-
}
|
|
1399
|
-
if (extension.value instanceof BiometricSyntax) {
|
|
1400
|
-
return (h(BiometricSyntaxExtension, { extension: extension }));
|
|
1401
|
-
}
|
|
1402
|
-
if (extension.value instanceof LogotypeExtn) {
|
|
1403
|
-
return (h(LogotypeExtension, { extension: extension }));
|
|
1404
|
-
}
|
|
1405
|
-
if (extension.value instanceof TNAuthorizationList) {
|
|
1406
|
-
return (h(TNAuthListExtension, { extension: extension }));
|
|
1407
|
-
}
|
|
1408
|
-
if (extension.value instanceof PolicyConstraints) {
|
|
1409
|
-
return (h(PolicyConstraintsExtension, { extension: extension }));
|
|
1410
|
-
}
|
|
1411
|
-
if (extension.value instanceof PolicyMappings) {
|
|
1412
|
-
return (h(PolicyMappingsExtension, { extension: extension }));
|
|
1413
|
-
}
|
|
1414
|
-
if (typeof extension.value === 'string') {
|
|
1415
|
-
return (h(AsStringExtension, { extension: extension }));
|
|
1416
|
-
}
|
|
1417
|
-
return (h(BasicExtension, { extension: extension }));
|
|
1418
|
-
}
|
|
1419
|
-
catch (error) {
|
|
1420
|
-
console.error('Error render extension:', extension.asn.extnID);
|
|
1421
|
-
return null;
|
|
1422
|
-
}
|
|
1423
|
-
}),
|
|
1424
|
-
]);
|
|
1427
|
+
}
|
|
1428
|
+
}),
|
|
1429
|
+
]);
|
|
1425
1430
|
};
|
|
1426
1431
|
|
|
1427
1432
|
/**
|
|
@@ -1432,16 +1437,16 @@ const Extensions = (props) => {
|
|
|
1432
1437
|
* LICENSE file in the root directory of this source tree.
|
|
1433
1438
|
*/
|
|
1434
1439
|
const BasicInformation = (props) => {
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1440
|
+
const { serialNumber, version, validity, notBefore, notAfter, type, } = props;
|
|
1441
|
+
return [
|
|
1442
|
+
h(RowTitle, { value: l10n.getString('basicInformation') }),
|
|
1443
|
+
h(RowValue, { name: l10n.getString('type'), value: type }),
|
|
1444
|
+
h(RowValue, { name: l10n.getString('serialNumber'), value: serialNumber, monospace: true }),
|
|
1445
|
+
h(RowValue, { name: l10n.getString('version'), value: version }),
|
|
1446
|
+
h(RowValue, { name: l10n.getString('validity'), value: validity }),
|
|
1447
|
+
h(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
|
|
1448
|
+
h(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
|
|
1449
|
+
];
|
|
1445
1450
|
};
|
|
1446
1451
|
|
|
1447
1452
|
/**
|
|
@@ -1452,36 +1457,36 @@ const BasicInformation = (props) => {
|
|
|
1452
1457
|
* LICENSE file in the root directory of this source tree.
|
|
1453
1458
|
*/
|
|
1454
1459
|
function downloadCertificateAsPem(certificate) {
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1460
|
+
if (certificate instanceof CSR) {
|
|
1461
|
+
Download.pkcs10.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
|
|
1462
|
+
}
|
|
1463
|
+
else {
|
|
1464
|
+
Download.x509.asPEM(certificate.exportAsPemFormatted(), certificate.commonName);
|
|
1465
|
+
}
|
|
1461
1466
|
}
|
|
1462
1467
|
function downloadCertificateAsDer(certificate) {
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1468
|
+
if (certificate instanceof CSR) {
|
|
1469
|
+
Download.pkcs10.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
|
|
1470
|
+
}
|
|
1471
|
+
else {
|
|
1472
|
+
Download.x509.asDER(certificate.exportAsHexFormatted(), certificate.commonName);
|
|
1473
|
+
}
|
|
1469
1474
|
}
|
|
1470
1475
|
const Miscellaneous = (props) => {
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1476
|
+
const { certificate } = props;
|
|
1477
|
+
return [
|
|
1478
|
+
h(RowTitle, { value: l10n.getString('miscellaneous') }),
|
|
1479
|
+
h("tr", null,
|
|
1480
|
+
h("td", { class: "vertical_align_middle" },
|
|
1481
|
+
h("peculiar-typography", { color: "grey_5" },
|
|
1482
|
+
l10n.getString('download'),
|
|
1483
|
+
":")),
|
|
1484
|
+
h("td", null,
|
|
1485
|
+
h("peculiar-button-split", { onClick: downloadCertificateAsPem.bind(undefined, certificate), actions: [{
|
|
1486
|
+
text: l10n.getString('download.der'),
|
|
1487
|
+
onClick: downloadCertificateAsDer.bind(undefined, certificate),
|
|
1488
|
+
}] }, l10n.getString('download.pem')))),
|
|
1489
|
+
];
|
|
1485
1490
|
};
|
|
1486
1491
|
|
|
1487
1492
|
/**
|
|
@@ -1503,14 +1508,14 @@ const getIPAddressLink = (ipAddress) => `https://search.censys.io/search?resourc
|
|
|
1503
1508
|
* LICENSE file in the root directory of this source tree.
|
|
1504
1509
|
*/
|
|
1505
1510
|
const Issuer = (props) => {
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1511
|
+
const { issuer } = props;
|
|
1512
|
+
if (!issuer) {
|
|
1513
|
+
return null;
|
|
1514
|
+
}
|
|
1515
|
+
return [
|
|
1516
|
+
h(RowTitle, { value: l10n.getString('issuer') }),
|
|
1517
|
+
issuer.map((item) => (h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
|
|
1518
|
+
];
|
|
1514
1519
|
};
|
|
1515
1520
|
|
|
1516
1521
|
/**
|
|
@@ -1521,297 +1526,309 @@ const Issuer = (props) => {
|
|
|
1521
1526
|
* LICENSE file in the root directory of this source tree.
|
|
1522
1527
|
*/
|
|
1523
1528
|
const Holder = (props) => {
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1529
|
+
const { holder } = props;
|
|
1530
|
+
if (!holder) {
|
|
1531
|
+
return null;
|
|
1532
|
+
}
|
|
1533
|
+
const { baseCertificateID, objectDigestInfo } = holder;
|
|
1534
|
+
return [
|
|
1535
|
+
h(RowTitle, { value: l10n.getString('holder') }),
|
|
1536
|
+
baseCertificateID && ([
|
|
1537
|
+
baseCertificateID.issuer.map((item) => (h(GeneralNamePart, { generalName: item, getDNSNameLink: () => '', getIPAddressLink: () => '' }))),
|
|
1538
|
+
h("tr", null,
|
|
1539
|
+
h("td", null),
|
|
1540
|
+
h("td", null)),
|
|
1541
|
+
h(RowValue, { name: l10n.getString('serialNumber'), value: build.Convert.ToHex(baseCertificateID.serial), monospace: true }),
|
|
1542
|
+
h("tr", null,
|
|
1543
|
+
h("td", null),
|
|
1544
|
+
h("td", null)),
|
|
1545
|
+
]),
|
|
1546
|
+
objectDigestInfo && ([
|
|
1547
|
+
h(RowValue, { name: l10n.getString('digestInfo'), value: "" }),
|
|
1548
|
+
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(objectDigestInfo.digestAlgorithm.algorithm) }),
|
|
1549
|
+
h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(objectDigestInfo.objectDigest), monospace: true }),
|
|
1550
|
+
h(RowValue, { name: l10n.getString('type'), value: objectDigestInfo.digestedObjectType }),
|
|
1551
|
+
]),
|
|
1552
|
+
];
|
|
1548
1553
|
};
|
|
1549
1554
|
|
|
1550
|
-
const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
|
|
1555
|
+
const certificateViewerCss$2 = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
|
|
1551
1556
|
|
|
1552
1557
|
const AttributeCertificateViewer = class {
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1558
|
+
constructor(hostRef) {
|
|
1559
|
+
registerInstance(this, hostRef);
|
|
1560
|
+
this.isDecodeInProcess = true;
|
|
1561
|
+
this.getAuthKeyIdParentLink = (value) => {
|
|
1562
|
+
var _a;
|
|
1563
|
+
return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
1564
|
+
};
|
|
1565
|
+
this.getAuthKeyIdSiblingsLink = (value) => {
|
|
1566
|
+
var _a;
|
|
1567
|
+
return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
1568
|
+
};
|
|
1569
|
+
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
1570
|
+
var _a;
|
|
1571
|
+
return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
1572
|
+
};
|
|
1573
|
+
this.getSubjectKeyIdSiblingsLink = (value) => {
|
|
1574
|
+
var _a;
|
|
1575
|
+
return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
1576
|
+
};
|
|
1577
|
+
}
|
|
1578
|
+
componentWillLoad() {
|
|
1579
|
+
this.decodeCertificate(this.certificate);
|
|
1580
|
+
}
|
|
1581
|
+
async decodeCertificate(certificate) {
|
|
1582
|
+
this.isDecodeInProcess = true;
|
|
1583
|
+
try {
|
|
1584
|
+
if (certificate instanceof X509AttributeCertificate) {
|
|
1585
|
+
this.certificateDecoded = certificate;
|
|
1586
|
+
}
|
|
1587
|
+
else if (typeof certificate === 'string') {
|
|
1588
|
+
this.certificateDecoded = new X509AttributeCertificate(certificate);
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
return;
|
|
1592
|
+
}
|
|
1593
|
+
this.certificateDecoded.parseExtensions();
|
|
1594
|
+
this.certificateDecoded.parseAttributes();
|
|
1595
|
+
await this.certificateDecoded.getThumbprint('SHA-1');
|
|
1596
|
+
await this.certificateDecoded.getThumbprint('SHA-256');
|
|
1597
|
+
}
|
|
1598
|
+
catch (error) {
|
|
1599
|
+
this.certificateDecodeError = error;
|
|
1600
|
+
console.error('Error certificate parse:', error);
|
|
1601
|
+
}
|
|
1602
|
+
this.isDecodeInProcess = false;
|
|
1603
|
+
}
|
|
1604
|
+
/**
|
|
1605
|
+
* Rerun decodeCertificate if previuos value not equal current value
|
|
1606
|
+
*/
|
|
1607
|
+
watchCertificateAndDecode(newValue, oldValue) {
|
|
1608
|
+
if (typeof newValue === 'string' && typeof oldValue === 'string') {
|
|
1609
|
+
if (newValue !== oldValue) {
|
|
1610
|
+
this.decodeCertificate(newValue);
|
|
1611
|
+
}
|
|
1612
|
+
return;
|
|
1613
|
+
}
|
|
1614
|
+
if (newValue instanceof X509AttributeCertificate
|
|
1615
|
+
&& oldValue instanceof X509AttributeCertificate) {
|
|
1616
|
+
if (newValue.serialNumber !== oldValue.serialNumber) {
|
|
1617
|
+
this.decodeCertificate(newValue);
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1622
|
+
renderErrorState() {
|
|
1623
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this attribute certificate.")));
|
|
1624
|
+
}
|
|
1625
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1626
|
+
renderEmptyState() {
|
|
1627
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no attribute certificate available.")));
|
|
1628
|
+
}
|
|
1629
|
+
render() {
|
|
1630
|
+
if (this.certificateDecodeError) {
|
|
1631
|
+
return this.renderErrorState();
|
|
1632
|
+
}
|
|
1633
|
+
if (!this.certificateDecoded) {
|
|
1634
|
+
return this.renderEmptyState();
|
|
1635
|
+
}
|
|
1636
|
+
return (h(Host, null, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(Issuer, { issuer: this.certificateDecoded.issuer }), h(Holder, { holder: this.certificateDecoded.holder }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), 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 })))));
|
|
1637
|
+
}
|
|
1638
|
+
static get watchers() { return {
|
|
1639
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
1640
|
+
}; }
|
|
1641
|
+
};
|
|
1642
|
+
AttributeCertificateViewer.style = certificateViewerCss$2;
|
|
1626
1643
|
|
|
1627
1644
|
const buttonCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;width:auto;cursor:pointer;position:relative;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;--pv-button-padding-end:5px;--pv-button-padding-start:5px}.button{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);font-size:13px;font-size:var(--pv-font-size-b3);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;border-style:solid;border-width:1px;font-weight:400;text-decoration:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;vertical-align:middle;cursor:inherit;height:30px;line-height:30px;border-radius:2px;padding:0 5px;padding:0 var(--pv-button-padding-end) 0 var(--pv-button-padding-start)}.button::-moz-focus-inner{border:0}.button:focus{outline:none;-webkit-box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1);box-shadow:0 4px 10px 0 rgba(var(--pv-color-dark-rgb), 0.1)}.button[disabled]{opacity:0.5;cursor:not-allowed}.button_stroke{border-color:rgba(53, 132, 247, 0.3);border-color:rgba(var(--pv-color-primary-rgb), 0.3);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);background-color:transparent}.button_fill{border-color:#3584f7;border-color:rgba(var(--pv-color-primary-rgb), 1);background-color:#3584f7;background-color:rgba(var(--pv-color-primary-rgb), 1);color:white;color:rgba(var(--pv-color-light-rgb), 1)}.button_label{-webkit-transition:opacity 200ms;transition:opacity 200ms}.button:hover .button_label{opacity:0.7}";
|
|
1628
1645
|
|
|
1629
1646
|
const Button = class {
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1647
|
+
constructor(hostRef) {
|
|
1648
|
+
registerInstance(this, hostRef);
|
|
1649
|
+
this.fill = 'stroke';
|
|
1650
|
+
this.handleClick = (event) => {
|
|
1651
|
+
if (this.disabled) {
|
|
1652
|
+
event.preventDefault();
|
|
1653
|
+
event.stopPropagation();
|
|
1654
|
+
return;
|
|
1655
|
+
}
|
|
1656
|
+
if (this.onClick) {
|
|
1657
|
+
this.onClick(event);
|
|
1658
|
+
}
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
render() {
|
|
1662
|
+
const isLink = !!this.href;
|
|
1663
|
+
const TagType = isLink ? 'a' : 'button';
|
|
1664
|
+
return (h(TagType, { class: {
|
|
1665
|
+
button: true,
|
|
1666
|
+
button_stroke: this.fill === 'stroke',
|
|
1667
|
+
button_fill: this.fill === 'fill',
|
|
1668
|
+
button_disabled: this.disabled,
|
|
1669
|
+
}, disabled: this.disabled, type: !isLink && 'button', href: isLink && this.href, target: isLink && this.target ? this.target : null, rel: isLink && 'noreferrer noopener', onClick: this.handleClick, part: "base" }, h("span", { part: "label", class: "button_label" }, h("slot", null))));
|
|
1670
|
+
}
|
|
1654
1671
|
};
|
|
1655
1672
|
Button.style = buttonCss;
|
|
1656
1673
|
|
|
1657
1674
|
const buttonSplitCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:inline-block;vertical-align:top;position:relative;white-space:nowrap;font-size:0}.button_split_icon{width:7px;height:5px;display:inline-block;vertical-align:middle}.button_split_with_icon{width:25px;border-bottom-left-radius:0;border-top-left-radius:0}.button_split_with_icon.m_open::part(base):before{position:fixed;width:100%;height:100%;top:0;left:0;content:\"\"}.button_split_action{width:100%}.button_split_container{position:absolute;bottom:calc(100% + 1px);left:0;width:100%;border-radius:2px;-webkit-box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);box-shadow:0px -2px 1px rgb(var(--pv-color-light-rgb)), 0px 0px 10px rgba(var(--pv-color-dark-rgb), 0.0241168);z-index:1}.button_split>peculiar-button:first-of-type::part(base){border-top-right-radius:0;border-bottom-right-radius:0}.button_split>peculiar-button:last-of-type::part(base){border-top-left-radius:0;border-bottom-left-radius:0}.button_split>peculiar-button:not(:first-child){margin-left:-1px}";
|
|
1658
1675
|
|
|
1659
1676
|
const ButtonSplit = class {
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1677
|
+
constructor(hostRef) {
|
|
1678
|
+
registerInstance(this, hostRef);
|
|
1679
|
+
this.fill = 'stroke';
|
|
1680
|
+
this.actions = [];
|
|
1681
|
+
this.open = false;
|
|
1682
|
+
this.onClickSplitButton = (event) => {
|
|
1683
|
+
event.stopPropagation();
|
|
1684
|
+
this.open = !this.open;
|
|
1685
|
+
};
|
|
1686
|
+
}
|
|
1687
|
+
onClickActiveButton(action, event) {
|
|
1688
|
+
this.open = false;
|
|
1689
|
+
action(event);
|
|
1690
|
+
}
|
|
1691
|
+
renderActiveSplitState() {
|
|
1692
|
+
if (!this.open) {
|
|
1693
|
+
return null;
|
|
1694
|
+
}
|
|
1695
|
+
return (h("div", { class: "button_split_container" }, this.actions.map((action) => (h("peculiar-button", { fill: "fill", class: "button_split_action", onClick: this.onClickActiveButton.bind(this, action.onClick) }, action.text)))));
|
|
1696
|
+
}
|
|
1697
|
+
render() {
|
|
1698
|
+
return (h("div", { class: {
|
|
1699
|
+
button_split: true,
|
|
1700
|
+
} }, h("peculiar-button", { fill: this.fill, onClick: this.onClick }, h("slot", null)), h("peculiar-button", { fill: this.fill, onClick: this.onClickSplitButton, class: {
|
|
1701
|
+
button_split_with_icon: true,
|
|
1702
|
+
m_open: this.open,
|
|
1703
|
+
} }, h("svg", { viewBox: "0 0 7 5", xmlns: "http://www.w3.org/2000/svg", class: "button_split_icon" }, h("path", { fill: "currentColor", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z" }))), this.renderActiveSplitState()));
|
|
1704
|
+
}
|
|
1688
1705
|
};
|
|
1689
1706
|
ButtonSplit.style = buttonSplitCss;
|
|
1690
1707
|
|
|
1691
1708
|
const certificateDecoderCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block;width:100%;font-size:0}.textarea{min-height:300px;width:100%;border-radius:3px;border-width:1px;border-style:solid;padding:14px;font-family:monospace;resize:vertical;background-color:white;background-color:rgba(var(--pv-color-light-rgb), 1);border-color:#d1d5d9;border-color:rgba(var(--pv-color-grey_3-rgb), 1);color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);font-size:14px;font-size:var(--pv-font-size-h7)}.controls{margin-top:10px}.button{position:relative}.button:not(:first-child){margin-left:10px}.viewer{margin-top:64px}.input_file{opacity:0;width:100%;height:100%;top:0;left:0;display:block;position:absolute}";
|
|
1692
1709
|
|
|
1693
1710
|
const CertificateDecoder = class {
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
}
|
|
1715
|
-
element.value = '';
|
|
1716
|
-
}
|
|
1717
|
-
};
|
|
1718
|
-
this.onDropFile = async (e) => {
|
|
1719
|
-
e.stopPropagation();
|
|
1720
|
-
e.preventDefault();
|
|
1721
|
-
const element = e.dataTransfer;
|
|
1722
|
-
if (element.files) {
|
|
1723
|
-
const file = await readAsBinaryString(element.files[0]);
|
|
1724
|
-
if (typeof file.value === 'string') {
|
|
1725
|
-
this.decode(file.value);
|
|
1726
|
-
}
|
|
1727
|
-
}
|
|
1728
|
-
};
|
|
1729
|
-
}
|
|
1730
|
-
componentDidLoad() {
|
|
1731
|
-
const parsedHash = history.parseHash(window.location.search);
|
|
1732
|
-
if (parsedHash.cert) {
|
|
1733
|
-
/**
|
|
1734
|
-
* Prevent Stencil warning about re-render
|
|
1735
|
-
*/
|
|
1736
|
-
setTimeout(() => this.decode(parsedHash.cert), 100);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
clearValue() {
|
|
1740
|
-
this.inputPaste.value = '';
|
|
1741
|
-
this.certificateDecoded = null;
|
|
1742
|
-
history.replace({ search: '' });
|
|
1743
|
-
}
|
|
1744
|
-
setValue(value) {
|
|
1745
|
-
this.certificateDecoded = value;
|
|
1746
|
-
this.inputPaste.value = value.exportAsPemFormatted();
|
|
1747
|
-
history.replace({
|
|
1748
|
-
search: history.queryStringify({
|
|
1749
|
-
cert: value.exportAsBase64(),
|
|
1750
|
-
}),
|
|
1751
|
-
});
|
|
1752
|
-
}
|
|
1753
|
-
decode(certificate) {
|
|
1754
|
-
const isPem$1 = isPem(certificate);
|
|
1755
|
-
const isX509Pem$1 = isX509Pem(certificate);
|
|
1756
|
-
const isPkcs10Pem$1 = isPkcs10Pem(certificate);
|
|
1757
|
-
const isX509AttributePem$1 = isX509AttributePem(certificate);
|
|
1758
|
-
let decoded;
|
|
1759
|
-
let decodeError;
|
|
1760
|
-
if (isPem$1 && !(isX509Pem$1 || isX509AttributePem$1 || isPkcs10Pem$1)) {
|
|
1761
|
-
this.clearValue();
|
|
1762
|
-
alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
|
|
1763
|
-
return;
|
|
1764
|
-
}
|
|
1765
|
-
try {
|
|
1766
|
-
if (isX509Pem$1) {
|
|
1767
|
-
decoded = new X509Certificate(certificate);
|
|
1768
|
-
}
|
|
1769
|
-
if (isX509AttributePem$1) {
|
|
1770
|
-
decoded = new X509AttributeCertificate(certificate);
|
|
1771
|
-
}
|
|
1772
|
-
if (isPkcs10Pem$1) {
|
|
1773
|
-
decoded = new CSR(certificate);
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
catch (error) {
|
|
1777
|
-
decodeError = error;
|
|
1778
|
-
}
|
|
1779
|
-
if (!decoded) {
|
|
1780
|
-
try {
|
|
1781
|
-
decoded = new X509Certificate(certificate);
|
|
1782
|
-
}
|
|
1783
|
-
catch (error) {
|
|
1784
|
-
decodeError = error;
|
|
1785
|
-
}
|
|
1786
|
-
}
|
|
1787
|
-
if (!decoded) {
|
|
1788
|
-
try {
|
|
1789
|
-
decoded = new X509AttributeCertificate(certificate);
|
|
1790
|
-
}
|
|
1791
|
-
catch (error) {
|
|
1792
|
-
decodeError = error;
|
|
1793
|
-
}
|
|
1794
|
-
}
|
|
1795
|
-
if (!decoded) {
|
|
1796
|
-
try {
|
|
1797
|
-
decoded = new CSR(certificate);
|
|
1798
|
-
}
|
|
1799
|
-
catch (error) {
|
|
1800
|
-
decodeError = error;
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
if (!decoded) {
|
|
1804
|
-
this.clearValue();
|
|
1805
|
-
console.log(decodeError);
|
|
1806
|
-
alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
|
|
1711
|
+
constructor(hostRef) {
|
|
1712
|
+
registerInstance(this, hostRef);
|
|
1713
|
+
this.onClickDecode = () => {
|
|
1714
|
+
const { value } = this.inputPaste;
|
|
1715
|
+
if (value) {
|
|
1716
|
+
this.decode(value);
|
|
1717
|
+
}
|
|
1718
|
+
};
|
|
1719
|
+
this.onClickExample = () => {
|
|
1720
|
+
this.decode(this.certificateExample);
|
|
1721
|
+
};
|
|
1722
|
+
this.onClickClear = () => {
|
|
1723
|
+
this.clearValue();
|
|
1724
|
+
};
|
|
1725
|
+
this.onChangeInputFile = async (e) => {
|
|
1726
|
+
const element = e.target;
|
|
1727
|
+
if (element.files) {
|
|
1728
|
+
const file = await readAsBinaryString(element.files[0]);
|
|
1729
|
+
if (typeof file.value === 'string') {
|
|
1730
|
+
this.decode(file.value);
|
|
1807
1731
|
}
|
|
1808
|
-
|
|
1809
|
-
|
|
1732
|
+
element.value = '';
|
|
1733
|
+
}
|
|
1734
|
+
};
|
|
1735
|
+
this.onDropFile = async (e) => {
|
|
1736
|
+
e.stopPropagation();
|
|
1737
|
+
e.preventDefault();
|
|
1738
|
+
const element = e.dataTransfer;
|
|
1739
|
+
if (element.files) {
|
|
1740
|
+
const file = await readAsBinaryString(element.files[0]);
|
|
1741
|
+
if (typeof file.value === 'string') {
|
|
1742
|
+
this.decode(file.value);
|
|
1810
1743
|
}
|
|
1744
|
+
}
|
|
1745
|
+
};
|
|
1746
|
+
}
|
|
1747
|
+
componentDidLoad() {
|
|
1748
|
+
const parsedHash = history.parseHash(window.location.search);
|
|
1749
|
+
if (parsedHash.cert) {
|
|
1750
|
+
/**
|
|
1751
|
+
* Prevent Stencil warning about re-render
|
|
1752
|
+
*/
|
|
1753
|
+
setTimeout(() => this.decode(parsedHash.cert), 100);
|
|
1754
|
+
}
|
|
1755
|
+
}
|
|
1756
|
+
clearValue() {
|
|
1757
|
+
this.inputPaste.value = '';
|
|
1758
|
+
this.certificateDecoded = null;
|
|
1759
|
+
history.replace({ search: '' });
|
|
1760
|
+
}
|
|
1761
|
+
setValue(value) {
|
|
1762
|
+
this.certificateDecoded = value;
|
|
1763
|
+
this.inputPaste.value = value.exportAsPemFormatted();
|
|
1764
|
+
history.replace({
|
|
1765
|
+
search: history.queryStringify({
|
|
1766
|
+
cert: value.exportAsBase64(),
|
|
1767
|
+
}),
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
decode(certificate) {
|
|
1771
|
+
const isPem$1 = isPem(certificate);
|
|
1772
|
+
const isX509Pem$1 = isX509Pem(certificate);
|
|
1773
|
+
const isPkcs10Pem$1 = isPkcs10Pem(certificate);
|
|
1774
|
+
const isX509AttributePem$1 = isX509AttributePem(certificate);
|
|
1775
|
+
let decoded;
|
|
1776
|
+
let decodeError;
|
|
1777
|
+
if (isPem$1 && !(isX509Pem$1 || isX509AttributePem$1 || isPkcs10Pem$1)) {
|
|
1778
|
+
this.clearValue();
|
|
1779
|
+
alert('Unsupported file type. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
|
|
1780
|
+
return;
|
|
1781
|
+
}
|
|
1782
|
+
try {
|
|
1783
|
+
if (isX509Pem$1) {
|
|
1784
|
+
decoded = new X509Certificate(certificate);
|
|
1785
|
+
}
|
|
1786
|
+
if (isX509AttributePem$1) {
|
|
1787
|
+
decoded = new X509AttributeCertificate(certificate);
|
|
1788
|
+
}
|
|
1789
|
+
if (isPkcs10Pem$1) {
|
|
1790
|
+
decoded = new CSR(certificate);
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
catch (error) {
|
|
1794
|
+
decodeError = error;
|
|
1795
|
+
}
|
|
1796
|
+
if (!decoded) {
|
|
1797
|
+
try {
|
|
1798
|
+
decoded = new X509Certificate(certificate);
|
|
1799
|
+
}
|
|
1800
|
+
catch (error) {
|
|
1801
|
+
decodeError = error;
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
if (!decoded) {
|
|
1805
|
+
try {
|
|
1806
|
+
decoded = new X509AttributeCertificate(certificate);
|
|
1807
|
+
}
|
|
1808
|
+
catch (error) {
|
|
1809
|
+
decodeError = error;
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
if (!decoded) {
|
|
1813
|
+
try {
|
|
1814
|
+
decoded = new CSR(certificate);
|
|
1815
|
+
}
|
|
1816
|
+
catch (error) {
|
|
1817
|
+
decodeError = error;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
if (!decoded) {
|
|
1821
|
+
this.clearValue();
|
|
1822
|
+
console.log(decodeError);
|
|
1823
|
+
alert('Error decoding file. Please try to use Certificate/AttributeCertificate/CertificateRequest.');
|
|
1811
1824
|
}
|
|
1812
|
-
|
|
1813
|
-
|
|
1825
|
+
else {
|
|
1826
|
+
this.setValue(decoded);
|
|
1814
1827
|
}
|
|
1828
|
+
}
|
|
1829
|
+
render() {
|
|
1830
|
+
return (h(Host, null, h("textarea", { placeholder: "Certificate DER or PEM", class: "textarea", ref: (el) => { this.inputPaste = el; }, onDrop: this.onDropFile }), h("div", { class: "controls" }, h("peculiar-button", { fill: "fill", class: "button", onClick: this.onClickDecode }, "Decode"), h("peculiar-button", { class: "button" }, "Choose file", h("input", { type: "file", class: "input_file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,.csr,.req", onChange: this.onChangeInputFile, value: "" })), h("peculiar-button", { class: "button", onClick: this.onClickClear }, "Clear"), this.certificateExample && (h("peculiar-button", { class: "button", onClick: this.onClickExample }, "Example"))), this.certificateDecoded instanceof X509Certificate && (h("peculiar-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof X509AttributeCertificate && (h("peculiar-attribute-certificate-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true })), this.certificateDecoded instanceof CSR && (h("peculiar-csr-viewer", { certificate: this.certificateDecoded, class: "viewer", download: true }))));
|
|
1831
|
+
}
|
|
1815
1832
|
};
|
|
1816
1833
|
CertificateDecoder.style = certificateDecoderCss;
|
|
1817
1834
|
|
|
@@ -1823,39 +1840,39 @@ CertificateDecoder.style = certificateDecoderCss;
|
|
|
1823
1840
|
* LICENSE file in the root directory of this source tree.
|
|
1824
1841
|
*/
|
|
1825
1842
|
function getPublicKeyModulus(publicKey) {
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1843
|
+
var _a;
|
|
1844
|
+
if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['modulus']) {
|
|
1845
|
+
let length = publicKey.params['modulus'].byteLength;
|
|
1846
|
+
if (length % 2) {
|
|
1847
|
+
length -= 1;
|
|
1848
|
+
}
|
|
1849
|
+
return length * 8;
|
|
1850
|
+
}
|
|
1851
|
+
return null;
|
|
1835
1852
|
}
|
|
1836
1853
|
function getPublicKeyExponent(publicKey) {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1854
|
+
var _a;
|
|
1855
|
+
if ((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['publicExponent']) {
|
|
1856
|
+
return publicKey.params['publicExponent'].byteLength === 3
|
|
1857
|
+
? 65537
|
|
1858
|
+
: 3;
|
|
1859
|
+
}
|
|
1860
|
+
return null;
|
|
1844
1861
|
}
|
|
1845
1862
|
const PublicKey = (props) => {
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1863
|
+
var _a;
|
|
1864
|
+
const { publicKey } = props;
|
|
1865
|
+
if (!publicKey) {
|
|
1866
|
+
return null;
|
|
1867
|
+
}
|
|
1868
|
+
return [
|
|
1869
|
+
h(RowTitle, { value: l10n.getString('publicKeyInfo') }),
|
|
1870
|
+
h(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(publicKey.algorithm) }),
|
|
1871
|
+
h(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID((_a = publicKey.params) === null || _a === void 0 ? void 0 : _a['namedCurve']) }),
|
|
1872
|
+
h(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(publicKey) }),
|
|
1873
|
+
h(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(publicKey) }),
|
|
1874
|
+
h(RowValue, { name: l10n.getString('value'), value: build.Convert.ToHex(publicKey.value), monospace: true, collapse: true }),
|
|
1875
|
+
];
|
|
1859
1876
|
};
|
|
1860
1877
|
|
|
1861
1878
|
/**
|
|
@@ -1866,11 +1883,11 @@ const PublicKey = (props) => {
|
|
|
1866
1883
|
* LICENSE file in the root directory of this source tree.
|
|
1867
1884
|
*/
|
|
1868
1885
|
const SubjectName = (props) => {
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1886
|
+
const { name } = props;
|
|
1887
|
+
return [
|
|
1888
|
+
h(RowTitle, { value: l10n.getString('subjectName') }),
|
|
1889
|
+
name.map((n) => (h(RowValue, { name: n.name || n.type, value: n.value }))),
|
|
1890
|
+
];
|
|
1874
1891
|
};
|
|
1875
1892
|
|
|
1876
1893
|
/**
|
|
@@ -1881,243 +1898,261 @@ const SubjectName = (props) => {
|
|
|
1881
1898
|
* LICENSE file in the root directory of this source tree.
|
|
1882
1899
|
*/
|
|
1883
1900
|
const IssuerName = (props) => {
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1901
|
+
const { name, issuerDnLink } = props;
|
|
1902
|
+
const title = l10n.getString('issuerName');
|
|
1903
|
+
return [
|
|
1904
|
+
h(RowTitle, { value: issuerDnLink ? (h("peculiar-link", { href: issuerDnLink, type: "h6" }, title)) : title }),
|
|
1905
|
+
name.map((n) => (h(RowValue, { name: n.name || n.type, value: n.value }))),
|
|
1906
|
+
];
|
|
1890
1907
|
};
|
|
1891
1908
|
|
|
1892
1909
|
const certificateViewerCss$1 = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
|
|
1893
1910
|
|
|
1894
1911
|
const CertificateViewer = class {
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
}
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1912
|
+
constructor(hostRef) {
|
|
1913
|
+
registerInstance(this, hostRef);
|
|
1914
|
+
this.isDecodeInProcess = true;
|
|
1915
|
+
this.getAuthKeyIdParentLink = (value) => {
|
|
1916
|
+
var _a;
|
|
1917
|
+
return (_a = this.authKeyIdParentLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
1918
|
+
};
|
|
1919
|
+
this.getAuthKeyIdSiblingsLink = (value) => {
|
|
1920
|
+
var _a;
|
|
1921
|
+
return (_a = this.authKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{authKeyId}}', value);
|
|
1922
|
+
};
|
|
1923
|
+
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
1924
|
+
var _a;
|
|
1925
|
+
return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
1926
|
+
};
|
|
1927
|
+
this.getSubjectKeyIdSiblingsLink = (value) => {
|
|
1928
|
+
var _a;
|
|
1929
|
+
return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
1930
|
+
};
|
|
1931
|
+
}
|
|
1932
|
+
componentWillLoad() {
|
|
1933
|
+
this.decodeCertificate(this.certificate);
|
|
1934
|
+
}
|
|
1935
|
+
async decodeCertificate(certificate) {
|
|
1936
|
+
this.isDecodeInProcess = true;
|
|
1937
|
+
try {
|
|
1938
|
+
if (certificate instanceof X509Certificate) {
|
|
1939
|
+
this.certificateDecoded = certificate;
|
|
1940
|
+
}
|
|
1941
|
+
else if (typeof certificate === 'string') {
|
|
1942
|
+
this.certificateDecoded = new X509Certificate(certificate);
|
|
1943
|
+
}
|
|
1944
|
+
else {
|
|
1945
|
+
return;
|
|
1946
|
+
}
|
|
1947
|
+
this.certificateDecoded.parseExtensions();
|
|
1948
|
+
await this.certificateDecoded.getThumbprint('SHA-1');
|
|
1949
|
+
await this.certificateDecoded.getThumbprint('SHA-256');
|
|
1950
|
+
}
|
|
1951
|
+
catch (error) {
|
|
1952
|
+
this.certificateDecodeError = error;
|
|
1953
|
+
console.error('Error certificate parse:', error);
|
|
1954
|
+
}
|
|
1955
|
+
this.isDecodeInProcess = false;
|
|
1956
|
+
}
|
|
1957
|
+
/**
|
|
1958
|
+
* Rerun decodeCertificate if previuos value not equal current value
|
|
1959
|
+
*/
|
|
1960
|
+
watchCertificateAndDecode(newValue, oldValue) {
|
|
1961
|
+
if (typeof newValue === 'string' && typeof oldValue === 'string') {
|
|
1962
|
+
if (newValue !== oldValue) {
|
|
1963
|
+
this.decodeCertificate(newValue);
|
|
1964
|
+
}
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
if (newValue instanceof X509Certificate && oldValue instanceof X509Certificate) {
|
|
1968
|
+
if (newValue.serialNumber !== oldValue.serialNumber) {
|
|
1969
|
+
this.decodeCertificate(newValue);
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
getIssuerDnLink() {
|
|
1974
|
+
return this.issuerDnLink;
|
|
1975
|
+
}
|
|
1976
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1977
|
+
renderErrorState() {
|
|
1978
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this certificate.")));
|
|
1979
|
+
}
|
|
1980
|
+
// eslint-disable-next-line class-methods-use-this
|
|
1981
|
+
renderEmptyState() {
|
|
1982
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no certificate available.")));
|
|
1983
|
+
}
|
|
1984
|
+
render() {
|
|
1985
|
+
if (this.certificateDecodeError) {
|
|
1986
|
+
return this.renderErrorState();
|
|
1987
|
+
}
|
|
1988
|
+
if (!this.certificateDecoded) {
|
|
1989
|
+
return this.renderEmptyState();
|
|
1990
|
+
}
|
|
1991
|
+
return (h(Host, { "data-view": this.view }, 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 })))));
|
|
1992
|
+
}
|
|
1993
|
+
static get watchers() { return {
|
|
1994
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
1995
|
+
}; }
|
|
1967
1996
|
};
|
|
1968
1997
|
CertificateViewer.style = certificateViewerCss$1;
|
|
1969
1998
|
|
|
1970
|
-
const certificateViewerCss
|
|
1999
|
+
const certificateViewerCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%;word-wrap:break-word;position:relative;min-width:280px;min-height:300px;background:white;background:rgba(var(--pv-color-light-rgb), 1)}th,td{border:none}table{width:100%;margin-bottom:30px;border-spacing:0;border-collapse:collapse}table .title td{border-color:rgba(209, 213, 217, 0.5);border-color:rgba(var(--pv-color-grey_3-rgb), 0.5);padding-top:60px;padding-bottom:15px;border-bottom-width:1px;border-bottom-style:solid}table td:first-child{padding-left:30px;width:130px;padding-right:10px}table td:last-child{padding-right:30px;width:calc(100% - 130px)}table td{vertical-align:top;padding-top:5px;padding-bottom:5px}table td.vertical_align_middle{vertical-align:middle}table .title:first-child td{padding-top:15px}table .title+tr td{padding-top:15px}table td.monospace{max-width:0}table .divider{padding-top:15px;padding-bottom:15px}.divider .bg_fill{background-color:rgba(209, 213, 217, 0.5);background-color:rgba(var(--pv-color-grey_3-rgb), 0.5)}table tr:last-child .divider{padding-top:0;opacity:0}.divider span{display:block;height:1px}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}.interaction_text{padding:15px 0;width:300px;margin:auto;text-align:center}@media (max-width: 900px){table,tr,td{display:block}table td:last-child,table td:first-child{padding-right:15px;padding-left:15px;width:100%}table .title+tr td{padding-top:5px}table .title+tr td:first-child{padding-top:15px}table td.monospace{width:100%;max-width:none}}:host([data-view=mobile]) table,:host([data-view=mobile]) tr,:host([data-view=mobile]) td{display:block}:host([data-view=mobile]) table td:last-child,:host([data-view=mobile]) table td:first-child{padding-right:15px;padding-left:15px;width:100%}:host([data-view=mobile]) table .title+tr td{padding-top:5px}:host([data-view=mobile]) table .title+tr td:first-child{padding-top:15px}:host([data-view=mobile]) table td.monospace{width:100%;max-width:none}";
|
|
1971
2000
|
|
|
1972
2001
|
const CsrViewer = class {
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
}
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
}
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
|
|
2002
|
+
constructor(hostRef) {
|
|
2003
|
+
registerInstance(this, hostRef);
|
|
2004
|
+
this.isDecodeInProcess = true;
|
|
2005
|
+
this.getAuthKeyIdParentLink = (value) => value;
|
|
2006
|
+
this.getAuthKeyIdSiblingsLink = (value) => value;
|
|
2007
|
+
this.getSubjectKeyIdChildrenLink = (value) => {
|
|
2008
|
+
var _a;
|
|
2009
|
+
return (_a = this.subjectKeyIdChildrenLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
2010
|
+
};
|
|
2011
|
+
this.getSubjectKeyIdSiblingsLink = (value) => {
|
|
2012
|
+
var _a;
|
|
2013
|
+
return (_a = this.subjectKeyIdSiblingsLink) === null || _a === void 0 ? void 0 : _a.replace('{{subjectKeyId}}', value);
|
|
2014
|
+
};
|
|
2015
|
+
}
|
|
2016
|
+
componentWillLoad() {
|
|
2017
|
+
this.decodeCertificate(this.certificate);
|
|
2018
|
+
}
|
|
2019
|
+
async decodeCertificate(certificate) {
|
|
2020
|
+
this.isDecodeInProcess = true;
|
|
2021
|
+
try {
|
|
2022
|
+
if (certificate instanceof CSR) {
|
|
2023
|
+
this.certificateDecoded = certificate;
|
|
2024
|
+
}
|
|
2025
|
+
else if (typeof certificate === 'string') {
|
|
2026
|
+
this.certificateDecoded = new CSR(certificate);
|
|
2027
|
+
}
|
|
2028
|
+
else {
|
|
2029
|
+
return;
|
|
2030
|
+
}
|
|
2031
|
+
this.certificateDecoded.parseAttributes();
|
|
2032
|
+
await this.certificateDecoded.getThumbprint('SHA-1');
|
|
2033
|
+
await this.certificateDecoded.getThumbprint('SHA-256');
|
|
2034
|
+
}
|
|
2035
|
+
catch (error) {
|
|
2036
|
+
this.certificateDecodeError = error;
|
|
2037
|
+
console.error('Error certificate parse:', error);
|
|
2038
|
+
}
|
|
2039
|
+
this.isDecodeInProcess = false;
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* Rerun decodeCertificate if previuos value not equal current value
|
|
2043
|
+
*/
|
|
2044
|
+
watchCertificateAndDecode(newValue, oldValue) {
|
|
2045
|
+
if (typeof newValue === 'string' && typeof oldValue === 'string') {
|
|
2046
|
+
if (newValue !== oldValue) {
|
|
2047
|
+
this.decodeCertificate(newValue);
|
|
2048
|
+
}
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
if (newValue instanceof CSR
|
|
2052
|
+
&& oldValue instanceof CSR) {
|
|
2053
|
+
if (newValue.commonName !== oldValue.commonName) {
|
|
2054
|
+
this.decodeCertificate(newValue);
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
}
|
|
2058
|
+
// eslint-disable-next-line class-methods-use-this
|
|
2059
|
+
renderErrorState() {
|
|
2060
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There was an error decoding this certificate request.")));
|
|
2061
|
+
}
|
|
2062
|
+
// eslint-disable-next-line class-methods-use-this
|
|
2063
|
+
renderEmptyState() {
|
|
2064
|
+
return (h("div", { class: "status_wrapper" }, h("peculiar-typography", { type: "b1", class: "interaction_text" }, "There is no certificate request available.")));
|
|
2065
|
+
}
|
|
2066
|
+
getExtensionRequestAttribute() {
|
|
2067
|
+
if (!this.certificateDecoded) {
|
|
2068
|
+
return undefined;
|
|
2069
|
+
}
|
|
2070
|
+
return this.certificateDecoded.attributes
|
|
2071
|
+
.find((attribute) => attribute.asn.type === '1.2.840.113549.1.9.14');
|
|
2072
|
+
}
|
|
2073
|
+
render() {
|
|
2074
|
+
if (this.certificateDecodeError) {
|
|
2075
|
+
return this.renderErrorState();
|
|
2076
|
+
}
|
|
2077
|
+
if (!this.certificateDecoded) {
|
|
2078
|
+
return this.renderEmptyState();
|
|
2079
|
+
}
|
|
2080
|
+
const extensionRequestAttribute = this.getExtensionRequestAttribute();
|
|
2081
|
+
return (h(Host, { "data-view": this.view }, h("table", null, h(BasicInformation, Object.assign({}, this.certificateDecoded)), h(SubjectName, { name: this.certificateDecoded.subject }), h(PublicKey, { publicKey: this.certificateDecoded.publicKey }), h(Signature, { signature: this.certificateDecoded.signature }), h(Thumbprints, { thumbprints: this.certificateDecoded.thumbprints }), h(Attributes, { attributes: this.certificateDecoded.attributes, getLEILink: getLEILink, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink, getAuthKeyIdParentLink: this.getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink: this.getAuthKeyIdSiblingsLink, getSubjectKeyIdChildrenLink: this.getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink: this.getSubjectKeyIdSiblingsLink }), h(Extensions, { extensions: extensionRequestAttribute === null || extensionRequestAttribute === void 0 ? void 0 : extensionRequestAttribute.value, title: "Extension Request", 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 })))));
|
|
2082
|
+
}
|
|
2083
|
+
static get watchers() { return {
|
|
2084
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
2085
|
+
}; }
|
|
2086
|
+
};
|
|
2087
|
+
CsrViewer.style = certificateViewerCss;
|
|
2053
2088
|
|
|
2054
2089
|
const linkCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:inline-block}.link{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);line-height:1.4;line-height:var(--pv-line-height-normal);color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1);font-weight:400;margin:0;padding:0;word-break:break-all}.link_type_h4{font-size:17px;font-size:var(--pv-font-size-h4);font-weight:600}.link_type_h6{font-size:15px;font-size:var(--pv-font-size-h6);font-weight:600}.link_type_h7{font-size:14px;font-size:var(--pv-font-size-h7);font-weight:600}.link_type_b1{font-size:15px;font-size:var(--pv-font-size-b1)}.link_type_b3{font-size:13px;font-size:var(--pv-font-size-b3)}.link:hover{text-decoration:none}";
|
|
2055
2090
|
|
|
2056
2091
|
const Link = class {
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2092
|
+
constructor(hostRef) {
|
|
2093
|
+
registerInstance(this, hostRef);
|
|
2094
|
+
/**
|
|
2095
|
+
* Typography type.
|
|
2096
|
+
*/
|
|
2097
|
+
this.type = 'b3';
|
|
2098
|
+
}
|
|
2099
|
+
render() {
|
|
2100
|
+
return (h("a", { href: this.href, target: "_blank", rel: "noreferrer noopener", class: {
|
|
2101
|
+
link: true,
|
|
2102
|
+
[`link_type_${this.type || 'b3'}`]: true,
|
|
2103
|
+
} }, h("slot", null)));
|
|
2104
|
+
}
|
|
2070
2105
|
};
|
|
2071
2106
|
Link.style = linkCss;
|
|
2072
2107
|
|
|
2073
2108
|
const textHiderCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{display:block;width:100%}.text{display:inline-block;width:calc(100% - 60px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0}.text.m_opened{white-space:initial}.action{vertical-align:top;display:inline-block;width:60px;text-align:right;position:relative;top:-6px}.button_action{width:30px}.expand_icon{width:7px;height:5px;display:inline-block}.m_opened .expand_icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}";
|
|
2074
2109
|
|
|
2075
2110
|
const TextHider = class {
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2111
|
+
constructor(hostRef) {
|
|
2112
|
+
registerInstance(this, hostRef);
|
|
2113
|
+
this.textExpand = createEvent(this, "textExpand", 7);
|
|
2114
|
+
this.opened = false;
|
|
2115
|
+
}
|
|
2116
|
+
textExpandHandler() {
|
|
2117
|
+
this.opened = !this.opened;
|
|
2118
|
+
}
|
|
2119
|
+
render() {
|
|
2120
|
+
return (h(Host, null, h("div", { class: "root" }, h("div", { class: {
|
|
2121
|
+
text: true,
|
|
2122
|
+
m_opened: this.opened,
|
|
2123
|
+
} }, h("slot", null)), h("div", { class: "action" }, h("peculiar-button", { onClick: this.textExpand.emit, class: {
|
|
2124
|
+
button_action: true,
|
|
2125
|
+
m_opened: this.opened,
|
|
2126
|
+
}, fill: this.opened ? 'fill' : 'stroke' }, h("svg", { viewBox: "0 0 7 5", xmlns: "http://www.w3.org/2000/svg", class: "expand_icon" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", fill: "currentColor", d: "M5.459.124c.934.001 1.442.994.84 1.644L4.425 3.794c-.44.475-1.244.475-1.684 0L.862 1.764C.26 1.115.77.12 1.705.122l3.754.003z" })))))));
|
|
2127
|
+
}
|
|
2093
2128
|
};
|
|
2094
2129
|
TextHider.style = textHiderCss;
|
|
2095
2130
|
|
|
2096
2131
|
const typographyCss = ":host{-webkit-box-sizing:border-box;box-sizing:border-box}:host *,:host *:before,:host *:after{-webkit-box-sizing:inherit;box-sizing:inherit}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-ms-touch-action:manipulation;touch-action:manipulation;-webkit-user-drag:none;-ms-content-zooming:none;word-wrap:break-word;-webkit-text-size-adjust:none;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;display:block}.typography{font-family:\"Open Sans\", \"Arial\", sans-serif;font-family:var(--pv-font-family);letter-spacing:0.03em;letter-spacing:var(--pv-letter-spacing-normal);line-height:1.4;line-height:var(--pv-line-height-normal);font-weight:400;margin:0;padding:0;display:block}.typography_type_h4{font-size:17px;font-size:var(--pv-font-size-h4);font-weight:600}.typography_type_h6{font-size:15px;font-size:var(--pv-font-size-h6);font-weight:600}.typography_type_h7{font-size:14px;font-size:var(--pv-font-size-h7);font-weight:600}.typography_type_b1{font-size:15px;font-size:var(--pv-font-size-b1)}.typography_type_b3{font-size:13px;font-size:var(--pv-font-size-b3)}.typography_color_dark{color:#2a3134;color:rgba(var(--pv-color-dark-rgb), 1)}.typography_color_light{color:white;color:rgba(var(--pv-color-light-rgb), 1)}.typography_color_grey_3{color:#d1d5d9;color:rgba(var(--pv-color-grey_3-rgb), 1)}.typography_color_grey_5{color:#869196;color:rgba(var(--pv-color-grey_5-rgb), 1)}.typography_color_attention{color:#f7a831;color:rgba(var(--pv-color-attention-rgb), 1)}.typography_color_primary{color:#3584f7;color:rgba(var(--pv-color-primary-rgb), 1)}.typography_ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.typography_monospace{font-family:monospace}.typography_align_left{text-align:left}.typography_align_center{text-align:center}.typography_align_right{text-align:right}";
|
|
2097
2132
|
|
|
2098
2133
|
const PeculiarTypography = class {
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2134
|
+
constructor(hostRef) {
|
|
2135
|
+
registerInstance(this, hostRef);
|
|
2136
|
+
/**
|
|
2137
|
+
* Typography type.
|
|
2138
|
+
*/
|
|
2139
|
+
this.type = 'b3';
|
|
2140
|
+
/**
|
|
2141
|
+
* Component color from theme.
|
|
2142
|
+
*/
|
|
2143
|
+
this.color = 'dark';
|
|
2144
|
+
}
|
|
2145
|
+
render() {
|
|
2146
|
+
const TagType = this.type && this.type.includes('h') ? this.type : 'p';
|
|
2147
|
+
return (h(TagType, { class: {
|
|
2148
|
+
typography: true,
|
|
2149
|
+
[`typography_type_${this.type || 'b3'}`]: true,
|
|
2150
|
+
[`typography_color_${this.color || 'dark'}`]: true,
|
|
2151
|
+
[`typography_align_${this.align}`]: !!this.align,
|
|
2152
|
+
typography_ellipsis: this.ellipsis,
|
|
2153
|
+
typography_monospace: this.monospace,
|
|
2154
|
+
} }, h("slot", null)));
|
|
2155
|
+
}
|
|
2121
2156
|
};
|
|
2122
2157
|
PeculiarTypography.style = typographyCss;
|
|
2123
2158
|
|