@peculiar/certificates-viewer 4.7.0 → 4.7.1-alpha.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/components/attribute-certificate-viewer.js +4 -2
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/attribute.js +1 -1
- package/components/certificate-chain-viewer.js +1 -1
- package/components/certificate-viewer.js +3 -2
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +4 -2
- package/components/crl-viewer.js.map +1 -1
- package/components/csr-viewer.js +2 -2
- package/components/download.js +2 -12680
- package/components/download.js.map +1 -1
- package/components/index.js +2 -1
- package/components/index.js.map +1 -1
- package/components/index2.js +3 -2
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +2 -2
- package/components/link.js +14335 -0
- package/components/link.js.map +1 -0
- package/components/miscellaneous.js +5 -79
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificate-decoder.js +32 -16
- package/components/peculiar-certificate-decoder.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +2 -1
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-ssh-certificate-viewer.d.ts +11 -0
- package/components/peculiar-ssh-certificate-viewer.js +12 -0
- package/components/peculiar-ssh-certificate-viewer.js.map +1 -0
- package/components/peculiar-text-hider.js +1 -32
- package/components/peculiar-text-hider.js.map +1 -1
- package/components/pkcs10_certificate_request.js +2 -1
- package/components/pkcs10_certificate_request.js.map +1 -1
- package/components/row.js +87 -0
- package/components/row.js.map +1 -0
- package/components/ssh-certificate-viewer.js +193 -0
- package/components/ssh-certificate-viewer.js.map +1 -0
- package/components/subject_name.js +2 -2
- package/components/text-hider.js +40 -0
- package/components/text-hider.js.map +1 -0
- package/dist/cjs/extension-D8YKlAu4.js +110 -0
- package/dist/cjs/{extension-CGZpfI3W.js.map → extension-D8YKlAu4.js.map} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{miscellaneous-D_RAtkZz.js → miscellaneous-DvVSM5KJ.js} +147 -147
- package/dist/cjs/{miscellaneous-D_RAtkZz.js.map → miscellaneous-DvVSM5KJ.js.map} +1 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.cjs.js.map +1 -0
- package/dist/cjs/{peculiar-attribute-certificate-viewer_4.cjs.entry.js → peculiar-attribute-certificate-viewer_5.cjs.entry.js} +197 -44
- package/dist/{peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.esm.js.map → cjs/peculiar-attribute-certificate-viewer_5.cjs.entry.js.map} +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +25 -21
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +23 -23
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.entry.cjs.js.map +1 -1
- package/dist/cjs/peculiar.cjs.js +1 -1
- package/dist/cjs/pkcs10_certificate_request-BoHhadiA.js +146 -0
- package/dist/cjs/{pkcs10_certificate_request-BQkkkT42.js.map → pkcs10_certificate_request-BoHhadiA.js.map} +1 -1
- package/dist/cjs/{certification_request-DISQwgjn.js → ssh_certificate-s3-rwdMT.js} +1664 -16
- package/dist/cjs/ssh_certificate-s3-rwdMT.js.map +1 -0
- package/dist/cjs/{x509_certificate-DGRpZGA2.js → x509_certificate-DfXuxxZp.js} +29 -29
- package/dist/cjs/{x509_certificate-DGRpZGA2.js.map → x509_certificate-DfXuxxZp.js.map} +1 -1
- package/dist/cjs/{x509_crl-DMvJk_81.js → x509_crl-CxJ2lyGX.js} +32 -32
- package/dist/cjs/{x509_crl-DMvJk_81.js.map → x509_crl-CxJ2lyGX.js.map} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/certificate-decoder/certificate-decoder.js +10 -6
- package/dist/collection/components/certificate-decoder/certificate-decoder.js.map +1 -1
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js +29 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/basic_information.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js +26 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/public_key.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js +26 -0
- package/dist/collection/components/ssh-certificate-viewer/-components/signature_key.js.map +1 -0
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js +193 -0
- package/dist/collection/components/ssh-certificate-viewer/ssh-certificate-viewer.js.map +1 -0
- package/dist/collection/crypto/index.js +1 -0
- package/dist/collection/crypto/index.js.map +1 -1
- package/dist/collection/crypto/ssh_certificate.js +68 -0
- package/dist/collection/crypto/ssh_certificate.js.map +1 -0
- package/dist/collection/locales/en.json +5 -1
- package/dist/esm/{extension-CUOKUt7o.js → extension-oK2qpCU6.js} +3 -3
- package/dist/{esm-es5/extension-CUOKUt7o.js.map → esm/extension-oK2qpCU6.js.map} +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{miscellaneous-DVlekgVM.js → miscellaneous-DrmTXljc.js} +4 -4
- package/dist/esm/{miscellaneous-DVlekgVM.js.map → miscellaneous-DrmTXljc.js.map} +1 -1
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
- package/dist/esm/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +166 -14
- package/dist/esm/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
- package/dist/esm/peculiar-certificate-decoder.entry.js +14 -10
- package/dist/esm/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-viewer.entry.js +4 -4
- package/dist/esm/peculiar-certificates-viewer.entry.js +3 -3
- package/dist/esm/peculiar.js +1 -1
- package/dist/esm/{pkcs10_certificate_request-B9Q42jiE.js → pkcs10_certificate_request-Bdt_qA_g.js} +3 -3
- package/dist/esm/{pkcs10_certificate_request-B9Q42jiE.js.map → pkcs10_certificate_request-Bdt_qA_g.js.map} +1 -1
- package/dist/esm/{certification_request-CSS3OhZq.js → ssh_certificate-Ct-r021h.js} +1664 -17
- package/dist/esm/ssh_certificate-Ct-r021h.js.map +1 -0
- package/dist/esm/{x509_certificate-fWXLCtc8.js → x509_certificate-5DEbrOA7.js} +4 -4
- package/dist/esm/{x509_certificate-fWXLCtc8.js.map → x509_certificate-5DEbrOA7.js.map} +1 -1
- package/dist/esm/{x509_crl-Dq33Vv-q.js → x509_crl-CPgNUkh7.js} +5 -5
- package/dist/esm/{x509_crl-Dq33Vv-q.js.map → x509_crl-CPgNUkh7.js.map} +1 -1
- package/dist/esm-es5/{extension-CUOKUt7o.js → extension-oK2qpCU6.js} +2 -2
- package/dist/{esm/extension-CUOKUt7o.js.map → esm-es5/extension-oK2qpCU6.js.map} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/loader.js +2 -2
- package/dist/esm-es5/{miscellaneous-DVlekgVM.js → miscellaneous-DrmTXljc.js} +2 -2
- package/dist/esm-es5/{miscellaneous-DVlekgVM.js.map → miscellaneous-DrmTXljc.js.map} +1 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.js.map +1 -0
- package/dist/esm-es5/{peculiar-attribute-certificate-viewer_4.entry.js → peculiar-attribute-certificate-viewer_5.entry.js} +24 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_5.entry.js.map +1 -0
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar.js +1 -1
- package/dist/esm-es5/{pkcs10_certificate_request-B9Q42jiE.js → pkcs10_certificate_request-Bdt_qA_g.js} +2 -2
- package/dist/esm-es5/{pkcs10_certificate_request-B9Q42jiE.js.map → pkcs10_certificate_request-Bdt_qA_g.js.map} +1 -1
- package/dist/esm-es5/{certification_request-CSS3OhZq.js → ssh_certificate-Ct-r021h.js} +7 -7
- package/dist/{peculiar/p-D_WeukQa.system.js.map → esm-es5/ssh_certificate-Ct-r021h.js.map} +1 -1
- package/dist/esm-es5/{x509_certificate-fWXLCtc8.js → x509_certificate-5DEbrOA7.js} +2 -2
- package/dist/esm-es5/{x509_certificate-fWXLCtc8.js.map → x509_certificate-5DEbrOA7.js.map} +1 -1
- package/dist/esm-es5/{x509_crl-Dq33Vv-q.js → x509_crl-CPgNUkh7.js} +2 -2
- package/dist/esm-es5/{x509_crl-Dq33Vv-q.js.map → x509_crl-CPgNUkh7.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/locales/en.json +5 -1
- package/dist/peculiar/{p-4cc72a56.entry.js → p-0b895a8e.entry.js} +2 -2
- package/dist/peculiar/{p-a193f8fd.system.entry.js → p-11434880.system.entry.js} +2 -2
- package/dist/peculiar/{p-DTz3NA_M.system.js → p-2GQYAR0v.system.js} +2 -2
- package/dist/peculiar/{p-DTz3NA_M.system.js.map → p-2GQYAR0v.system.js.map} +1 -1
- package/dist/peculiar/{p-17ebc78c.system.entry.js → p-364fd32b.system.entry.js} +2 -2
- package/dist/peculiar/{p-e7c60082.system.entry.js → p-5df0f22b.system.entry.js} +40 -19
- package/dist/{esm-es5/peculiar-attribute-certificate-viewer_4.entry.js.map → peculiar/p-5df0f22b.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-a4e74904.entry.js → p-62b723f6.entry.js} +40 -19
- package/dist/peculiar/p-62b723f6.entry.js.map +1 -0
- package/dist/peculiar/{p-e3967e76.entry.js → p-83a53b4f.entry.js} +2 -2
- package/dist/peculiar/{p-DKooqn40.js → p-B2G7qjfV.js} +10 -10
- package/dist/peculiar/{p-DKooqn40.js.map → p-B2G7qjfV.js.map} +1 -1
- package/dist/peculiar/{p-D8TC0Na9.system.js.map → p-BCsPspKr.system.js.map} +1 -1
- package/dist/peculiar/p-BGASC3UX.system.js +1 -1
- package/dist/peculiar/p-BGIWeG8l.js +12 -0
- package/dist/peculiar/{p-CZuaTO2G.js.map → p-BGIWeG8l.js.map} +1 -1
- package/dist/peculiar/{p-CEzxVCEh.system.js → p-BQiABBi1.system.js} +4 -4
- package/dist/peculiar/{p-CEzxVCEh.system.js.map → p-BQiABBi1.system.js.map} +1 -1
- package/dist/peculiar/{p-DcTXA-2R.system.js → p-BeVuAzsd.system.js} +39 -39
- package/dist/peculiar/{p-DcTXA-2R.system.js.map → p-BeVuAzsd.system.js.map} +1 -1
- package/dist/peculiar/{p-BTn-wukS.system.js → p-C31rbtuG.system.js} +2 -2
- package/dist/peculiar/p-C31rbtuG.system.js.map +1 -0
- package/dist/peculiar/p-Ce-IF7_R.system.js.map +1 -0
- package/dist/peculiar/p-ClkgAXnd.system.js +135 -0
- package/dist/peculiar/{p-CSS3OhZq.js.map → p-ClkgAXnd.system.js.map} +1 -1
- package/dist/peculiar/{p-CSS3OhZq.js → p-Ct-r021h.js} +12 -12
- package/dist/peculiar/p-Ct-r021h.js.map +1 -0
- package/dist/peculiar/{p-Bsy7Sqzl.system.js.map → p-CxtUQdcj.system.js.map} +1 -1
- package/dist/peculiar/{p-tl0v45Y7.js → p-D9qq15zG.js} +2 -2
- package/dist/peculiar/{p-tl0v45Y7.js.map → p-D9qq15zG.js.map} +1 -1
- package/dist/peculiar/{p-BG_D4qzJ.js → p-DOpiv0-8.js} +3 -3
- package/dist/peculiar/{p-BG_D4qzJ.js.map → p-DOpiv0-8.js.map} +1 -1
- package/dist/peculiar/p-IOtHTzYC.system.js +12 -0
- package/dist/peculiar/{p-CgCUixvk.system.js.map → p-IOtHTzYC.system.js.map} +1 -1
- package/dist/peculiar/p-LmKU8Smy.system.js.map +1 -0
- package/dist/peculiar/{p-CoPYW15U.js → p-RWPI76Dh.js} +4 -4
- package/dist/peculiar/{p-CoPYW15U.js.map → p-RWPI76Dh.js.map} +1 -1
- package/dist/peculiar/p-da9eb1e7.entry.js +5 -0
- package/dist/peculiar/p-da9eb1e7.entry.js.map +1 -0
- package/dist/peculiar/p-fd98bb82.system.entry.js +5 -0
- package/dist/peculiar/p-fd98bb82.system.entry.js.map +1 -0
- package/dist/peculiar/p-zQwWLfga.system.js +19 -0
- package/dist/peculiar/{p-7fTYvx_V.system.js.map → p-zQwWLfga.system.js.map} +1 -1
- package/dist/peculiar/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.peculiar-ssh-certificate-viewer.entry.esm.js.map +1 -0
- package/dist/peculiar/peculiar-certificate-decoder.entry.esm.js.map +1 -1
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-decoder/certificate-decoder.d.ts +4 -4
- package/dist/types/components/ssh-certificate-viewer/-components/basic_information.d.ts +21 -0
- package/dist/types/components/ssh-certificate-viewer/-components/public_key.d.ts +14 -0
- package/dist/types/components/ssh-certificate-viewer/-components/signature_key.d.ts +14 -0
- package/dist/types/components/ssh-certificate-viewer/ssh-certificate-viewer.d.ts +43 -0
- package/dist/types/components.d.ts +43 -0
- package/dist/types/crypto/index.d.ts +1 -0
- package/dist/types/crypto/ssh_certificate.d.ts +28 -0
- package/dist/types/utils/l10n.d.ts +4 -0
- package/hydrate/index.js +1840 -27
- package/hydrate/index.mjs +1840 -27
- package/package.json +3 -2
- package/dist/cjs/certification_request-DISQwgjn.js.map +0 -1
- package/dist/cjs/extension-CGZpfI3W.js +0 -110
- package/dist/cjs/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.cjs.js.map +0 -1
- package/dist/cjs/peculiar-attribute-certificate-viewer_4.cjs.entry.js.map +0 -1
- package/dist/cjs/pkcs10_certificate_request-BQkkkT42.js +0 -146
- package/dist/esm/certification_request-CSS3OhZq.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
- package/dist/esm/peculiar-attribute-certificate-viewer_4.entry.js.map +0 -1
- package/dist/esm-es5/certification_request-CSS3OhZq.js.map +0 -1
- package/dist/esm-es5/peculiar-attribute-certificate-viewer.peculiar-certificate-chain-viewer.peculiar-crl-viewer.peculiar-csr-viewer.entry.js.map +0 -1
- package/dist/peculiar/p-7fTYvx_V.system.js +0 -19
- package/dist/peculiar/p-BTn-wukS.system.js.map +0 -1
- package/dist/peculiar/p-CZuaTO2G.js +0 -12
- package/dist/peculiar/p-CgCUixvk.system.js +0 -12
- package/dist/peculiar/p-DLsQGkmT.system.js.map +0 -1
- package/dist/peculiar/p-D_WeukQa.system.js +0 -135
- package/dist/peculiar/p-a4e74904.entry.js.map +0 -1
- package/dist/peculiar/p-ce006f1c.system.entry.js +0 -5
- package/dist/peculiar/p-ce006f1c.system.entry.js.map +0 -1
- package/dist/peculiar/p-e7c60082.system.entry.js.map +0 -1
- package/dist/peculiar/p-f465afe6.entry.js +0 -5
- package/dist/peculiar/p-f465afe6.entry.js.map +0 -1
- package/dist/peculiar/p-tBL0ekYY.system.js.map +0 -1
- /package/dist/peculiar/{p-4cc72a56.entry.js.map → p-0b895a8e.entry.js.map} +0 -0
- /package/dist/peculiar/{p-a193f8fd.system.entry.js.map → p-11434880.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-17ebc78c.system.entry.js.map → p-364fd32b.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-e3967e76.entry.js.map → p-83a53b4f.entry.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -9989,6 +9989,10 @@ const crlEntryExtensions = "CRL Entry Extensions";
|
|
|
9989
9989
|
const previewCertificate = "Preview certificate";
|
|
9990
9990
|
const viewDetails = "View details";
|
|
9991
9991
|
const downloadOptions = "Download options";
|
|
9992
|
+
const keyId = "Key ID";
|
|
9993
|
+
const principals = "Principals";
|
|
9994
|
+
const criticalOptions = "Critical Options";
|
|
9995
|
+
const signingCA = "Signing CA";
|
|
9992
9996
|
var en = {
|
|
9993
9997
|
basicInformation: basicInformation,
|
|
9994
9998
|
subjectName: subjectName,
|
|
@@ -10036,7 +10040,11 @@ var en = {
|
|
|
10036
10040
|
crlEntryExtensions: crlEntryExtensions,
|
|
10037
10041
|
previewCertificate: previewCertificate,
|
|
10038
10042
|
viewDetails: viewDetails,
|
|
10039
|
-
downloadOptions: downloadOptions
|
|
10043
|
+
downloadOptions: downloadOptions,
|
|
10044
|
+
keyId: keyId,
|
|
10045
|
+
principals: principals,
|
|
10046
|
+
criticalOptions: criticalOptions,
|
|
10047
|
+
signingCA: signingCA
|
|
10040
10048
|
};
|
|
10041
10049
|
|
|
10042
10050
|
/**
|
|
@@ -12574,13 +12582,13 @@ function camelCaseToWords(value) {
|
|
|
12574
12582
|
* This source code is licensed under the MIT license found in the
|
|
12575
12583
|
* LICENSE file in the root directory of this source tree.
|
|
12576
12584
|
*/
|
|
12577
|
-
var __classPrivateFieldSet$
|
|
12585
|
+
var __classPrivateFieldSet$2 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
12578
12586
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12579
12587
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
12580
12588
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
12581
12589
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
12582
12590
|
};
|
|
12583
|
-
var __classPrivateFieldGet$
|
|
12591
|
+
var __classPrivateFieldGet$2 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12584
12592
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
12585
12593
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
12586
12594
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -12590,15 +12598,15 @@ class Name {
|
|
|
12590
12598
|
constructor(data) {
|
|
12591
12599
|
_Name_asn.set(this, new Name$1());
|
|
12592
12600
|
if (BufferSourceConverter.isBufferSource(data)) {
|
|
12593
|
-
__classPrivateFieldSet$
|
|
12601
|
+
__classPrivateFieldSet$2(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
|
|
12594
12602
|
}
|
|
12595
12603
|
else {
|
|
12596
|
-
__classPrivateFieldSet$
|
|
12604
|
+
__classPrivateFieldSet$2(this, _Name_asn, data, "f");
|
|
12597
12605
|
}
|
|
12598
12606
|
}
|
|
12599
12607
|
toJSON() {
|
|
12600
12608
|
const res = [];
|
|
12601
|
-
__classPrivateFieldGet$
|
|
12609
|
+
__classPrivateFieldGet$2(this, _Name_asn, "f").forEach((o) => (o.forEach((a) => {
|
|
12602
12610
|
res.push({
|
|
12603
12611
|
type: a.type,
|
|
12604
12612
|
name: OIDs[a.type],
|
|
@@ -14162,13 +14170,13 @@ __decorate([
|
|
|
14162
14170
|
* This source code is licensed under the MIT license found in the
|
|
14163
14171
|
* LICENSE file in the root directory of this source tree.
|
|
14164
14172
|
*/
|
|
14165
|
-
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14173
|
+
var __classPrivateFieldSet$1 = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
14166
14174
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
14167
14175
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14168
14176
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14169
14177
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
14170
14178
|
};
|
|
14171
|
-
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14179
|
+
var __classPrivateFieldGet$1 = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
14172
14180
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
14173
14181
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
14174
14182
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
@@ -14181,20 +14189,20 @@ class AsnData {
|
|
|
14181
14189
|
_AsnData_raw.set(this, void 0);
|
|
14182
14190
|
if (args.length === 1) {
|
|
14183
14191
|
// asn
|
|
14184
|
-
__classPrivateFieldSet(this, _AsnData_asn, args[0], "f");
|
|
14185
|
-
__classPrivateFieldSet(this, _AsnData_raw, AsnConvert.serialize(__classPrivateFieldGet(this, _AsnData_asn, "f")), "f");
|
|
14192
|
+
__classPrivateFieldSet$1(this, _AsnData_asn, args[0], "f");
|
|
14193
|
+
__classPrivateFieldSet$1(this, _AsnData_raw, AsnConvert.serialize(__classPrivateFieldGet$1(this, _AsnData_asn, "f")), "f");
|
|
14186
14194
|
}
|
|
14187
14195
|
else {
|
|
14188
14196
|
// raw, type
|
|
14189
|
-
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
14190
|
-
__classPrivateFieldSet(this, _AsnData_raw, BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
14197
|
+
__classPrivateFieldSet$1(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
14198
|
+
__classPrivateFieldSet$1(this, _AsnData_raw, BufferSourceConverter.toArrayBuffer(args[0]), "f");
|
|
14191
14199
|
}
|
|
14192
14200
|
}
|
|
14193
14201
|
get asn() {
|
|
14194
|
-
return __classPrivateFieldGet(this, _AsnData_asn, "f");
|
|
14202
|
+
return __classPrivateFieldGet$1(this, _AsnData_asn, "f");
|
|
14195
14203
|
}
|
|
14196
14204
|
get raw() {
|
|
14197
|
-
return __classPrivateFieldGet(this, _AsnData_raw, "f");
|
|
14205
|
+
return __classPrivateFieldGet$1(this, _AsnData_raw, "f");
|
|
14198
14206
|
}
|
|
14199
14207
|
}
|
|
14200
14208
|
_AsnData_asn = new WeakMap(), _AsnData_raw = new WeakMap();
|
|
@@ -16642,6 +16650,1645 @@ class X509Certificates extends Array {
|
|
|
16642
16650
|
}
|
|
16643
16651
|
}
|
|
16644
16652
|
|
|
16653
|
+
let globalCrypto = globalThis.crypto;
|
|
16654
|
+
function getCrypto() {
|
|
16655
|
+
return globalCrypto;
|
|
16656
|
+
}
|
|
16657
|
+
|
|
16658
|
+
class SshError extends Error {
|
|
16659
|
+
code;
|
|
16660
|
+
constructor(message, code) {
|
|
16661
|
+
super(message);
|
|
16662
|
+
this.code = code;
|
|
16663
|
+
this.name = this.constructor.name;
|
|
16664
|
+
if (Error.captureStackTrace) {
|
|
16665
|
+
Error.captureStackTrace(this, this.constructor);
|
|
16666
|
+
}
|
|
16667
|
+
}
|
|
16668
|
+
}
|
|
16669
|
+
class UnsupportedAlgorithmError extends SshError {
|
|
16670
|
+
constructor(algorithm, supportedAlgorithms) {
|
|
16671
|
+
const supported = supportedAlgorithms ? ` Supported: ${supportedAlgorithms.join(', ')}` : '';
|
|
16672
|
+
super(`Unsupported algorithm: ${algorithm}.${supported}`, 'UNSUPPORTED_ALGORITHM');
|
|
16673
|
+
}
|
|
16674
|
+
}
|
|
16675
|
+
class InvalidFormatError extends SshError {
|
|
16676
|
+
constructor(format, expectedFormat) {
|
|
16677
|
+
const expected = expectedFormat ? ` Expected: ${expectedFormat}` : '';
|
|
16678
|
+
super(`Invalid format: ${format}.${expected}`, 'INVALID_FORMAT');
|
|
16679
|
+
}
|
|
16680
|
+
}
|
|
16681
|
+
class UnsupportedKeyTypeError extends SshError {
|
|
16682
|
+
constructor(keyType, supportedTypes) {
|
|
16683
|
+
const supported = supportedTypes ? ` Supported: ${supportedTypes.join(', ')}` : '';
|
|
16684
|
+
super(`Unsupported key type: ${keyType}.${supported}`, 'UNSUPPORTED_KEY_TYPE');
|
|
16685
|
+
}
|
|
16686
|
+
}
|
|
16687
|
+
class InvalidPrivateKeyFormatError extends SshError {
|
|
16688
|
+
constructor(details) {
|
|
16689
|
+
const message = details
|
|
16690
|
+
? `Invalid SSH private key format: ${details}`
|
|
16691
|
+
: 'Invalid SSH private key format';
|
|
16692
|
+
super(message, 'INVALID_PRIVATE_KEY_FORMAT');
|
|
16693
|
+
}
|
|
16694
|
+
}
|
|
16695
|
+
class EncryptedKeyNotSupportedError extends SshError {
|
|
16696
|
+
constructor(cipher) {
|
|
16697
|
+
const message = cipher
|
|
16698
|
+
? `Encrypted SSH private keys are not supported (cipher: ${cipher})`
|
|
16699
|
+
: 'Encrypted SSH private keys are not supported';
|
|
16700
|
+
super(message, 'ENCRYPTED_KEY_NOT_SUPPORTED');
|
|
16701
|
+
}
|
|
16702
|
+
}
|
|
16703
|
+
class InvalidKeyDataError extends SshError {
|
|
16704
|
+
constructor(details) {
|
|
16705
|
+
const message = details ? `Invalid key data: ${details}` : 'Invalid key data';
|
|
16706
|
+
super(message, 'INVALID_KEY_DATA');
|
|
16707
|
+
}
|
|
16708
|
+
}
|
|
16709
|
+
class UnexpectedEOFError extends SshError {
|
|
16710
|
+
constructor(expected, actual) {
|
|
16711
|
+
const details = expected !== undefined && actual !== undefined
|
|
16712
|
+
? ` Expected ${expected} bytes, got ${actual}`
|
|
16713
|
+
: '';
|
|
16714
|
+
super(`Unexpected end of data${details}`, 'UNEXPECTED_EOF');
|
|
16715
|
+
}
|
|
16716
|
+
}
|
|
16717
|
+
|
|
16718
|
+
const encoder = new TextEncoder();
|
|
16719
|
+
const decoder = new TextDecoder();
|
|
16720
|
+
|
|
16721
|
+
class SshReader {
|
|
16722
|
+
buffer;
|
|
16723
|
+
offset;
|
|
16724
|
+
constructor(data) {
|
|
16725
|
+
this.buffer = data;
|
|
16726
|
+
this.offset = 0;
|
|
16727
|
+
}
|
|
16728
|
+
readUint8() {
|
|
16729
|
+
if (this.offset >= this.buffer.length) {
|
|
16730
|
+
throw new UnexpectedEOFError(1, 0);
|
|
16731
|
+
}
|
|
16732
|
+
return this.buffer[this.offset++];
|
|
16733
|
+
}
|
|
16734
|
+
readUint32() {
|
|
16735
|
+
const value = (this.readUint8() << 24) |
|
|
16736
|
+
(this.readUint8() << 16) |
|
|
16737
|
+
(this.readUint8() << 8) |
|
|
16738
|
+
this.readUint8();
|
|
16739
|
+
return value >>> 0;
|
|
16740
|
+
}
|
|
16741
|
+
readUint64() {
|
|
16742
|
+
const high = this.readUint32();
|
|
16743
|
+
const low = this.readUint32();
|
|
16744
|
+
return (BigInt(high) << 32n) | BigInt(low);
|
|
16745
|
+
}
|
|
16746
|
+
readBytes(length) {
|
|
16747
|
+
if (length < 0) {
|
|
16748
|
+
throw new InvalidFormatError(`Invalid length: ${length}`);
|
|
16749
|
+
}
|
|
16750
|
+
if (this.offset + length > this.buffer.length) {
|
|
16751
|
+
throw new UnexpectedEOFError(length, this.buffer.length - this.offset);
|
|
16752
|
+
}
|
|
16753
|
+
const result = this.buffer.subarray(this.offset, this.offset + length);
|
|
16754
|
+
this.offset += length;
|
|
16755
|
+
return result;
|
|
16756
|
+
}
|
|
16757
|
+
readString() {
|
|
16758
|
+
const length = this.readUint32();
|
|
16759
|
+
const bytes = this.readBytes(length);
|
|
16760
|
+
return decoder.decode(bytes);
|
|
16761
|
+
}
|
|
16762
|
+
peekString(length) {
|
|
16763
|
+
if (this.offset + length > this.buffer.length) {
|
|
16764
|
+
throw new UnexpectedEOFError(length, this.buffer.length - this.offset);
|
|
16765
|
+
}
|
|
16766
|
+
const bytes = this.buffer.subarray(this.offset, this.offset + length);
|
|
16767
|
+
return decoder.decode(bytes);
|
|
16768
|
+
}
|
|
16769
|
+
readMpInt(sshEncoding = false) {
|
|
16770
|
+
const length = this.readUint32();
|
|
16771
|
+
const bytes = this.readBytes(length);
|
|
16772
|
+
if (sshEncoding && bytes.length > 1 && bytes[0] === 0x00) {
|
|
16773
|
+
return bytes.subarray(1);
|
|
16774
|
+
}
|
|
16775
|
+
return bytes;
|
|
16776
|
+
}
|
|
16777
|
+
readMpIntSsh() {
|
|
16778
|
+
return this.readMpInt(true);
|
|
16779
|
+
}
|
|
16780
|
+
remaining() {
|
|
16781
|
+
return this.buffer.length - this.offset;
|
|
16782
|
+
}
|
|
16783
|
+
getOffset() {
|
|
16784
|
+
return this.offset;
|
|
16785
|
+
}
|
|
16786
|
+
seek(offset) {
|
|
16787
|
+
if (offset < 0 || offset > this.buffer.length) {
|
|
16788
|
+
throw new InvalidFormatError(`Invalid offset: ${offset}. Buffer length: ${this.buffer.length}`);
|
|
16789
|
+
}
|
|
16790
|
+
this.offset = offset;
|
|
16791
|
+
}
|
|
16792
|
+
}
|
|
16793
|
+
|
|
16794
|
+
class SshWriter {
|
|
16795
|
+
buffer;
|
|
16796
|
+
offset;
|
|
16797
|
+
constructor(initialSize = 1024) {
|
|
16798
|
+
this.buffer = new Uint8Array(initialSize);
|
|
16799
|
+
this.offset = 0;
|
|
16800
|
+
}
|
|
16801
|
+
ensureCapacity(additional) {
|
|
16802
|
+
const required = this.offset + additional;
|
|
16803
|
+
if (required > this.buffer.length) {
|
|
16804
|
+
const newSize = Math.max(required, this.buffer.length * 2);
|
|
16805
|
+
const newBuffer = new Uint8Array(newSize);
|
|
16806
|
+
newBuffer.set(this.buffer.subarray(0, this.offset));
|
|
16807
|
+
this.buffer = newBuffer;
|
|
16808
|
+
}
|
|
16809
|
+
}
|
|
16810
|
+
reserve(minCapacity) {
|
|
16811
|
+
if (minCapacity > this.buffer.length) {
|
|
16812
|
+
const newBuffer = new Uint8Array(minCapacity);
|
|
16813
|
+
newBuffer.set(this.buffer.subarray(0, this.offset));
|
|
16814
|
+
this.buffer = newBuffer;
|
|
16815
|
+
}
|
|
16816
|
+
}
|
|
16817
|
+
writeUint8(value) {
|
|
16818
|
+
this.ensureCapacity(1);
|
|
16819
|
+
this.buffer[this.offset++] = value & 0xff;
|
|
16820
|
+
}
|
|
16821
|
+
writeUint32(value) {
|
|
16822
|
+
this.ensureCapacity(4);
|
|
16823
|
+
this.buffer[this.offset++] = (value >>> 24) & 0xff;
|
|
16824
|
+
this.buffer[this.offset++] = (value >>> 16) & 0xff;
|
|
16825
|
+
this.buffer[this.offset++] = (value >>> 8) & 0xff;
|
|
16826
|
+
this.buffer[this.offset++] = value & 0xff;
|
|
16827
|
+
}
|
|
16828
|
+
writeUint64(value) {
|
|
16829
|
+
this.ensureCapacity(8);
|
|
16830
|
+
const high = Number(value >> 32n);
|
|
16831
|
+
const low = Number(value & 0xffffffffn);
|
|
16832
|
+
this.writeUint32(high);
|
|
16833
|
+
this.writeUint32(low);
|
|
16834
|
+
}
|
|
16835
|
+
writeBytes(data) {
|
|
16836
|
+
this.ensureCapacity(data.length);
|
|
16837
|
+
this.buffer.set(data, this.offset);
|
|
16838
|
+
this.offset += data.length;
|
|
16839
|
+
}
|
|
16840
|
+
writeString(value) {
|
|
16841
|
+
const bytes = encoder.encode(value);
|
|
16842
|
+
this.writeUint32(bytes.length);
|
|
16843
|
+
this.writeBytes(bytes);
|
|
16844
|
+
}
|
|
16845
|
+
writeMpInt(value, sshEncoding = false) {
|
|
16846
|
+
if (sshEncoding && value.length > 0 && (value[0] & 0x80) !== 0) {
|
|
16847
|
+
const paddedBytes = new Uint8Array(value.length + 1);
|
|
16848
|
+
paddedBytes[0] = 0x00;
|
|
16849
|
+
paddedBytes.set(value, 1);
|
|
16850
|
+
this.writeUint32(paddedBytes.length);
|
|
16851
|
+
this.writeBytes(paddedBytes);
|
|
16852
|
+
}
|
|
16853
|
+
else {
|
|
16854
|
+
this.writeUint32(value.length);
|
|
16855
|
+
this.writeBytes(value);
|
|
16856
|
+
}
|
|
16857
|
+
}
|
|
16858
|
+
writeMpIntSsh(value) {
|
|
16859
|
+
this.writeMpInt(value, true);
|
|
16860
|
+
}
|
|
16861
|
+
toUint8Array() {
|
|
16862
|
+
return this.buffer.subarray(0, this.offset);
|
|
16863
|
+
}
|
|
16864
|
+
getOffset() {
|
|
16865
|
+
return this.offset;
|
|
16866
|
+
}
|
|
16867
|
+
seek(offset) {
|
|
16868
|
+
if (offset < 0 || offset > this.buffer.length) {
|
|
16869
|
+
throw new InvalidFormatError('Invalid offset');
|
|
16870
|
+
}
|
|
16871
|
+
this.offset = offset;
|
|
16872
|
+
}
|
|
16873
|
+
}
|
|
16874
|
+
|
|
16875
|
+
class RsaBinding {
|
|
16876
|
+
hash = 'SHA-256';
|
|
16877
|
+
constructor(hash = 'SHA-256') {
|
|
16878
|
+
this.hash = hash;
|
|
16879
|
+
}
|
|
16880
|
+
async importPublicSsh(params) {
|
|
16881
|
+
const { blob, crypto } = params;
|
|
16882
|
+
const reader = new SshReader(blob);
|
|
16883
|
+
reader.readString();
|
|
16884
|
+
const e = reader.readMpInt(true);
|
|
16885
|
+
const n = reader.readMpInt(true);
|
|
16886
|
+
const jwk = {
|
|
16887
|
+
kty: 'RSA',
|
|
16888
|
+
n: Convert.ToBase64Url(n),
|
|
16889
|
+
e: Convert.ToBase64Url(e),
|
|
16890
|
+
};
|
|
16891
|
+
return crypto.subtle.importKey('jwk', jwk, {
|
|
16892
|
+
name: 'RSASSA-PKCS1-v1_5',
|
|
16893
|
+
hash: this.hash,
|
|
16894
|
+
}, true, ['verify']);
|
|
16895
|
+
}
|
|
16896
|
+
async exportPublicSsh(params) {
|
|
16897
|
+
const { publicKey, crypto } = params;
|
|
16898
|
+
const jwk = await crypto.subtle.exportKey('jwk', publicKey);
|
|
16899
|
+
if (!jwk.n || !jwk.e) {
|
|
16900
|
+
throw new InvalidKeyDataError('RSA JWK missing required parameters (n, e)');
|
|
16901
|
+
}
|
|
16902
|
+
const n = BufferSourceConverter.toUint8Array(Convert.FromBase64Url(jwk.n));
|
|
16903
|
+
const e = BufferSourceConverter.toUint8Array(Convert.FromBase64Url(jwk.e));
|
|
16904
|
+
const writer = new SshWriter();
|
|
16905
|
+
writer.writeString('ssh-rsa');
|
|
16906
|
+
writer.writeMpInt(e, true);
|
|
16907
|
+
writer.writeMpInt(n, true);
|
|
16908
|
+
return writer.toUint8Array();
|
|
16909
|
+
}
|
|
16910
|
+
async importPublicSpki(params) {
|
|
16911
|
+
const { spki, crypto } = params;
|
|
16912
|
+
return crypto.subtle.importKey('spki', spki, {
|
|
16913
|
+
name: 'RSASSA-PKCS1-v1_5',
|
|
16914
|
+
hash: this.hash,
|
|
16915
|
+
}, true, ['verify']);
|
|
16916
|
+
}
|
|
16917
|
+
async exportPublicSpki(params) {
|
|
16918
|
+
const { publicKey, crypto } = params;
|
|
16919
|
+
const spki = await crypto.subtle.exportKey('spki', publicKey);
|
|
16920
|
+
return BufferSourceConverter.toUint8Array(spki);
|
|
16921
|
+
}
|
|
16922
|
+
async importPrivatePkcs8(params) {
|
|
16923
|
+
const { pkcs8, crypto } = params;
|
|
16924
|
+
return crypto.subtle.importKey('pkcs8', pkcs8, {
|
|
16925
|
+
name: 'RSASSA-PKCS1-v1_5',
|
|
16926
|
+
hash: this.hash,
|
|
16927
|
+
}, true, ['sign']);
|
|
16928
|
+
}
|
|
16929
|
+
async exportPrivatePkcs8(params) {
|
|
16930
|
+
const { privateKey, crypto } = params;
|
|
16931
|
+
const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
|
|
16932
|
+
return BufferSourceConverter.toUint8Array(pkcs8);
|
|
16933
|
+
}
|
|
16934
|
+
async importPrivateSsh(params) {
|
|
16935
|
+
const { sshKey, crypto } = params;
|
|
16936
|
+
const base64Data = sshKey
|
|
16937
|
+
.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
|
|
16938
|
+
.replace(/-----END OPENSSH PRIVATE KEY-----/, '')
|
|
16939
|
+
.replace(/\s/g, '');
|
|
16940
|
+
const binaryData = Convert.FromBase64(base64Data);
|
|
16941
|
+
const reader = new SshReader(BufferSourceConverter.toUint8Array(binaryData));
|
|
16942
|
+
const magic = reader.readBytes(15);
|
|
16943
|
+
if (Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
|
|
16944
|
+
throw new InvalidPrivateKeyFormatError('invalid magic string');
|
|
16945
|
+
}
|
|
16946
|
+
const _cipherName = reader.readString();
|
|
16947
|
+
reader.readString();
|
|
16948
|
+
reader.readString();
|
|
16949
|
+
if (_cipherName !== 'none') {
|
|
16950
|
+
throw new EncryptedKeyNotSupportedError(_cipherName);
|
|
16951
|
+
}
|
|
16952
|
+
const numKeys = reader.readUint32();
|
|
16953
|
+
if (numKeys !== 1) {
|
|
16954
|
+
throw new InvalidPrivateKeyFormatError('multiple keys not supported');
|
|
16955
|
+
}
|
|
16956
|
+
const publicKeyLength = reader.readUint32();
|
|
16957
|
+
reader.readBytes(publicKeyLength);
|
|
16958
|
+
const privateKeyLength = reader.readUint32();
|
|
16959
|
+
const privateKeyData = reader.readBytes(privateKeyLength);
|
|
16960
|
+
const privateReader = new SshReader(privateKeyData);
|
|
16961
|
+
const checkint1 = privateReader.readUint32();
|
|
16962
|
+
const checkint2 = privateReader.readUint32();
|
|
16963
|
+
if (checkint1 !== checkint2) {
|
|
16964
|
+
throw new InvalidPrivateKeyFormatError('invalid checkints');
|
|
16965
|
+
}
|
|
16966
|
+
privateReader.readString();
|
|
16967
|
+
const n = privateReader.readMpInt(true);
|
|
16968
|
+
const e = privateReader.readMpInt(true);
|
|
16969
|
+
const d = privateReader.readMpInt(true);
|
|
16970
|
+
const iqmp = privateReader.readMpInt(true);
|
|
16971
|
+
const p = privateReader.readMpInt(true);
|
|
16972
|
+
const q = privateReader.readMpInt(true);
|
|
16973
|
+
privateReader.readString();
|
|
16974
|
+
const dBig = BigInt('0x' + Convert.ToHex(d));
|
|
16975
|
+
const pBig = BigInt('0x' + Convert.ToHex(p));
|
|
16976
|
+
const qBig = BigInt('0x' + Convert.ToHex(q));
|
|
16977
|
+
const dpBig = dBig % (pBig - 1n);
|
|
16978
|
+
const dqBig = dBig % (qBig - 1n);
|
|
16979
|
+
const dpBytes = Convert.FromHex(dpBig.toString(16).padStart(p.length * 2, '0'));
|
|
16980
|
+
const dqBytes = Convert.FromHex(dqBig.toString(16).padStart(q.length * 2, '0'));
|
|
16981
|
+
const jwk = {
|
|
16982
|
+
kty: 'RSA',
|
|
16983
|
+
n: Convert.ToBase64Url(n),
|
|
16984
|
+
e: Convert.ToBase64Url(e),
|
|
16985
|
+
d: Convert.ToBase64Url(d),
|
|
16986
|
+
p: Convert.ToBase64Url(p),
|
|
16987
|
+
q: Convert.ToBase64Url(q),
|
|
16988
|
+
dp: Convert.ToBase64Url(dpBytes),
|
|
16989
|
+
dq: Convert.ToBase64Url(dqBytes),
|
|
16990
|
+
qi: Convert.ToBase64Url(iqmp),
|
|
16991
|
+
};
|
|
16992
|
+
return crypto.subtle.importKey('jwk', jwk, {
|
|
16993
|
+
name: 'RSASSA-PKCS1-v1_5',
|
|
16994
|
+
hash: this.hash,
|
|
16995
|
+
}, true, ['sign']);
|
|
16996
|
+
}
|
|
16997
|
+
async exportPrivateSsh(params) {
|
|
16998
|
+
const { privateKey, crypto, jwk: providedJwk } = params;
|
|
16999
|
+
const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
|
|
17000
|
+
if (!jwk.n || !jwk.e || !jwk.d || !jwk.p || !jwk.q) {
|
|
17001
|
+
throw new InvalidKeyDataError('RSA JWK missing required parameters');
|
|
17002
|
+
}
|
|
17003
|
+
const n = new Uint8Array(Convert.FromBase64Url(jwk.n));
|
|
17004
|
+
const e = new Uint8Array(Convert.FromBase64Url(jwk.e));
|
|
17005
|
+
const d = new Uint8Array(Convert.FromBase64Url(jwk.d));
|
|
17006
|
+
const p = new Uint8Array(Convert.FromBase64Url(jwk.p));
|
|
17007
|
+
const q = new Uint8Array(Convert.FromBase64Url(jwk.q));
|
|
17008
|
+
const qi = jwk.qi ? new Uint8Array(Convert.FromBase64Url(jwk.qi)) : new Uint8Array();
|
|
17009
|
+
const writer = new SshWriter();
|
|
17010
|
+
writer.writeString('ssh-rsa');
|
|
17011
|
+
writer.writeMpInt(n, true);
|
|
17012
|
+
writer.writeMpInt(e, true);
|
|
17013
|
+
writer.writeMpInt(d, true);
|
|
17014
|
+
writer.writeMpInt(qi, true);
|
|
17015
|
+
writer.writeMpInt(p, true);
|
|
17016
|
+
writer.writeMpInt(q, true);
|
|
17017
|
+
return writer.toUint8Array();
|
|
17018
|
+
}
|
|
17019
|
+
async sign(params) {
|
|
17020
|
+
const { privateKey, data, crypto, hash } = params;
|
|
17021
|
+
if (hash && hash !== this.hash) {
|
|
17022
|
+
throw new InvalidKeyDataError(`Hash ${hash} not supported for this RSA algorithm`);
|
|
17023
|
+
}
|
|
17024
|
+
if (!privateKey.extractable) {
|
|
17025
|
+
throw new InvalidKeyDataError('Private key is not extractable');
|
|
17026
|
+
}
|
|
17027
|
+
const pkcs8 = await this.exportPrivatePkcs8({ privateKey, crypto });
|
|
17028
|
+
const keyToUse = await this.importPrivatePkcs8({ pkcs8: new Uint8Array(pkcs8), crypto });
|
|
17029
|
+
const signature = await crypto.subtle.sign('RSASSA-PKCS1-v1_5', keyToUse, data);
|
|
17030
|
+
return BufferSourceConverter.toUint8Array(signature);
|
|
17031
|
+
}
|
|
17032
|
+
async verify(params) {
|
|
17033
|
+
const { publicKey, signature, data, crypto, hash } = params;
|
|
17034
|
+
if (hash && hash !== this.hash) {
|
|
17035
|
+
return false;
|
|
17036
|
+
}
|
|
17037
|
+
if (!publicKey.extractable) {
|
|
17038
|
+
throw new InvalidKeyDataError('Public key is not extractable');
|
|
17039
|
+
}
|
|
17040
|
+
const spki = await this.exportPublicSpki({ publicKey, crypto });
|
|
17041
|
+
const keyToUse = await this.importPublicSpki({ spki: new Uint8Array(spki), crypto });
|
|
17042
|
+
return crypto.subtle.verify('RSASSA-PKCS1-v1_5', keyToUse, signature, data);
|
|
17043
|
+
}
|
|
17044
|
+
encodeSignature(params) {
|
|
17045
|
+
const { signature, algo } = params;
|
|
17046
|
+
const writer = new SshWriter();
|
|
17047
|
+
writer.writeString(algo);
|
|
17048
|
+
writer.writeUint32(signature.byteLength);
|
|
17049
|
+
writer.writeBytes(signature);
|
|
17050
|
+
return writer.toUint8Array();
|
|
17051
|
+
}
|
|
17052
|
+
decodeSignature(params) {
|
|
17053
|
+
const { signature } = params;
|
|
17054
|
+
const reader = new SshReader(signature);
|
|
17055
|
+
const algo = reader.readString();
|
|
17056
|
+
const sigLength = reader.readUint32();
|
|
17057
|
+
const sig = reader.readBytes(sigLength);
|
|
17058
|
+
return { signature: sig, algo };
|
|
17059
|
+
}
|
|
17060
|
+
supportsCryptoKey(cryptoKey) {
|
|
17061
|
+
return cryptoKey.algorithm.name === 'RSASSA-PKCS1-v1_5';
|
|
17062
|
+
}
|
|
17063
|
+
parsePublicKey(reader) {
|
|
17064
|
+
const publicKeyExponent = reader.readBytes(reader.readUint32());
|
|
17065
|
+
const publicKeyModulus = reader.readBytes(reader.readUint32());
|
|
17066
|
+
const writer = new SshWriter();
|
|
17067
|
+
writer.writeString('ssh-rsa');
|
|
17068
|
+
writer.writeMpInt(publicKeyExponent);
|
|
17069
|
+
writer.writeMpInt(publicKeyModulus);
|
|
17070
|
+
return {
|
|
17071
|
+
type: 'ssh-rsa',
|
|
17072
|
+
keyData: writer.toUint8Array(),
|
|
17073
|
+
};
|
|
17074
|
+
}
|
|
17075
|
+
writePublicKey(writer, publicKey) {
|
|
17076
|
+
const publicKeyReader = new SshReader(publicKey.keyData);
|
|
17077
|
+
publicKeyReader.readString();
|
|
17078
|
+
const e = publicKeyReader.readMpInt();
|
|
17079
|
+
const n = publicKeyReader.readMpInt();
|
|
17080
|
+
writer.writeUint32(e.length);
|
|
17081
|
+
writer.writeBytes(e);
|
|
17082
|
+
writer.writeUint32(n.length);
|
|
17083
|
+
writer.writeBytes(n);
|
|
17084
|
+
}
|
|
17085
|
+
getCertificateType() {
|
|
17086
|
+
return 'ssh-rsa-cert-v01@openssh.com';
|
|
17087
|
+
}
|
|
17088
|
+
getSignatureAlgo() {
|
|
17089
|
+
return this.hash === 'SHA-256' ? 'rsa-sha2-256' : 'rsa-sha2-512';
|
|
17090
|
+
}
|
|
17091
|
+
}
|
|
17092
|
+
|
|
17093
|
+
class EcdsaBinding {
|
|
17094
|
+
curveName;
|
|
17095
|
+
sshType;
|
|
17096
|
+
namedCurve;
|
|
17097
|
+
constructor(curveName, sshType, namedCurve) {
|
|
17098
|
+
this.curveName = curveName;
|
|
17099
|
+
this.sshType = sshType;
|
|
17100
|
+
this.namedCurve = namedCurve;
|
|
17101
|
+
}
|
|
17102
|
+
getHashAlgorithm() {
|
|
17103
|
+
switch (this.namedCurve) {
|
|
17104
|
+
case 'P-256':
|
|
17105
|
+
return 'SHA-256';
|
|
17106
|
+
case 'P-384':
|
|
17107
|
+
return 'SHA-384';
|
|
17108
|
+
case 'P-521':
|
|
17109
|
+
return 'SHA-512';
|
|
17110
|
+
default:
|
|
17111
|
+
return 'SHA-256';
|
|
17112
|
+
}
|
|
17113
|
+
}
|
|
17114
|
+
getExpectedLength() {
|
|
17115
|
+
switch (this.namedCurve) {
|
|
17116
|
+
case 'P-256':
|
|
17117
|
+
return 32;
|
|
17118
|
+
case 'P-384':
|
|
17119
|
+
return 48;
|
|
17120
|
+
case 'P-521':
|
|
17121
|
+
return 66;
|
|
17122
|
+
default:
|
|
17123
|
+
return 32;
|
|
17124
|
+
}
|
|
17125
|
+
}
|
|
17126
|
+
getSignatureCoordLength() {
|
|
17127
|
+
return this.getExpectedLength();
|
|
17128
|
+
}
|
|
17129
|
+
async importPublicSsh(params) {
|
|
17130
|
+
const { blob, crypto } = params;
|
|
17131
|
+
const reader = new SshReader(blob);
|
|
17132
|
+
reader.readString();
|
|
17133
|
+
const curve = reader.readString();
|
|
17134
|
+
if (curve !== this.curveName) {
|
|
17135
|
+
throw new InvalidKeyDataError(`ECDSA curve name ${curve}, expected ${this.curveName}`);
|
|
17136
|
+
}
|
|
17137
|
+
const q = reader.readMpInt();
|
|
17138
|
+
const coordLength = Math.floor((q.length - 1) / 2);
|
|
17139
|
+
const jwk = {
|
|
17140
|
+
kty: 'EC',
|
|
17141
|
+
crv: this.namedCurve,
|
|
17142
|
+
x: Convert.ToBase64Url(q.slice(1, 1 + coordLength)),
|
|
17143
|
+
y: Convert.ToBase64Url(q.slice(1 + coordLength)),
|
|
17144
|
+
};
|
|
17145
|
+
return crypto.subtle.importKey('jwk', jwk, {
|
|
17146
|
+
name: 'ECDSA',
|
|
17147
|
+
namedCurve: this.namedCurve,
|
|
17148
|
+
}, true, ['verify']);
|
|
17149
|
+
}
|
|
17150
|
+
async exportPublicSsh(params) {
|
|
17151
|
+
const { publicKey, crypto } = params;
|
|
17152
|
+
const jwk = await crypto.subtle.exportKey('jwk', publicKey);
|
|
17153
|
+
if (!jwk.x || !jwk.y) {
|
|
17154
|
+
throw new InvalidKeyDataError('ECDSA JWK missing x or y parameters');
|
|
17155
|
+
}
|
|
17156
|
+
const x = new Uint8Array(Convert.FromBase64Url(jwk.x));
|
|
17157
|
+
const y = new Uint8Array(Convert.FromBase64Url(jwk.y));
|
|
17158
|
+
const q = new Uint8Array(1 + x.length + y.length);
|
|
17159
|
+
q[0] = 0x04;
|
|
17160
|
+
q.set(x, 1);
|
|
17161
|
+
q.set(y, 1 + x.length);
|
|
17162
|
+
const writer = new SshWriter();
|
|
17163
|
+
writer.writeString(this.sshType);
|
|
17164
|
+
writer.writeString(this.curveName);
|
|
17165
|
+
writer.writeMpInt(q);
|
|
17166
|
+
return writer.toUint8Array();
|
|
17167
|
+
}
|
|
17168
|
+
async importPublicSpki(params) {
|
|
17169
|
+
const { spki, crypto } = params;
|
|
17170
|
+
return crypto.subtle.importKey('spki', spki, {
|
|
17171
|
+
name: 'ECDSA',
|
|
17172
|
+
namedCurve: this.namedCurve,
|
|
17173
|
+
}, true, ['verify']);
|
|
17174
|
+
}
|
|
17175
|
+
async exportPublicSpki(params) {
|
|
17176
|
+
const { publicKey, crypto } = params;
|
|
17177
|
+
const spki = await crypto.subtle.exportKey('spki', publicKey);
|
|
17178
|
+
return BufferSourceConverter.toUint8Array(spki);
|
|
17179
|
+
}
|
|
17180
|
+
async importPrivatePkcs8(params) {
|
|
17181
|
+
const { pkcs8, crypto } = params;
|
|
17182
|
+
return crypto.subtle.importKey('pkcs8', pkcs8, {
|
|
17183
|
+
name: 'ECDSA',
|
|
17184
|
+
namedCurve: this.namedCurve,
|
|
17185
|
+
}, true, ['sign']);
|
|
17186
|
+
}
|
|
17187
|
+
async exportPrivatePkcs8(params) {
|
|
17188
|
+
const { privateKey, crypto } = params;
|
|
17189
|
+
const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
|
|
17190
|
+
return BufferSourceConverter.toUint8Array(pkcs8);
|
|
17191
|
+
}
|
|
17192
|
+
async exportPrivateSsh(params) {
|
|
17193
|
+
const { privateKey, crypto, jwk: providedJwk } = params;
|
|
17194
|
+
const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
|
|
17195
|
+
if (!jwk.d || !jwk.x || !jwk.y) {
|
|
17196
|
+
throw new InvalidKeyDataError('ECDSA private key JWK missing required parameters');
|
|
17197
|
+
}
|
|
17198
|
+
const x = new Uint8Array(Convert.FromBase64Url(jwk.x));
|
|
17199
|
+
const y = new Uint8Array(Convert.FromBase64Url(jwk.y));
|
|
17200
|
+
const d = new Uint8Array(Convert.FromBase64Url(jwk.d));
|
|
17201
|
+
const publicPoint = new Uint8Array(1 + x.length + y.length);
|
|
17202
|
+
publicPoint[0] = 0x04;
|
|
17203
|
+
publicPoint.set(x, 1);
|
|
17204
|
+
publicPoint.set(y, 1 + x.length);
|
|
17205
|
+
const writer = new SshWriter();
|
|
17206
|
+
writer.writeString(this.sshType);
|
|
17207
|
+
writer.writeString(this.curveName);
|
|
17208
|
+
writer.writeMpInt(publicPoint);
|
|
17209
|
+
writer.writeMpInt(d);
|
|
17210
|
+
return writer.toUint8Array();
|
|
17211
|
+
}
|
|
17212
|
+
async importPrivateSsh(params) {
|
|
17213
|
+
const { sshKey, crypto } = params;
|
|
17214
|
+
const base64Data = sshKey
|
|
17215
|
+
.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
|
|
17216
|
+
.replace(/-----END OPENSSH PRIVATE KEY-----/, '')
|
|
17217
|
+
.replace(/\s/g, '');
|
|
17218
|
+
const binaryData = Convert.FromBase64(base64Data);
|
|
17219
|
+
const reader = new SshReader(BufferSourceConverter.toUint8Array(binaryData));
|
|
17220
|
+
const magic = reader.readBytes(15);
|
|
17221
|
+
if (Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
|
|
17222
|
+
throw new InvalidPrivateKeyFormatError('invalid magic string');
|
|
17223
|
+
}
|
|
17224
|
+
const _cipherName = reader.readString();
|
|
17225
|
+
reader.readString();
|
|
17226
|
+
reader.readString();
|
|
17227
|
+
if (_cipherName !== 'none') {
|
|
17228
|
+
throw new EncryptedKeyNotSupportedError(_cipherName);
|
|
17229
|
+
}
|
|
17230
|
+
const numKeys = reader.readUint32();
|
|
17231
|
+
if (numKeys !== 1) {
|
|
17232
|
+
throw new InvalidPrivateKeyFormatError('multiple keys not supported');
|
|
17233
|
+
}
|
|
17234
|
+
const publicKeyLength = reader.readUint32();
|
|
17235
|
+
reader.readBytes(publicKeyLength);
|
|
17236
|
+
const privateKeyLength = reader.readUint32();
|
|
17237
|
+
const privateKeyData = reader.readBytes(privateKeyLength);
|
|
17238
|
+
const privateReader = new SshReader(privateKeyData);
|
|
17239
|
+
const checkint1 = privateReader.readUint32();
|
|
17240
|
+
const checkint2 = privateReader.readUint32();
|
|
17241
|
+
if (checkint1 !== checkint2) {
|
|
17242
|
+
throw new InvalidPrivateKeyFormatError('invalid checkints');
|
|
17243
|
+
}
|
|
17244
|
+
privateReader.readString();
|
|
17245
|
+
privateReader.readString();
|
|
17246
|
+
const publicKeyPoint = privateReader.readMpInt();
|
|
17247
|
+
const privateKeyValue = privateReader.readMpInt();
|
|
17248
|
+
privateReader.readString();
|
|
17249
|
+
if (publicKeyPoint[0] !== 0x04) {
|
|
17250
|
+
throw new InvalidKeyDataError('invalid ECDSA public key point format');
|
|
17251
|
+
}
|
|
17252
|
+
const coordLength = Math.floor((publicKeyPoint.length - 1) / 2);
|
|
17253
|
+
const x = publicKeyPoint.slice(1, 1 + coordLength);
|
|
17254
|
+
const y = publicKeyPoint.slice(1 + coordLength);
|
|
17255
|
+
const jwk = {
|
|
17256
|
+
kty: 'EC',
|
|
17257
|
+
crv: this.namedCurve,
|
|
17258
|
+
x: Convert.ToBase64Url(x),
|
|
17259
|
+
y: Convert.ToBase64Url(y),
|
|
17260
|
+
d: Convert.ToBase64Url(privateKeyValue),
|
|
17261
|
+
};
|
|
17262
|
+
return crypto.subtle.importKey('jwk', jwk, {
|
|
17263
|
+
name: 'ECDSA',
|
|
17264
|
+
namedCurve: this.namedCurve,
|
|
17265
|
+
}, true, ['sign']);
|
|
17266
|
+
}
|
|
17267
|
+
async sign(params) {
|
|
17268
|
+
const { privateKey, data, crypto, hash } = params;
|
|
17269
|
+
const expectedHash = this.getHashAlgorithm();
|
|
17270
|
+
if (hash && hash !== expectedHash) {
|
|
17271
|
+
throw new InvalidKeyDataError(`ECDSA ${this.namedCurve} requires ${expectedHash}, got ${hash}`);
|
|
17272
|
+
}
|
|
17273
|
+
const signature = await crypto.subtle.sign({
|
|
17274
|
+
name: 'ECDSA',
|
|
17275
|
+
hash: expectedHash,
|
|
17276
|
+
}, privateKey, data);
|
|
17277
|
+
return BufferSourceConverter.toUint8Array(signature);
|
|
17278
|
+
}
|
|
17279
|
+
async verify(params) {
|
|
17280
|
+
const { publicKey, signature, data, crypto, hash } = params;
|
|
17281
|
+
const expectedHash = this.getHashAlgorithm();
|
|
17282
|
+
if (hash && hash !== expectedHash) {
|
|
17283
|
+
throw new InvalidKeyDataError(`ECDSA ${this.namedCurve} requires ${expectedHash}, got ${hash}`);
|
|
17284
|
+
}
|
|
17285
|
+
return crypto.subtle.verify({
|
|
17286
|
+
name: 'ECDSA',
|
|
17287
|
+
hash: expectedHash,
|
|
17288
|
+
}, publicKey, signature, data);
|
|
17289
|
+
}
|
|
17290
|
+
encodeSignature(params) {
|
|
17291
|
+
const { signature, algo } = params;
|
|
17292
|
+
if (algo.startsWith('ecdsa-sha2-')) {
|
|
17293
|
+
const coordLength = this.getSignatureCoordLength();
|
|
17294
|
+
const r = signature.subarray(0, coordLength);
|
|
17295
|
+
const s = signature.subarray(coordLength);
|
|
17296
|
+
const writer = new SshWriter();
|
|
17297
|
+
writer.writeString(algo);
|
|
17298
|
+
const sigWriter = new SshWriter();
|
|
17299
|
+
sigWriter.writeMpInt(r, true);
|
|
17300
|
+
sigWriter.writeMpInt(s, true);
|
|
17301
|
+
const sigData = sigWriter.toUint8Array();
|
|
17302
|
+
writer.writeUint32(sigData.length);
|
|
17303
|
+
writer.writeBytes(sigData);
|
|
17304
|
+
return writer.toUint8Array();
|
|
17305
|
+
}
|
|
17306
|
+
const writer = new SshWriter();
|
|
17307
|
+
writer.writeString(algo);
|
|
17308
|
+
writer.writeUint32(signature.byteLength);
|
|
17309
|
+
writer.writeBytes(signature);
|
|
17310
|
+
return writer.toUint8Array();
|
|
17311
|
+
}
|
|
17312
|
+
decodeSignature(params) {
|
|
17313
|
+
const { signature } = params;
|
|
17314
|
+
const reader = new SshReader(signature);
|
|
17315
|
+
const algo = reader.readString();
|
|
17316
|
+
const sigLength = reader.readUint32();
|
|
17317
|
+
const sig = reader.readBytes(sigLength);
|
|
17318
|
+
if (algo.startsWith('ecdsa-sha2-')) {
|
|
17319
|
+
const sigReader = new SshReader(sig);
|
|
17320
|
+
let r = sigReader.readMpInt();
|
|
17321
|
+
let s = sigReader.readMpInt();
|
|
17322
|
+
if (r[0] === 0x00 && r.length > 1 && (r[1] & 0x80) === 0) {
|
|
17323
|
+
r = r.slice(1);
|
|
17324
|
+
}
|
|
17325
|
+
if (s[0] === 0x00 && s.length > 1 && (s[1] & 0x80) === 0) {
|
|
17326
|
+
s = s.slice(1);
|
|
17327
|
+
}
|
|
17328
|
+
const expectedLength = this.getExpectedLength();
|
|
17329
|
+
const rPadded = new Uint8Array(expectedLength);
|
|
17330
|
+
const sPadded = new Uint8Array(expectedLength);
|
|
17331
|
+
if (r.length <= expectedLength) {
|
|
17332
|
+
rPadded.set(r, expectedLength - r.length);
|
|
17333
|
+
}
|
|
17334
|
+
else {
|
|
17335
|
+
rPadded.set(r.slice(r.length - expectedLength), 0);
|
|
17336
|
+
}
|
|
17337
|
+
if (s.length <= expectedLength) {
|
|
17338
|
+
sPadded.set(s, expectedLength - s.length);
|
|
17339
|
+
}
|
|
17340
|
+
else {
|
|
17341
|
+
sPadded.set(s.slice(s.length - expectedLength), 0);
|
|
17342
|
+
}
|
|
17343
|
+
const rawSignature = new Uint8Array([...rPadded, ...sPadded]);
|
|
17344
|
+
return { signature: rawSignature, algo };
|
|
17345
|
+
}
|
|
17346
|
+
return { signature: sig, algo };
|
|
17347
|
+
}
|
|
17348
|
+
supportsCryptoKey(cryptoKey) {
|
|
17349
|
+
return (cryptoKey.algorithm.name === 'ECDSA' &&
|
|
17350
|
+
cryptoKey.algorithm.namedCurve === this.namedCurve);
|
|
17351
|
+
}
|
|
17352
|
+
parsePublicKey(reader) {
|
|
17353
|
+
const curveName = reader.readString();
|
|
17354
|
+
if (curveName !== this.curveName) {
|
|
17355
|
+
throw new InvalidKeyDataError(`ECDSA certificate curve name ${curveName}, expected ${this.curveName}`);
|
|
17356
|
+
}
|
|
17357
|
+
const publicKeyPoint = reader.readBytes(reader.readUint32());
|
|
17358
|
+
const writer = new SshWriter();
|
|
17359
|
+
writer.writeString(this.sshType);
|
|
17360
|
+
writer.writeString(curveName);
|
|
17361
|
+
writer.writeMpInt(publicKeyPoint);
|
|
17362
|
+
return {
|
|
17363
|
+
type: this.sshType,
|
|
17364
|
+
keyData: writer.toUint8Array(),
|
|
17365
|
+
};
|
|
17366
|
+
}
|
|
17367
|
+
writePublicKey(writer, publicKey) {
|
|
17368
|
+
const publicKeyReader = new SshReader(publicKey.keyData);
|
|
17369
|
+
publicKeyReader.readString();
|
|
17370
|
+
const curveName = publicKeyReader.readString();
|
|
17371
|
+
const publicPoint = publicKeyReader.readMpInt();
|
|
17372
|
+
writer.writeString(curveName);
|
|
17373
|
+
writer.writeUint32(publicPoint.length);
|
|
17374
|
+
writer.writeBytes(publicPoint);
|
|
17375
|
+
}
|
|
17376
|
+
getCertificateType() {
|
|
17377
|
+
return `${this.sshType}-cert-v01@openssh.com`;
|
|
17378
|
+
}
|
|
17379
|
+
getSignatureAlgo() {
|
|
17380
|
+
return this.sshType;
|
|
17381
|
+
}
|
|
17382
|
+
}
|
|
17383
|
+
const EcdsaP256Binding = new EcdsaBinding('nistp256', 'ecdsa-sha2-nistp256', 'P-256');
|
|
17384
|
+
const EcdsaP384Binding = new EcdsaBinding('nistp384', 'ecdsa-sha2-nistp384', 'P-384');
|
|
17385
|
+
const EcdsaP521Binding = new EcdsaBinding('nistp521', 'ecdsa-sha2-nistp521', 'P-521');
|
|
17386
|
+
|
|
17387
|
+
class Ed25519Binding {
|
|
17388
|
+
async importPublicSsh(params) {
|
|
17389
|
+
const { blob, crypto } = params;
|
|
17390
|
+
const reader = new SshReader(blob);
|
|
17391
|
+
reader.readString();
|
|
17392
|
+
const keyLength = reader.readUint32();
|
|
17393
|
+
if (keyLength !== 32) {
|
|
17394
|
+
throw new InvalidKeyDataError(`Ed25519 key length ${keyLength}, expected 32`);
|
|
17395
|
+
}
|
|
17396
|
+
const publicKeyBytes = reader.readBytes(keyLength);
|
|
17397
|
+
return crypto.subtle.importKey('raw', publicKeyBytes, 'Ed25519', true, [
|
|
17398
|
+
'verify',
|
|
17399
|
+
]);
|
|
17400
|
+
}
|
|
17401
|
+
async exportPublicSsh(params) {
|
|
17402
|
+
const { publicKey, crypto } = params;
|
|
17403
|
+
const jwk = await crypto.subtle.exportKey('jwk', publicKey);
|
|
17404
|
+
if (!jwk.x) {
|
|
17405
|
+
throw new InvalidKeyDataError('Ed25519 JWK missing x parameter');
|
|
17406
|
+
}
|
|
17407
|
+
const keyBytes = new Uint8Array(Convert.FromBase64Url(jwk.x));
|
|
17408
|
+
const writer = new SshWriter();
|
|
17409
|
+
writer.writeString('ssh-ed25519');
|
|
17410
|
+
writer.writeUint32(keyBytes.length);
|
|
17411
|
+
writer.writeBytes(keyBytes);
|
|
17412
|
+
return writer.toUint8Array();
|
|
17413
|
+
}
|
|
17414
|
+
async importPublicSpki(params) {
|
|
17415
|
+
const { spki, crypto } = params;
|
|
17416
|
+
return crypto.subtle.importKey('spki', spki, 'Ed25519', true, ['verify']);
|
|
17417
|
+
}
|
|
17418
|
+
async exportPublicSpki(params) {
|
|
17419
|
+
const { publicKey, crypto } = params;
|
|
17420
|
+
const spki = await crypto.subtle.exportKey('spki', publicKey);
|
|
17421
|
+
return BufferSourceConverter.toUint8Array(spki);
|
|
17422
|
+
}
|
|
17423
|
+
async importPrivatePkcs8(params) {
|
|
17424
|
+
const { pkcs8, crypto } = params;
|
|
17425
|
+
return crypto.subtle.importKey('pkcs8', pkcs8, 'Ed25519', true, ['sign']);
|
|
17426
|
+
}
|
|
17427
|
+
async exportPrivatePkcs8(params) {
|
|
17428
|
+
const { privateKey, crypto } = params;
|
|
17429
|
+
const pkcs8 = await crypto.subtle.exportKey('pkcs8', privateKey);
|
|
17430
|
+
return BufferSourceConverter.toUint8Array(pkcs8);
|
|
17431
|
+
}
|
|
17432
|
+
async exportPrivateSsh(params) {
|
|
17433
|
+
const { privateKey, crypto, jwk: providedJwk } = params;
|
|
17434
|
+
const jwk = providedJwk || (await crypto.subtle.exportKey('jwk', privateKey));
|
|
17435
|
+
if (!jwk.d || !jwk.x) {
|
|
17436
|
+
throw new InvalidKeyDataError('Ed25519 private key JWK missing required parameters');
|
|
17437
|
+
}
|
|
17438
|
+
const privateBytes = new Uint8Array(Convert.FromBase64Url(jwk.d));
|
|
17439
|
+
const publicBytes = new Uint8Array(Convert.FromBase64Url(jwk.x));
|
|
17440
|
+
const writer = new SshWriter();
|
|
17441
|
+
writer.writeString('ssh-ed25519');
|
|
17442
|
+
writer.writeUint32(publicBytes.length);
|
|
17443
|
+
writer.writeBytes(publicBytes);
|
|
17444
|
+
const privKeyPart = new Uint8Array(64);
|
|
17445
|
+
privKeyPart.set(privateBytes, 0);
|
|
17446
|
+
privKeyPart.set(publicBytes, 32);
|
|
17447
|
+
writer.writeUint32(privKeyPart.length);
|
|
17448
|
+
writer.writeBytes(privKeyPart);
|
|
17449
|
+
return writer.toUint8Array();
|
|
17450
|
+
}
|
|
17451
|
+
async importPrivateSsh(params) {
|
|
17452
|
+
const { sshKey, crypto } = params;
|
|
17453
|
+
const base64Data = sshKey
|
|
17454
|
+
.replace(/-----BEGIN OPENSSH PRIVATE KEY-----/, '')
|
|
17455
|
+
.replace(/-----END OPENSSH PRIVATE KEY-----/, '')
|
|
17456
|
+
.replace(/\s/g, '');
|
|
17457
|
+
const binaryData = Convert.FromBase64(base64Data);
|
|
17458
|
+
const reader = new SshReader(BufferSourceConverter.toUint8Array(binaryData));
|
|
17459
|
+
const magic = reader.readBytes(15);
|
|
17460
|
+
if (Convert.ToHex(magic) !== '6f70656e7373682d6b65792d763100') {
|
|
17461
|
+
throw new InvalidPrivateKeyFormatError('invalid magic string');
|
|
17462
|
+
}
|
|
17463
|
+
const _cipherName = reader.readString();
|
|
17464
|
+
reader.readString();
|
|
17465
|
+
reader.readString();
|
|
17466
|
+
if (_cipherName !== 'none') {
|
|
17467
|
+
throw new EncryptedKeyNotSupportedError(_cipherName);
|
|
17468
|
+
}
|
|
17469
|
+
const numKeys = reader.readUint32();
|
|
17470
|
+
if (numKeys !== 1) {
|
|
17471
|
+
throw new InvalidPrivateKeyFormatError('multiple keys not supported');
|
|
17472
|
+
}
|
|
17473
|
+
const publicKeyLength = reader.readUint32();
|
|
17474
|
+
reader.readBytes(publicKeyLength);
|
|
17475
|
+
const privateKeyLength = reader.readUint32();
|
|
17476
|
+
const privateKeyData = reader.readBytes(privateKeyLength);
|
|
17477
|
+
const privateReader = new SshReader(privateKeyData);
|
|
17478
|
+
const checkint1 = privateReader.readUint32();
|
|
17479
|
+
const checkint2 = privateReader.readUint32();
|
|
17480
|
+
if (checkint1 !== checkint2) {
|
|
17481
|
+
throw new InvalidPrivateKeyFormatError('invalid checkints');
|
|
17482
|
+
}
|
|
17483
|
+
privateReader.readString();
|
|
17484
|
+
const pubKeyLength = privateReader.readUint32();
|
|
17485
|
+
const _publicKeyBytes = privateReader.readBytes(pubKeyLength);
|
|
17486
|
+
const privKeyLength = privateReader.readUint32();
|
|
17487
|
+
const privateKeyBytes = privateReader.readBytes(privKeyLength);
|
|
17488
|
+
privateReader.readString();
|
|
17489
|
+
const privateKey = privateKeyBytes.slice(0, 32);
|
|
17490
|
+
const jwk = {
|
|
17491
|
+
kty: 'OKP',
|
|
17492
|
+
crv: 'Ed25519',
|
|
17493
|
+
d: Convert.ToBase64Url(privateKey),
|
|
17494
|
+
x: Convert.ToBase64Url(_publicKeyBytes),
|
|
17495
|
+
};
|
|
17496
|
+
return crypto.subtle.importKey('jwk', jwk, 'Ed25519', true, ['sign']);
|
|
17497
|
+
}
|
|
17498
|
+
async sign(params) {
|
|
17499
|
+
const { privateKey, data, crypto } = params;
|
|
17500
|
+
const signature = await crypto.subtle.sign('Ed25519', privateKey, data);
|
|
17501
|
+
return BufferSourceConverter.toUint8Array(signature);
|
|
17502
|
+
}
|
|
17503
|
+
async verify(params) {
|
|
17504
|
+
const { publicKey, signature, data, crypto } = params;
|
|
17505
|
+
return crypto.subtle.verify('Ed25519', publicKey, signature, data);
|
|
17506
|
+
}
|
|
17507
|
+
encodeSignature(params) {
|
|
17508
|
+
const { signature, algo } = params;
|
|
17509
|
+
const sigBytes = new Uint8Array(signature);
|
|
17510
|
+
const writer = new SshWriter();
|
|
17511
|
+
writer.writeString(algo);
|
|
17512
|
+
writer.writeUint32(sigBytes.length);
|
|
17513
|
+
writer.writeBytes(sigBytes);
|
|
17514
|
+
return writer.toUint8Array();
|
|
17515
|
+
}
|
|
17516
|
+
decodeSignature(params) {
|
|
17517
|
+
const { signature } = params;
|
|
17518
|
+
const reader = new SshReader(signature);
|
|
17519
|
+
const algo = reader.readString();
|
|
17520
|
+
const sigLength = reader.readUint32();
|
|
17521
|
+
const sigBytes = reader.readBytes(sigLength);
|
|
17522
|
+
return {
|
|
17523
|
+
signature: sigBytes,
|
|
17524
|
+
algo,
|
|
17525
|
+
};
|
|
17526
|
+
}
|
|
17527
|
+
supportsCryptoKey(cryptoKey) {
|
|
17528
|
+
return cryptoKey.algorithm.name === 'Ed25519';
|
|
17529
|
+
}
|
|
17530
|
+
parsePublicKey(reader) {
|
|
17531
|
+
const publicKeyData = reader.readBytes(reader.readUint32());
|
|
17532
|
+
const writer = new SshWriter();
|
|
17533
|
+
writer.writeString('ssh-ed25519');
|
|
17534
|
+
writer.writeUint32(publicKeyData.length);
|
|
17535
|
+
writer.writeBytes(publicKeyData);
|
|
17536
|
+
return {
|
|
17537
|
+
type: 'ssh-ed25519',
|
|
17538
|
+
keyData: writer.toUint8Array(),
|
|
17539
|
+
};
|
|
17540
|
+
}
|
|
17541
|
+
writePublicKey(writer, publicKey) {
|
|
17542
|
+
const publicKeyReader = new SshReader(publicKey.keyData);
|
|
17543
|
+
publicKeyReader.readString();
|
|
17544
|
+
const keyLength = publicKeyReader.readUint32();
|
|
17545
|
+
const rawKeyData = publicKeyReader.readBytes(keyLength);
|
|
17546
|
+
writer.writeUint32(rawKeyData.length);
|
|
17547
|
+
writer.writeBytes(rawKeyData);
|
|
17548
|
+
}
|
|
17549
|
+
getCertificateType() {
|
|
17550
|
+
return 'ssh-ed25519-cert-v01@openssh.com';
|
|
17551
|
+
}
|
|
17552
|
+
getSignatureAlgo() {
|
|
17553
|
+
return 'ssh-ed25519';
|
|
17554
|
+
}
|
|
17555
|
+
}
|
|
17556
|
+
|
|
17557
|
+
const registry = new Map();
|
|
17558
|
+
class AlgorithmRegistry {
|
|
17559
|
+
static get(name) {
|
|
17560
|
+
const binding = registry.get(name);
|
|
17561
|
+
if (!binding) {
|
|
17562
|
+
throw new UnsupportedKeyTypeError(name, Array.from(registry.keys()));
|
|
17563
|
+
}
|
|
17564
|
+
return binding;
|
|
17565
|
+
}
|
|
17566
|
+
static register(name, binding) {
|
|
17567
|
+
registry.set(name, binding);
|
|
17568
|
+
}
|
|
17569
|
+
static getSshTypeFromCryptoKey(cryptoKey) {
|
|
17570
|
+
for (const [sshType, binding] of registry.entries()) {
|
|
17571
|
+
if (binding.supportsCryptoKey(cryptoKey)) {
|
|
17572
|
+
return sshType;
|
|
17573
|
+
}
|
|
17574
|
+
}
|
|
17575
|
+
throw new UnsupportedKeyTypeError(cryptoKey.algorithm.name, Array.from(registry.keys()));
|
|
17576
|
+
}
|
|
17577
|
+
static certTypeToKeyType(certType) {
|
|
17578
|
+
const mapping = {
|
|
17579
|
+
'ssh-rsa-cert-v01@openssh.com': 'ssh-rsa',
|
|
17580
|
+
'ssh-ed25519-cert-v01@openssh.com': 'ssh-ed25519',
|
|
17581
|
+
'ecdsa-sha2-nistp256-cert-v01@openssh.com': 'ecdsa-sha2-nistp256',
|
|
17582
|
+
'ecdsa-sha2-nistp384-cert-v01@openssh.com': 'ecdsa-sha2-nistp384',
|
|
17583
|
+
'ecdsa-sha2-nistp521-cert-v01@openssh.com': 'ecdsa-sha2-nistp521',
|
|
17584
|
+
};
|
|
17585
|
+
return mapping[certType];
|
|
17586
|
+
}
|
|
17587
|
+
static getSupportedCertTypes() {
|
|
17588
|
+
return Object.keys({
|
|
17589
|
+
'ssh-rsa-cert-v01@openssh.com': 'ssh-rsa',
|
|
17590
|
+
'ssh-ed25519-cert-v01@openssh.com': 'ssh-ed25519',
|
|
17591
|
+
'ecdsa-sha2-nistp256-cert-v01@openssh.com': 'ecdsa-sha2-nistp256',
|
|
17592
|
+
'ecdsa-sha2-nistp384-cert-v01@openssh.com': 'ecdsa-sha2-nistp384',
|
|
17593
|
+
'ecdsa-sha2-nistp521-cert-v01@openssh.com': 'ecdsa-sha2-nistp521',
|
|
17594
|
+
});
|
|
17595
|
+
}
|
|
17596
|
+
}
|
|
17597
|
+
AlgorithmRegistry.register('ssh-ed25519', new Ed25519Binding());
|
|
17598
|
+
AlgorithmRegistry.register('ssh-rsa', new RsaBinding('SHA-256'));
|
|
17599
|
+
AlgorithmRegistry.register('rsa-sha2-256', new RsaBinding('SHA-256'));
|
|
17600
|
+
AlgorithmRegistry.register('rsa-sha2-512', new RsaBinding('SHA-512'));
|
|
17601
|
+
AlgorithmRegistry.register('ecdsa-sha2-nistp256', EcdsaP256Binding);
|
|
17602
|
+
AlgorithmRegistry.register('ecdsa-sha2-nistp384', EcdsaP384Binding);
|
|
17603
|
+
AlgorithmRegistry.register('ecdsa-sha2-nistp521', EcdsaP521Binding);
|
|
17604
|
+
|
|
17605
|
+
function parsePublicKey(input) {
|
|
17606
|
+
const parts = typeof input === 'string' ? input.trim().split(/\s+/) : null;
|
|
17607
|
+
if (!parts || parts.length < 2) {
|
|
17608
|
+
throw new InvalidFormatError('Invalid SSH public key format');
|
|
17609
|
+
}
|
|
17610
|
+
const type = parts[0];
|
|
17611
|
+
const blob = new Uint8Array(Convert.FromBase64(parts[1]));
|
|
17612
|
+
const comment = parts.length > 2 ? parts.slice(2).join(' ') : undefined;
|
|
17613
|
+
const reader = new SshReader(blob);
|
|
17614
|
+
const blobType = reader.readString();
|
|
17615
|
+
if (blobType !== type) {
|
|
17616
|
+
throw new InvalidFormatError('Key type mismatch');
|
|
17617
|
+
}
|
|
17618
|
+
return {
|
|
17619
|
+
type,
|
|
17620
|
+
keyData: blob,
|
|
17621
|
+
comment,
|
|
17622
|
+
};
|
|
17623
|
+
}
|
|
17624
|
+
function serializePublicKey(blob) {
|
|
17625
|
+
const base64 = Convert.ToBase64(blob.keyData);
|
|
17626
|
+
const parts = [blob.type, base64];
|
|
17627
|
+
if (blob.comment) {
|
|
17628
|
+
parts.push(blob.comment);
|
|
17629
|
+
}
|
|
17630
|
+
return parts.join(' ');
|
|
17631
|
+
}
|
|
17632
|
+
|
|
17633
|
+
function parse(input) {
|
|
17634
|
+
if (typeof input === 'string') {
|
|
17635
|
+
const parts = input.trim().split(/\s+/);
|
|
17636
|
+
if (parts.length < 2) {
|
|
17637
|
+
throw new InvalidFormatError('SSH certificate string', 'type base64 [comment]');
|
|
17638
|
+
}
|
|
17639
|
+
const type = parts[0];
|
|
17640
|
+
const blob = new Uint8Array(Convert.FromBase64(parts[1]));
|
|
17641
|
+
const comment = parts.length > 2 ? parts.slice(2).join(' ') : undefined;
|
|
17642
|
+
const reader = new SshReader(blob);
|
|
17643
|
+
const blobType = reader.readString();
|
|
17644
|
+
if (blobType !== type) {
|
|
17645
|
+
throw new InvalidFormatError(`certificate blob type ${blobType}`, `expected ${type}`);
|
|
17646
|
+
}
|
|
17647
|
+
return {
|
|
17648
|
+
type,
|
|
17649
|
+
keyData: blob,
|
|
17650
|
+
comment,
|
|
17651
|
+
};
|
|
17652
|
+
}
|
|
17653
|
+
else {
|
|
17654
|
+
const reader = new SshReader(input);
|
|
17655
|
+
const type = reader.readString();
|
|
17656
|
+
const keyData = input.slice(reader.getOffset());
|
|
17657
|
+
return {
|
|
17658
|
+
type,
|
|
17659
|
+
keyData,
|
|
17660
|
+
};
|
|
17661
|
+
}
|
|
17662
|
+
}
|
|
17663
|
+
function parseCertificateData(keyData) {
|
|
17664
|
+
const reader = new SshReader(keyData);
|
|
17665
|
+
const certType = reader.readString();
|
|
17666
|
+
const nonce = reader.readBytes(reader.readUint32());
|
|
17667
|
+
const mappedKeyType = AlgorithmRegistry.certTypeToKeyType(certType);
|
|
17668
|
+
if (!mappedKeyType) {
|
|
17669
|
+
throw new UnsupportedAlgorithmError(certType, AlgorithmRegistry.getSupportedCertTypes());
|
|
17670
|
+
}
|
|
17671
|
+
const binding = AlgorithmRegistry.get(mappedKeyType);
|
|
17672
|
+
const publicKey = binding.parsePublicKey(reader);
|
|
17673
|
+
const keyType = mappedKeyType;
|
|
17674
|
+
const serial = reader.readUint64();
|
|
17675
|
+
const typeValue = reader.readUint32();
|
|
17676
|
+
const type = typeValue === 1 ? 'user' : 'host';
|
|
17677
|
+
const keyId = reader.readString();
|
|
17678
|
+
const principalsLength = reader.readUint32();
|
|
17679
|
+
const principalsData = reader.readBytes(principalsLength);
|
|
17680
|
+
const validPrincipals = [];
|
|
17681
|
+
if (principalsData.length > 0) {
|
|
17682
|
+
const principalsReader = new SshReader(principalsData);
|
|
17683
|
+
while (principalsReader.getOffset() < principalsData.length) {
|
|
17684
|
+
try {
|
|
17685
|
+
const principal = principalsReader.readString();
|
|
17686
|
+
validPrincipals.push(principal);
|
|
17687
|
+
}
|
|
17688
|
+
catch {
|
|
17689
|
+
break;
|
|
17690
|
+
}
|
|
17691
|
+
}
|
|
17692
|
+
}
|
|
17693
|
+
const validAfter = reader.readUint64();
|
|
17694
|
+
const validBefore = reader.readUint64();
|
|
17695
|
+
const criticalOptions = {};
|
|
17696
|
+
const criticalLength = reader.readUint32();
|
|
17697
|
+
const criticalData = reader.readBytes(criticalLength);
|
|
17698
|
+
if (criticalData.length > 0) {
|
|
17699
|
+
const optionsReader = new SshReader(criticalData);
|
|
17700
|
+
while (optionsReader.getOffset() < criticalData.length) {
|
|
17701
|
+
try {
|
|
17702
|
+
const name = optionsReader.readString();
|
|
17703
|
+
const valueData = optionsReader.readBytes(optionsReader.readUint32());
|
|
17704
|
+
const value = valueData.length === 0 ? '' : decoder.decode(valueData);
|
|
17705
|
+
criticalOptions[name] = value;
|
|
17706
|
+
}
|
|
17707
|
+
catch {
|
|
17708
|
+
break;
|
|
17709
|
+
}
|
|
17710
|
+
}
|
|
17711
|
+
}
|
|
17712
|
+
const extensions = {};
|
|
17713
|
+
const extensionsLength = reader.readUint32();
|
|
17714
|
+
const extensionsData = reader.readBytes(extensionsLength);
|
|
17715
|
+
if (extensionsData.length > 0) {
|
|
17716
|
+
const extReader = new SshReader(extensionsData);
|
|
17717
|
+
while (extReader.getOffset() < extensionsData.length) {
|
|
17718
|
+
try {
|
|
17719
|
+
const name = extReader.readString();
|
|
17720
|
+
const valueData = extReader.readBytes(extReader.readUint32());
|
|
17721
|
+
const value = valueData.length === 0 ? '' : decoder.decode(valueData);
|
|
17722
|
+
extensions[name] = value;
|
|
17723
|
+
}
|
|
17724
|
+
catch {
|
|
17725
|
+
break;
|
|
17726
|
+
}
|
|
17727
|
+
}
|
|
17728
|
+
}
|
|
17729
|
+
const reservedLength = reader.readUint32();
|
|
17730
|
+
const reserved = reader.readBytes(reservedLength);
|
|
17731
|
+
const signatureKeyLength = reader.readUint32();
|
|
17732
|
+
const signatureKeyData = reader.readBytes(signatureKeyLength);
|
|
17733
|
+
const signatureKeyReader = new SshReader(signatureKeyData);
|
|
17734
|
+
const signatureKeyType = signatureKeyReader.readString();
|
|
17735
|
+
const signatureKey = {
|
|
17736
|
+
type: signatureKeyType,
|
|
17737
|
+
keyData: signatureKeyData,
|
|
17738
|
+
};
|
|
17739
|
+
const signatureLength = reader.readUint32();
|
|
17740
|
+
const signature = reader.readBytes(signatureLength);
|
|
17741
|
+
return {
|
|
17742
|
+
nonce,
|
|
17743
|
+
keyType,
|
|
17744
|
+
publicKey,
|
|
17745
|
+
serial,
|
|
17746
|
+
type,
|
|
17747
|
+
keyId,
|
|
17748
|
+
validPrincipals,
|
|
17749
|
+
validAfter,
|
|
17750
|
+
validBefore,
|
|
17751
|
+
criticalOptions,
|
|
17752
|
+
extensions,
|
|
17753
|
+
reserved,
|
|
17754
|
+
signatureKey,
|
|
17755
|
+
signature,
|
|
17756
|
+
};
|
|
17757
|
+
}
|
|
17758
|
+
function serialize(cert) {
|
|
17759
|
+
const base64 = Convert.ToBase64(cert.keyData);
|
|
17760
|
+
const parts = [cert.type, base64];
|
|
17761
|
+
if (cert.comment) {
|
|
17762
|
+
parts.push(cert.comment);
|
|
17763
|
+
}
|
|
17764
|
+
return parts.join(' ');
|
|
17765
|
+
}
|
|
17766
|
+
|
|
17767
|
+
function parseSignature(data) {
|
|
17768
|
+
const reader = new SshReader(data);
|
|
17769
|
+
if (data.length >= 6 && new TextDecoder().decode(data.subarray(0, 6)) === 'SSHSIG') {
|
|
17770
|
+
return parseSshSignatureFormat(reader);
|
|
17771
|
+
}
|
|
17772
|
+
else {
|
|
17773
|
+
return parseLegacyFormat(reader);
|
|
17774
|
+
}
|
|
17775
|
+
}
|
|
17776
|
+
function parseSshSignatureFormat(reader) {
|
|
17777
|
+
const magicBytes = reader.readBytes(6);
|
|
17778
|
+
const magic = new TextDecoder().decode(magicBytes);
|
|
17779
|
+
if (magic !== 'SSHSIG') {
|
|
17780
|
+
throw new InvalidFormatError(magic, 'SSHSIG');
|
|
17781
|
+
}
|
|
17782
|
+
const version = reader.readUint32();
|
|
17783
|
+
const publicKeyLength = reader.readUint32();
|
|
17784
|
+
const publicKey = reader.readBytes(publicKeyLength);
|
|
17785
|
+
const namespace = reader.readString();
|
|
17786
|
+
const reserved = reader.readString();
|
|
17787
|
+
const hashAlgorithm = reader.readString();
|
|
17788
|
+
const signatureLength = reader.readUint32();
|
|
17789
|
+
const signatureData = reader.readBytes(signatureLength);
|
|
17790
|
+
const sigReader = new SshReader(signatureData);
|
|
17791
|
+
const algorithm = sigReader.readString();
|
|
17792
|
+
const signatureLength2 = sigReader.readUint32();
|
|
17793
|
+
const signature = sigReader.readBytes(signatureLength2);
|
|
17794
|
+
return {
|
|
17795
|
+
format: 'ssh-signature',
|
|
17796
|
+
algorithm,
|
|
17797
|
+
signature,
|
|
17798
|
+
version,
|
|
17799
|
+
publicKey,
|
|
17800
|
+
namespace,
|
|
17801
|
+
reserved,
|
|
17802
|
+
hashAlgorithm,
|
|
17803
|
+
};
|
|
17804
|
+
}
|
|
17805
|
+
function parseLegacyFormat(reader) {
|
|
17806
|
+
const algorithm = reader.readString();
|
|
17807
|
+
const signatureLength = reader.readUint32();
|
|
17808
|
+
const signature = reader.readBytes(signatureLength);
|
|
17809
|
+
return {
|
|
17810
|
+
format: 'legacy',
|
|
17811
|
+
algorithm,
|
|
17812
|
+
signature,
|
|
17813
|
+
};
|
|
17814
|
+
}
|
|
17815
|
+
function serializeSignature(blob) {
|
|
17816
|
+
if (blob.format === 'ssh-signature') {
|
|
17817
|
+
return serializeSshSignatureFormat(blob);
|
|
17818
|
+
}
|
|
17819
|
+
else {
|
|
17820
|
+
return serializeLegacyFormat(blob);
|
|
17821
|
+
}
|
|
17822
|
+
}
|
|
17823
|
+
function serializeSshSignatureFormat(blob) {
|
|
17824
|
+
const writer = new SshWriter();
|
|
17825
|
+
writer.writeBytes(new TextEncoder().encode('SSHSIG'));
|
|
17826
|
+
writer.writeUint32(blob.version || 1);
|
|
17827
|
+
if (blob.publicKey) {
|
|
17828
|
+
writer.writeUint32(blob.publicKey.length);
|
|
17829
|
+
writer.writeBytes(blob.publicKey);
|
|
17830
|
+
}
|
|
17831
|
+
else {
|
|
17832
|
+
writer.writeUint32(0);
|
|
17833
|
+
}
|
|
17834
|
+
writer.writeString(blob.namespace || 'file');
|
|
17835
|
+
writer.writeString(blob.reserved || '');
|
|
17836
|
+
writer.writeString(blob.hashAlgorithm || 'sha512');
|
|
17837
|
+
const sigWriter = new SshWriter();
|
|
17838
|
+
sigWriter.writeString(blob.algorithm);
|
|
17839
|
+
sigWriter.writeUint32(blob.signature.length);
|
|
17840
|
+
sigWriter.writeBytes(blob.signature);
|
|
17841
|
+
const sigData = sigWriter.toUint8Array();
|
|
17842
|
+
writer.writeUint32(sigData.length);
|
|
17843
|
+
writer.writeBytes(sigData);
|
|
17844
|
+
return writer.toUint8Array();
|
|
17845
|
+
}
|
|
17846
|
+
function serializeLegacyFormat(blob) {
|
|
17847
|
+
const writer = new SshWriter();
|
|
17848
|
+
writer.writeString(blob.algorithm);
|
|
17849
|
+
writer.writeUint32(blob.signature.length);
|
|
17850
|
+
writer.writeBytes(blob.signature);
|
|
17851
|
+
return writer.toUint8Array();
|
|
17852
|
+
}
|
|
17853
|
+
|
|
17854
|
+
class SshObject {
|
|
17855
|
+
}
|
|
17856
|
+
|
|
17857
|
+
let SshPublicKey$1 = class SshPublicKey extends SshObject {
|
|
17858
|
+
static TYPE = 'public-key';
|
|
17859
|
+
type = SshPublicKey.TYPE;
|
|
17860
|
+
blob;
|
|
17861
|
+
cachedCryptoKey;
|
|
17862
|
+
constructor(blob) {
|
|
17863
|
+
super();
|
|
17864
|
+
this.blob = blob;
|
|
17865
|
+
}
|
|
17866
|
+
async getCryptoKey(crypto = getCrypto()) {
|
|
17867
|
+
if (!this.cachedCryptoKey) {
|
|
17868
|
+
const binding = AlgorithmRegistry.get(this.blob.type);
|
|
17869
|
+
this.cachedCryptoKey = await binding.importPublicSsh({ blob: this.blob.keyData, crypto });
|
|
17870
|
+
}
|
|
17871
|
+
return this.cachedCryptoKey;
|
|
17872
|
+
}
|
|
17873
|
+
static async fromSSH(sshKey, crypto = getCrypto()) {
|
|
17874
|
+
const blob = parsePublicKey(sshKey);
|
|
17875
|
+
const binding = AlgorithmRegistry.get(blob.type);
|
|
17876
|
+
await binding.importPublicSsh({ blob: blob.keyData, crypto });
|
|
17877
|
+
return new SshPublicKey(blob);
|
|
17878
|
+
}
|
|
17879
|
+
static async fromSPKI(spki, type, crypto = getCrypto()) {
|
|
17880
|
+
const binding = AlgorithmRegistry.get(type);
|
|
17881
|
+
const cryptoKey = await binding.importPublicSpki({ spki, crypto });
|
|
17882
|
+
const exported = await binding.exportPublicSsh({ publicKey: cryptoKey, crypto });
|
|
17883
|
+
const blob = {
|
|
17884
|
+
type,
|
|
17885
|
+
keyData: exported,
|
|
17886
|
+
};
|
|
17887
|
+
return new SshPublicKey(blob);
|
|
17888
|
+
}
|
|
17889
|
+
static async fromWebCrypto(cryptoKey, type, crypto = getCrypto()) {
|
|
17890
|
+
const sshType = type || AlgorithmRegistry.getSshTypeFromCryptoKey(cryptoKey);
|
|
17891
|
+
const binding = AlgorithmRegistry.get(sshType);
|
|
17892
|
+
const exported = await binding.exportPublicSsh({ publicKey: cryptoKey, crypto });
|
|
17893
|
+
const blob = {
|
|
17894
|
+
type: sshType,
|
|
17895
|
+
keyData: exported,
|
|
17896
|
+
};
|
|
17897
|
+
return new SshPublicKey(blob);
|
|
17898
|
+
}
|
|
17899
|
+
async export(format = 'ssh', crypto = getCrypto()) {
|
|
17900
|
+
if (format === 'ssh') {
|
|
17901
|
+
return serializePublicKey(this.blob);
|
|
17902
|
+
}
|
|
17903
|
+
else if (format === 'spki') {
|
|
17904
|
+
const cryptoKey = await this.getCryptoKey(crypto);
|
|
17905
|
+
const binding = AlgorithmRegistry.get(this.blob.type);
|
|
17906
|
+
const spki = await binding.exportPublicSpki({ publicKey: cryptoKey, crypto });
|
|
17907
|
+
return new Uint8Array(spki);
|
|
17908
|
+
}
|
|
17909
|
+
throw new UnsupportedKeyTypeError(`Unsupported export format: ${format}`);
|
|
17910
|
+
}
|
|
17911
|
+
async toSSH() {
|
|
17912
|
+
const result = await this.export('ssh');
|
|
17913
|
+
return result;
|
|
17914
|
+
}
|
|
17915
|
+
async toSPKI() {
|
|
17916
|
+
const result = await this.export('spki');
|
|
17917
|
+
return result;
|
|
17918
|
+
}
|
|
17919
|
+
async toWebCrypto(crypto = getCrypto()) {
|
|
17920
|
+
return this.getCryptoKey(crypto);
|
|
17921
|
+
}
|
|
17922
|
+
async verify(algorithm, signature, data, crypto = getCrypto()) {
|
|
17923
|
+
const binding = AlgorithmRegistry.get(algorithm);
|
|
17924
|
+
const cryptoKey = await this.toWebCrypto(crypto);
|
|
17925
|
+
return binding.verify({
|
|
17926
|
+
publicKey: cryptoKey,
|
|
17927
|
+
signature,
|
|
17928
|
+
data,
|
|
17929
|
+
crypto,
|
|
17930
|
+
});
|
|
17931
|
+
}
|
|
17932
|
+
get keyType() {
|
|
17933
|
+
return this.blob.type;
|
|
17934
|
+
}
|
|
17935
|
+
get comment() {
|
|
17936
|
+
return this.blob.comment;
|
|
17937
|
+
}
|
|
17938
|
+
getBlob() {
|
|
17939
|
+
return { ...this.blob };
|
|
17940
|
+
}
|
|
17941
|
+
async thumbprint(algorithm = 'sha256', crypto = getCrypto()) {
|
|
17942
|
+
const hashAlgorithm = algorithm === 'sha256' ? 'SHA-256' : 'SHA-512';
|
|
17943
|
+
const data = this.blob.keyData;
|
|
17944
|
+
const hash = await crypto.subtle.digest(hashAlgorithm, data);
|
|
17945
|
+
return new Uint8Array(hash);
|
|
17946
|
+
}
|
|
17947
|
+
};
|
|
17948
|
+
|
|
17949
|
+
class SshSignature extends SshObject {
|
|
17950
|
+
static TYPE = 'signature';
|
|
17951
|
+
type = SshSignature.TYPE;
|
|
17952
|
+
blob;
|
|
17953
|
+
format;
|
|
17954
|
+
algorithm;
|
|
17955
|
+
signature;
|
|
17956
|
+
version;
|
|
17957
|
+
publicKey;
|
|
17958
|
+
namespace;
|
|
17959
|
+
reserved;
|
|
17960
|
+
hashAlgorithm;
|
|
17961
|
+
constructor(blob) {
|
|
17962
|
+
super();
|
|
17963
|
+
this.blob = blob;
|
|
17964
|
+
this.format = blob.format;
|
|
17965
|
+
this.algorithm = blob.algorithm;
|
|
17966
|
+
this.signature = blob.signature;
|
|
17967
|
+
this.version = blob.version;
|
|
17968
|
+
this.namespace = blob.namespace;
|
|
17969
|
+
this.reserved = blob.reserved;
|
|
17970
|
+
this.hashAlgorithm = blob.hashAlgorithm;
|
|
17971
|
+
if (blob.publicKey) {
|
|
17972
|
+
const reader = new SshReader(blob.publicKey);
|
|
17973
|
+
const type = reader.readString();
|
|
17974
|
+
this.publicKey = new SshPublicKey$1({ type, keyData: blob.publicKey });
|
|
17975
|
+
}
|
|
17976
|
+
}
|
|
17977
|
+
static parse(data) {
|
|
17978
|
+
const blob = parseSignature(data);
|
|
17979
|
+
return new SshSignature(blob);
|
|
17980
|
+
}
|
|
17981
|
+
static fromBlob(blob) {
|
|
17982
|
+
return new SshSignature(blob);
|
|
17983
|
+
}
|
|
17984
|
+
static fromBase64(base64) {
|
|
17985
|
+
const data = new Uint8Array(Convert.FromBase64(base64));
|
|
17986
|
+
return SshSignature.parse(data);
|
|
17987
|
+
}
|
|
17988
|
+
static fromText(text) {
|
|
17989
|
+
const base64 = text
|
|
17990
|
+
.replace(/-----BEGIN SSH SIGNATURE-----/, '')
|
|
17991
|
+
.replace(/-----END SSH SIGNATURE-----/, '')
|
|
17992
|
+
.replace(/[\r\n\s]/g, '');
|
|
17993
|
+
return SshSignature.fromBase64(base64);
|
|
17994
|
+
}
|
|
17995
|
+
serialize() {
|
|
17996
|
+
return serializeSignature(this.blob);
|
|
17997
|
+
}
|
|
17998
|
+
toBase64() {
|
|
17999
|
+
return Convert.ToBase64(this.serialize());
|
|
18000
|
+
}
|
|
18001
|
+
toText() {
|
|
18002
|
+
const base64 = this.toBase64();
|
|
18003
|
+
const lines = [];
|
|
18004
|
+
for (let i = 0; i < base64.length; i += 70) {
|
|
18005
|
+
lines.push(base64.substring(i, i + 70));
|
|
18006
|
+
}
|
|
18007
|
+
return ['-----BEGIN SSH SIGNATURE-----', ...lines, '-----END SSH SIGNATURE-----'].join('\n');
|
|
18008
|
+
}
|
|
18009
|
+
async toSSH() {
|
|
18010
|
+
return this.toText();
|
|
18011
|
+
}
|
|
18012
|
+
async verify(data, publicKey) {
|
|
18013
|
+
const binding = AlgorithmRegistry.get(this.algorithm);
|
|
18014
|
+
const cryptoKey = await publicKey['getCryptoKey']();
|
|
18015
|
+
const crypto = getCrypto();
|
|
18016
|
+
let dataToVerify = data;
|
|
18017
|
+
if (this.format === 'ssh-signature') {
|
|
18018
|
+
const hashAlg = this.hashAlgorithm || 'sha512';
|
|
18019
|
+
const namespace = this.namespace || 'file';
|
|
18020
|
+
const reserved = this.reserved || '';
|
|
18021
|
+
const hashAlgorithm = hashAlg === 'sha256' ? 'SHA-256' : 'SHA-512';
|
|
18022
|
+
const messageHash = await crypto.subtle.digest(hashAlgorithm, data);
|
|
18023
|
+
const messageHashBytes = new Uint8Array(messageHash);
|
|
18024
|
+
const writer = new SshWriter();
|
|
18025
|
+
writer.writeBytes(new TextEncoder().encode('SSHSIG'));
|
|
18026
|
+
writer.writeString(namespace);
|
|
18027
|
+
writer.writeString(reserved);
|
|
18028
|
+
writer.writeString(hashAlg);
|
|
18029
|
+
writer.writeUint32(messageHashBytes.length);
|
|
18030
|
+
writer.writeBytes(messageHashBytes);
|
|
18031
|
+
dataToVerify = writer.toUint8Array();
|
|
18032
|
+
}
|
|
18033
|
+
let hashAlgorithm;
|
|
18034
|
+
if (this.algorithm === 'rsa-sha2-256') {
|
|
18035
|
+
hashAlgorithm = 'SHA-256';
|
|
18036
|
+
}
|
|
18037
|
+
else if (this.algorithm === 'rsa-sha2-512') {
|
|
18038
|
+
hashAlgorithm = 'SHA-512';
|
|
18039
|
+
}
|
|
18040
|
+
let signatureToVerify;
|
|
18041
|
+
if (this.format === 'legacy' || this.format === 'ssh-signature') {
|
|
18042
|
+
const sigWriter = new SshWriter();
|
|
18043
|
+
sigWriter.writeString(this.algorithm);
|
|
18044
|
+
sigWriter.writeUint32(this.signature.length);
|
|
18045
|
+
sigWriter.writeBytes(this.signature);
|
|
18046
|
+
const wireFormatSignature = sigWriter.toUint8Array();
|
|
18047
|
+
const decodedSig = binding.decodeSignature({
|
|
18048
|
+
signature: wireFormatSignature,
|
|
18049
|
+
});
|
|
18050
|
+
signatureToVerify = decodedSig.signature;
|
|
18051
|
+
}
|
|
18052
|
+
else {
|
|
18053
|
+
signatureToVerify = this.signature;
|
|
18054
|
+
}
|
|
18055
|
+
return binding.verify({
|
|
18056
|
+
publicKey: cryptoKey,
|
|
18057
|
+
signature: signatureToVerify,
|
|
18058
|
+
data: dataToVerify,
|
|
18059
|
+
crypto,
|
|
18060
|
+
hash: hashAlgorithm,
|
|
18061
|
+
});
|
|
18062
|
+
}
|
|
18063
|
+
static fromLegacy(algorithm, signature) {
|
|
18064
|
+
const binding = AlgorithmRegistry.get(algorithm);
|
|
18065
|
+
const encodedSignature = binding.encodeSignature({
|
|
18066
|
+
signature,
|
|
18067
|
+
algo: algorithm,
|
|
18068
|
+
});
|
|
18069
|
+
const sigReader = new SshReader(encodedSignature);
|
|
18070
|
+
sigReader.readString();
|
|
18071
|
+
const sigLength = sigReader.readUint32();
|
|
18072
|
+
const signatureData = sigReader.readBytes(sigLength);
|
|
18073
|
+
return new SshSignature({
|
|
18074
|
+
format: 'legacy',
|
|
18075
|
+
algorithm,
|
|
18076
|
+
signature: signatureData,
|
|
18077
|
+
});
|
|
18078
|
+
}
|
|
18079
|
+
static fromSshSignature(algorithm, signature, options = {}) {
|
|
18080
|
+
const blob = {
|
|
18081
|
+
format: 'ssh-signature',
|
|
18082
|
+
algorithm,
|
|
18083
|
+
signature,
|
|
18084
|
+
version: options.version || 1,
|
|
18085
|
+
publicKey: options.publicKey ? options.publicKey.getBlob().keyData : undefined,
|
|
18086
|
+
namespace: options.namespace || 'file',
|
|
18087
|
+
reserved: options.reserved || '',
|
|
18088
|
+
hashAlgorithm: options.hashAlgorithm || 'sha512',
|
|
18089
|
+
};
|
|
18090
|
+
return new SshSignature(blob);
|
|
18091
|
+
}
|
|
18092
|
+
static async sign(algorithm, privateKey, data, options = {}) {
|
|
18093
|
+
const { format = 'legacy', namespace = 'file' } = options;
|
|
18094
|
+
if (format === 'legacy') {
|
|
18095
|
+
const rawSignature = await privateKey.sign(algorithm, data);
|
|
18096
|
+
const algorithmUsed = algorithm || privateKey.keyType;
|
|
18097
|
+
return SshSignature.fromLegacy(algorithmUsed, rawSignature);
|
|
18098
|
+
}
|
|
18099
|
+
else {
|
|
18100
|
+
const signatureAlgorithm = algorithm;
|
|
18101
|
+
const binding = AlgorithmRegistry.get(signatureAlgorithm);
|
|
18102
|
+
const hashAlgorithm = algorithm === 'rsa-sha2-256' ? 'sha256' : 'sha512';
|
|
18103
|
+
const publicKey = await privateKey.getPublicKey();
|
|
18104
|
+
const crypto = getCrypto();
|
|
18105
|
+
const webCryptoHashAlg = hashAlgorithm === 'sha256' ? 'SHA-256' : 'SHA-512';
|
|
18106
|
+
const messageHash = await crypto.subtle.digest(webCryptoHashAlg, data);
|
|
18107
|
+
const messageHashBytes = new Uint8Array(messageHash);
|
|
18108
|
+
const writer = new SshWriter();
|
|
18109
|
+
writer.writeBytes(new TextEncoder().encode('SSHSIG'));
|
|
18110
|
+
writer.writeString(namespace);
|
|
18111
|
+
writer.writeString('');
|
|
18112
|
+
writer.writeString(hashAlgorithm);
|
|
18113
|
+
writer.writeUint32(messageHashBytes.length);
|
|
18114
|
+
writer.writeBytes(messageHashBytes);
|
|
18115
|
+
const dataToSign = writer.toUint8Array();
|
|
18116
|
+
const rawSignature = await privateKey.sign(signatureAlgorithm, dataToSign);
|
|
18117
|
+
const encodedSignature = binding.encodeSignature({
|
|
18118
|
+
signature: rawSignature,
|
|
18119
|
+
algo: signatureAlgorithm,
|
|
18120
|
+
});
|
|
18121
|
+
const sigReader = new SshReader(encodedSignature);
|
|
18122
|
+
sigReader.readString();
|
|
18123
|
+
const sigLength = sigReader.readUint32();
|
|
18124
|
+
const signatureData = sigReader.readBytes(sigLength);
|
|
18125
|
+
return SshSignature.fromSshSignature(signatureAlgorithm, signatureData, {
|
|
18126
|
+
namespace,
|
|
18127
|
+
hashAlgorithm,
|
|
18128
|
+
publicKey,
|
|
18129
|
+
});
|
|
18130
|
+
}
|
|
18131
|
+
}
|
|
18132
|
+
}
|
|
18133
|
+
|
|
18134
|
+
let SshCertificate$1 = class SshCertificate extends SshObject {
|
|
18135
|
+
static TYPE = 'certificate';
|
|
18136
|
+
type = SshCertificate.TYPE;
|
|
18137
|
+
_blob;
|
|
18138
|
+
data;
|
|
18139
|
+
_validAfter;
|
|
18140
|
+
_validBefore;
|
|
18141
|
+
keyId;
|
|
18142
|
+
principals;
|
|
18143
|
+
certType;
|
|
18144
|
+
serial;
|
|
18145
|
+
validAfter;
|
|
18146
|
+
validBefore;
|
|
18147
|
+
publicKey;
|
|
18148
|
+
signatureKey;
|
|
18149
|
+
criticalOptions;
|
|
18150
|
+
extensions;
|
|
18151
|
+
constructor(blob) {
|
|
18152
|
+
super();
|
|
18153
|
+
this._blob = blob;
|
|
18154
|
+
this.data = parseCertificateData(blob.keyData);
|
|
18155
|
+
this._validAfter = this.data.validAfter;
|
|
18156
|
+
this._validBefore = this.data.validBefore;
|
|
18157
|
+
this.keyId = this.data.keyId;
|
|
18158
|
+
this.principals = this.data.validPrincipals;
|
|
18159
|
+
this.certType = this.data.type;
|
|
18160
|
+
this.serial = this.data.serial;
|
|
18161
|
+
this.validAfter = new Date(Number(this.data.validAfter) * 1000);
|
|
18162
|
+
this.validBefore = new Date(Number(this.data.validBefore) * 1000);
|
|
18163
|
+
this.publicKey = new SshPublicKey$1(this.data.publicKey);
|
|
18164
|
+
this.signatureKey = new SshPublicKey$1(this.data.signatureKey);
|
|
18165
|
+
this.criticalOptions = { ...this.data.criticalOptions };
|
|
18166
|
+
this.extensions = { ...this.data.extensions };
|
|
18167
|
+
}
|
|
18168
|
+
static async fromSSH(text) {
|
|
18169
|
+
const blob = parse(text);
|
|
18170
|
+
return new SshCertificate(blob);
|
|
18171
|
+
}
|
|
18172
|
+
static async fromBlob(blob) {
|
|
18173
|
+
return new SshCertificate(blob);
|
|
18174
|
+
}
|
|
18175
|
+
async toSSH() {
|
|
18176
|
+
return serialize(this._blob);
|
|
18177
|
+
}
|
|
18178
|
+
toBlob() {
|
|
18179
|
+
return { ...this._blob };
|
|
18180
|
+
}
|
|
18181
|
+
get blob() {
|
|
18182
|
+
return this.toBlob();
|
|
18183
|
+
}
|
|
18184
|
+
validate(date = new Date()) {
|
|
18185
|
+
const ts = BigInt(Math.floor(date.getTime() / 1000));
|
|
18186
|
+
const after = this._validAfter;
|
|
18187
|
+
const before = this._validBefore;
|
|
18188
|
+
const INFINITY = 0xffffffffffffffffn;
|
|
18189
|
+
const upper = before === INFINITY ? ts : before;
|
|
18190
|
+
return ts >= after && ts <= upper;
|
|
18191
|
+
}
|
|
18192
|
+
async verify(caPublicKey, crypto = getCrypto()) {
|
|
18193
|
+
const verifyKey = caPublicKey || this.signatureKey;
|
|
18194
|
+
const signedData = this.getSignedData();
|
|
18195
|
+
const sshSignature = SshSignature.parse(this.data.signature);
|
|
18196
|
+
const binding = AlgorithmRegistry.get(sshSignature.algorithm);
|
|
18197
|
+
const cryptoKey = await verifyKey.toWebCrypto(crypto);
|
|
18198
|
+
return binding.verify({
|
|
18199
|
+
publicKey: cryptoKey,
|
|
18200
|
+
signature: sshSignature.signature,
|
|
18201
|
+
data: signedData,
|
|
18202
|
+
crypto,
|
|
18203
|
+
});
|
|
18204
|
+
}
|
|
18205
|
+
getSignedData() {
|
|
18206
|
+
const reader = new SshReader(this._blob.keyData);
|
|
18207
|
+
reader.readString();
|
|
18208
|
+
reader.readBytes(reader.readUint32());
|
|
18209
|
+
if (this.data.keyType === 'ssh-ed25519') {
|
|
18210
|
+
reader.readBytes(reader.readUint32());
|
|
18211
|
+
}
|
|
18212
|
+
else if (this.data.keyType === 'ssh-rsa') {
|
|
18213
|
+
reader.readBytes(reader.readUint32());
|
|
18214
|
+
reader.readBytes(reader.readUint32());
|
|
18215
|
+
}
|
|
18216
|
+
else if (this.data.keyType.startsWith('ecdsa-sha2-')) {
|
|
18217
|
+
reader.readString();
|
|
18218
|
+
reader.readBytes(reader.readUint32());
|
|
18219
|
+
}
|
|
18220
|
+
reader.readUint64();
|
|
18221
|
+
reader.readUint32();
|
|
18222
|
+
reader.readBytes(reader.readUint32());
|
|
18223
|
+
reader.readBytes(reader.readUint32());
|
|
18224
|
+
reader.readUint64();
|
|
18225
|
+
reader.readUint64();
|
|
18226
|
+
reader.readBytes(reader.readUint32());
|
|
18227
|
+
reader.readBytes(reader.readUint32());
|
|
18228
|
+
reader.readBytes(reader.readUint32());
|
|
18229
|
+
reader.readBytes(reader.readUint32());
|
|
18230
|
+
const signedDataEnd = reader.getOffset();
|
|
18231
|
+
return this._blob.keyData.slice(0, signedDataEnd);
|
|
18232
|
+
}
|
|
18233
|
+
};
|
|
18234
|
+
|
|
18235
|
+
var __classPrivateFieldSet = (undefined && undefined.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
18236
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
18237
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
18238
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
18239
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
18240
|
+
};
|
|
18241
|
+
var __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18242
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18243
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
18244
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
18245
|
+
};
|
|
18246
|
+
var _SshCertificate_cert;
|
|
18247
|
+
class SshCertificate {
|
|
18248
|
+
constructor(raw) {
|
|
18249
|
+
_SshCertificate_cert.set(this, void 0);
|
|
18250
|
+
const blob = parse(raw.trim());
|
|
18251
|
+
// @ts-expect-error - SshCertificateType is not a constructor
|
|
18252
|
+
__classPrivateFieldSet(this, _SshCertificate_cert, new SshCertificate$1(blob), "f");
|
|
18253
|
+
this.notBefore = __classPrivateFieldGet(this, _SshCertificate_cert, "f").validAfter;
|
|
18254
|
+
this.notAfter = __classPrivateFieldGet(this, _SshCertificate_cert, "f").validBefore;
|
|
18255
|
+
this.validity = dateDiff(this.notBefore, this.notAfter);
|
|
18256
|
+
this.type = [__classPrivateFieldGet(this, _SshCertificate_cert, "f").blob.type, __classPrivateFieldGet(this, _SshCertificate_cert, "f").certType, __classPrivateFieldGet(this, _SshCertificate_cert, "f").type].join(' ');
|
|
18257
|
+
this.serialNumber = __classPrivateFieldGet(this, _SshCertificate_cert, "f").serial.toString();
|
|
18258
|
+
this.keyId = __classPrivateFieldGet(this, _SshCertificate_cert, "f").keyId;
|
|
18259
|
+
this.principals = __classPrivateFieldGet(this, _SshCertificate_cert, "f").principals;
|
|
18260
|
+
this.extensions = __classPrivateFieldGet(this, _SshCertificate_cert, "f").extensions;
|
|
18261
|
+
this.criticalOptions = __classPrivateFieldGet(this, _SshCertificate_cert, "f").criticalOptions;
|
|
18262
|
+
}
|
|
18263
|
+
async parseSignatureKey() {
|
|
18264
|
+
const key = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.toWebCrypto();
|
|
18265
|
+
const blob = __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.getBlob();
|
|
18266
|
+
const thumbprint = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.thumbprint('sha256');
|
|
18267
|
+
this.signatureKey = {
|
|
18268
|
+
algorithm: key.algorithm.name,
|
|
18269
|
+
type: blob.type,
|
|
18270
|
+
value: await __classPrivateFieldGet(this, _SshCertificate_cert, "f").signatureKey.toSSH(),
|
|
18271
|
+
thumbprint: Convert.ToBase64(thumbprint),
|
|
18272
|
+
};
|
|
18273
|
+
}
|
|
18274
|
+
async parsePublicKey() {
|
|
18275
|
+
const key = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.toWebCrypto();
|
|
18276
|
+
const blob = __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.getBlob();
|
|
18277
|
+
const thumbprint = await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.thumbprint('sha256');
|
|
18278
|
+
this.publicKey = {
|
|
18279
|
+
algorithm: key.algorithm.name,
|
|
18280
|
+
type: blob.type,
|
|
18281
|
+
value: await __classPrivateFieldGet(this, _SshCertificate_cert, "f").publicKey.toSSH(),
|
|
18282
|
+
thumbprint: Convert.ToBase64(thumbprint),
|
|
18283
|
+
};
|
|
18284
|
+
}
|
|
18285
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18286
|
+
async toString(_format = 'pem') {
|
|
18287
|
+
return __classPrivateFieldGet(this, _SshCertificate_cert, "f").toSSH();
|
|
18288
|
+
}
|
|
18289
|
+
}
|
|
18290
|
+
_SshCertificate_cert = new WeakMap();
|
|
18291
|
+
|
|
16645
18292
|
/**
|
|
16646
18293
|
* @license
|
|
16647
18294
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -18556,7 +20203,7 @@ const Issuer = (props) => {
|
|
|
18556
20203
|
];
|
|
18557
20204
|
};
|
|
18558
20205
|
|
|
18559
|
-
const certificateViewerCss$
|
|
20206
|
+
const certificateViewerCss$4 = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
18560
20207
|
|
|
18561
20208
|
class AttributeCertificateViewer {
|
|
18562
20209
|
constructor(hostRef) {
|
|
@@ -18655,7 +20302,7 @@ class AttributeCertificateViewer {
|
|
|
18655
20302
|
static get watchers() { return {
|
|
18656
20303
|
"certificate": ["watchCertificateAndDecode"]
|
|
18657
20304
|
}; }
|
|
18658
|
-
static get style() { return certificateViewerCss$
|
|
20305
|
+
static get style() { return certificateViewerCss$4; }
|
|
18659
20306
|
static get cmpMeta() { return {
|
|
18660
20307
|
"$flags$": 265,
|
|
18661
20308
|
"$tagName$": "peculiar-attribute-certificate-viewer",
|
|
@@ -18810,12 +20457,12 @@ class CertificateDecoder {
|
|
|
18810
20457
|
this.certificateDecoded = null;
|
|
18811
20458
|
this.clearCertificate.emit();
|
|
18812
20459
|
}
|
|
18813
|
-
setValue(value) {
|
|
20460
|
+
async setValue(value) {
|
|
18814
20461
|
this.certificateDecoded = value;
|
|
18815
|
-
this.inputPaste.value = value.toString('pem');
|
|
18816
|
-
this.successParse.emit(value.toString('base64url'));
|
|
20462
|
+
this.inputPaste.value = await value.toString('pem');
|
|
20463
|
+
this.successParse.emit(await value.toString('base64url'));
|
|
18817
20464
|
}
|
|
18818
|
-
decode(value) {
|
|
20465
|
+
async decode(value) {
|
|
18819
20466
|
new Promise((resolve) => {
|
|
18820
20467
|
resolve(new X509Certificates(value));
|
|
18821
20468
|
})
|
|
@@ -18823,6 +20470,7 @@ class CertificateDecoder {
|
|
|
18823
20470
|
.catch(() => new X509AttributeCertificate(value))
|
|
18824
20471
|
.catch(() => new Pkcs10CertificateRequest(value))
|
|
18825
20472
|
.catch(() => new X509Crl(value))
|
|
20473
|
+
.catch(() => new SshCertificate(value))
|
|
18826
20474
|
.then((res) => this.setValue(res))
|
|
18827
20475
|
.catch((error) => {
|
|
18828
20476
|
console.log(error);
|
|
@@ -18845,11 +20493,14 @@ class CertificateDecoder {
|
|
|
18845
20493
|
if (this.certificateDecoded instanceof X509Crl) {
|
|
18846
20494
|
return (hAsync("peculiar-crl-viewer", { certificate: this.certificateDecoded, download: true }));
|
|
18847
20495
|
}
|
|
20496
|
+
if (this.certificateDecoded instanceof SshCertificate) {
|
|
20497
|
+
return (hAsync("peculiar-ssh-certificate-viewer", { certificate: this.certificateDecoded, download: true }));
|
|
20498
|
+
}
|
|
18848
20499
|
return null;
|
|
18849
20500
|
}
|
|
18850
20501
|
render() {
|
|
18851
20502
|
var _a;
|
|
18852
|
-
return (hAsync(Host, { key: '
|
|
20503
|
+
return (hAsync(Host, { key: '9067f2d7f33a40b3ad0ba03c7338a6f800100dab' }, hAsync("textarea", { key: '9e8962631c259fd5e144a1397d8591dde46d032f', placeholder: "Certificate DER or PEM", class: "textarea t-b2 c-black", ref: (el) => { this.inputPaste = el; }, onDrop: this.handleDropFile }), hAsync("div", { key: '9be2b1e6c9b3de94c9d5e1e6cf31d9fb487960d8', class: "controls" }, hAsync("div", { key: '3959b89ab5c5654a3c10a1166743c056c0340e2e', class: "control_row" }, hAsync(Typography, { key: '3c03f42d14ff5a485264523bab40765bb4f89a8f', variant: "b3", color: "secondary-tint-2" }, "Drag or load file:"), hAsync("input", { key: '3c8682f5de0b0e2f84e37a8a05882ebcf331daef', type: "file", accept: "application/pkix-cert,application/x-x509-ca-cert,application/x-x509-user-cert,application/pkcs10,application/pkix-crl,.csr,.req,.crl,.cert", value: "", onChange: this.handleChangeInputFile })), ((_a = this.certificateExamples) === null || _a === void 0 ? void 0 : _a.length) && (hAsync("div", { key: '7c38788ccf4b038126ddf6909ec1d3de76325660', class: "control_row" }, hAsync(Typography, { key: 'c1c13aaad3d1df51465c6c51ee24f45313de8f1c', variant: "b3", color: "secondary-tint-2" }, "Load examples:"), hAsync("select", { key: '811c4440269bb0a0a55f488e10dfa12093b18d7b', onChange: this.handleChangeExample }, hAsync("option", { key: 'd2e30396fe3a59d5c46c83c6cd1e5b5a58f15f73', value: "" }, "None"), this.certificateExamples.map((example) => (hAsync("option", { value: example.value }, example.title)))))), hAsync("div", { key: '58daae2b9d8e2dd4c698ec9ad6e7f0d8b2500883', class: "control_row" }, hAsync(Button, { key: 'd7f813370ace60deaad975622cc26b9a497ce9d2', onClick: this.handleClickDecode }, "Decode"), hAsync(Button, { key: 'ec2fbeb6283ffd17c7328ee78c9464926b0bbb6b', onClick: this.handleClickClear }, "Clear"))), this.renderCertificate()));
|
|
18853
20504
|
}
|
|
18854
20505
|
static get style() { return certificateDecoderCss; }
|
|
18855
20506
|
static get cmpMeta() { return {
|
|
@@ -18866,7 +20517,7 @@ class CertificateDecoder {
|
|
|
18866
20517
|
}; }
|
|
18867
20518
|
}
|
|
18868
20519
|
|
|
18869
|
-
const certificateViewerCss$
|
|
20520
|
+
const certificateViewerCss$3 = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
18870
20521
|
|
|
18871
20522
|
class CertificateViewer {
|
|
18872
20523
|
constructor(hostRef) {
|
|
@@ -18966,7 +20617,7 @@ class CertificateViewer {
|
|
|
18966
20617
|
static get watchers() { return {
|
|
18967
20618
|
"certificate": ["watchCertificateAndDecode"]
|
|
18968
20619
|
}; }
|
|
18969
|
-
static get style() { return certificateViewerCss$
|
|
20620
|
+
static get style() { return certificateViewerCss$3; }
|
|
18970
20621
|
static get cmpMeta() { return {
|
|
18971
20622
|
"$flags$": 265,
|
|
18972
20623
|
"$tagName$": "peculiar-certificate-viewer",
|
|
@@ -19335,7 +20986,7 @@ class CircularProgress {
|
|
|
19335
20986
|
}; }
|
|
19336
20987
|
}
|
|
19337
20988
|
|
|
19338
|
-
const certificateViewerCss$
|
|
20989
|
+
const certificateViewerCss$2 = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
19339
20990
|
|
|
19340
20991
|
class CrlViewer {
|
|
19341
20992
|
constructor(hostRef) {
|
|
@@ -19428,7 +21079,7 @@ class CrlViewer {
|
|
|
19428
21079
|
static get watchers() { return {
|
|
19429
21080
|
"certificate": ["watchCertificateAndDecode"]
|
|
19430
21081
|
}; }
|
|
19431
|
-
static get style() { return certificateViewerCss$
|
|
21082
|
+
static get style() { return certificateViewerCss$2; }
|
|
19432
21083
|
static get cmpMeta() { return {
|
|
19433
21084
|
"$flags$": 265,
|
|
19434
21085
|
"$tagName$": "peculiar-crl-viewer",
|
|
@@ -19448,7 +21099,7 @@ class CrlViewer {
|
|
|
19448
21099
|
}; }
|
|
19449
21100
|
}
|
|
19450
21101
|
|
|
19451
|
-
const certificateViewerCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
21102
|
+
const certificateViewerCss$1 = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
19452
21103
|
|
|
19453
21104
|
class CsrViewer {
|
|
19454
21105
|
constructor(hostRef) {
|
|
@@ -19540,7 +21191,7 @@ class CsrViewer {
|
|
|
19540
21191
|
static get watchers() { return {
|
|
19541
21192
|
"certificate": ["watchCertificateAndDecode"]
|
|
19542
21193
|
}; }
|
|
19543
|
-
static get style() { return certificateViewerCss; }
|
|
21194
|
+
static get style() { return certificateViewerCss$1; }
|
|
19544
21195
|
static get cmpMeta() { return {
|
|
19545
21196
|
"$flags$": 265,
|
|
19546
21197
|
"$tagName$": "peculiar-csr-viewer",
|
|
@@ -19603,6 +21254,167 @@ class HighlightWords {
|
|
|
19603
21254
|
}; }
|
|
19604
21255
|
}
|
|
19605
21256
|
|
|
21257
|
+
/**
|
|
21258
|
+
* @license
|
|
21259
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
21260
|
+
*
|
|
21261
|
+
* This source code is licensed under the MIT license found in the
|
|
21262
|
+
* LICENSE file in the root directory of this source tree.
|
|
21263
|
+
*/
|
|
21264
|
+
const SshBasicInformation = (props) => {
|
|
21265
|
+
const { serialNumber, validity, notBefore, notAfter, type, keyId, principals, extensions, criticalOptions, } = props;
|
|
21266
|
+
return [
|
|
21267
|
+
hAsync(RowTitle, { value: l10n.getString('basicInformation') }),
|
|
21268
|
+
hAsync(RowValue, { name: l10n.getString('type'), value: type }),
|
|
21269
|
+
hAsync(RowValue, { name: l10n.getString('serialNumber'), value: serialNumber, monospace: true }),
|
|
21270
|
+
hAsync(RowValue, { name: l10n.getString('validity'), value: validity }),
|
|
21271
|
+
hAsync(RowValue, { name: l10n.getString('issued'), value: notBefore ? dateShort(notBefore) : undefined }),
|
|
21272
|
+
hAsync(RowValue, { name: l10n.getString('expired'), value: notAfter ? dateShort(notAfter) : undefined }),
|
|
21273
|
+
hAsync(RowValue, { name: l10n.getString('keyId'), value: keyId }),
|
|
21274
|
+
hAsync(RowValue, { name: l10n.getString('principals'), value: principals.join(', ') }),
|
|
21275
|
+
hAsync(RowValue, { name: l10n.getString('criticalOptions'), value: Object.keys(criticalOptions).join(', ') }),
|
|
21276
|
+
hAsync(RowValue, { name: l10n.getString('extensions'), value: Object.keys(extensions).join(', ') }),
|
|
21277
|
+
];
|
|
21278
|
+
};
|
|
21279
|
+
|
|
21280
|
+
/**
|
|
21281
|
+
* @license
|
|
21282
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
21283
|
+
*
|
|
21284
|
+
* This source code is licensed under the MIT license found in the
|
|
21285
|
+
* LICENSE file in the root directory of this source tree.
|
|
21286
|
+
*/
|
|
21287
|
+
const SshPublicKey = (props) => {
|
|
21288
|
+
const { key } = props;
|
|
21289
|
+
if (!key) {
|
|
21290
|
+
return null;
|
|
21291
|
+
}
|
|
21292
|
+
return [
|
|
21293
|
+
hAsync(RowTitle, { value: l10n.getString('publicKeyInfo') }),
|
|
21294
|
+
hAsync(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(key.algorithm) }),
|
|
21295
|
+
hAsync(RowValue, { name: "Thumbprint (SHA-256)", value: key.thumbprint, monospace: true }),
|
|
21296
|
+
hAsync(RowValue, { name: l10n.getString('value'), value: key.value, monospace: true, collapse: true }),
|
|
21297
|
+
];
|
|
21298
|
+
};
|
|
21299
|
+
|
|
21300
|
+
/**
|
|
21301
|
+
* @license
|
|
21302
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
21303
|
+
*
|
|
21304
|
+
* This source code is licensed under the MIT license found in the
|
|
21305
|
+
* LICENSE file in the root directory of this source tree.
|
|
21306
|
+
*/
|
|
21307
|
+
const SshSignatureKey = (props) => {
|
|
21308
|
+
const { key } = props;
|
|
21309
|
+
if (!key) {
|
|
21310
|
+
return null;
|
|
21311
|
+
}
|
|
21312
|
+
return [
|
|
21313
|
+
hAsync(RowTitle, { value: l10n.getString('signingCA') }),
|
|
21314
|
+
hAsync(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(key.algorithm) }),
|
|
21315
|
+
hAsync(RowValue, { name: "Thumbprint (SHA-256)", value: key.thumbprint, monospace: true }),
|
|
21316
|
+
hAsync(RowValue, { name: l10n.getString('value'), value: key.value, monospace: true, collapse: true }),
|
|
21317
|
+
];
|
|
21318
|
+
};
|
|
21319
|
+
|
|
21320
|
+
const certificateViewerCss = "*{-webkit-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-moz-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:transparent;font-family:var(--pv-font-family, inherit)}.t-h1{font-weight:var(--pv-text-h1-weight);font-size:var(--pv-text-h1-size);line-height:var(--pv-text-h1-height);letter-spacing:var(--pv-text-h1-spacing)}.t-h2{font-weight:var(--pv-text-h2-weight);font-size:var(--pv-text-h2-size);line-height:var(--pv-text-h2-height);letter-spacing:var(--pv-text-h2-spacing)}.t-h3{font-weight:var(--pv-text-h3-weight);font-size:var(--pv-text-h3-size);line-height:var(--pv-text-h3-height);letter-spacing:var(--pv-text-h3-spacing)}.t-h4{font-weight:var(--pv-text-h4-weight);font-size:var(--pv-text-h4-size);line-height:var(--pv-text-h4-height);letter-spacing:var(--pv-text-h4-spacing)}.t-h5{font-weight:var(--pv-text-h5-weight);font-size:var(--pv-text-h5-size);line-height:var(--pv-text-h5-height);letter-spacing:var(--pv-text-h5-spacing)}.t-s1{font-weight:var(--pv-text-s1-weight);font-size:var(--pv-text-s1-size);line-height:var(--pv-text-s1-height);letter-spacing:var(--pv-text-s1-spacing)}.t-s2{font-weight:var(--pv-text-s2-weight);font-size:var(--pv-text-s2-size);line-height:var(--pv-text-s2-height);letter-spacing:var(--pv-text-s2-spacing)}.t-b1{font-weight:var(--pv-text-b1-weight);font-size:var(--pv-text-b1-size);line-height:var(--pv-text-b1-height);letter-spacing:var(--pv-text-b1-spacing)}.t-b2{font-weight:var(--pv-text-b2-weight);font-size:var(--pv-text-b2-size);line-height:var(--pv-text-b2-height);letter-spacing:var(--pv-text-b2-spacing)}.t-b3{font-weight:var(--pv-text-b3-weight);font-size:var(--pv-text-b3-size);line-height:var(--pv-text-b3-height);letter-spacing:var(--pv-text-b3-spacing)}.t-btn1{font-weight:var(--pv-text-btn1-weight);font-size:var(--pv-text-btn1-size);line-height:var(--pv-text-btn1-height);letter-spacing:var(--pv-text-btn1-spacing)}.t-btn2{font-weight:var(--pv-text-btn2-weight);font-size:var(--pv-text-btn2-size);line-height:var(--pv-text-btn2-height);letter-spacing:var(--pv-text-btn2-spacing)}.t-c1{font-weight:var(--pv-text-c1-weight);font-size:var(--pv-text-c1-size);line-height:var(--pv-text-c1-height);letter-spacing:var(--pv-text-c1-spacing)}.t-c2{font-weight:var(--pv-text-c2-weight);font-size:var(--pv-text-c2-size);line-height:var(--pv-text-c2-height);letter-spacing:var(--pv-text-c2-spacing)}.c-primary-tint-5{--pv-color-base:var(--pv-color-primary-tint-5)}.c-primary-tint-4{--pv-color-base:var(--pv-color-primary-tint-4)}.c-primary-tint-3{--pv-color-base:var(--pv-color-primary-tint-3)}.c-primary-tint-2{--pv-color-base:var(--pv-color-primary-tint-2)}.c-primary-tint-1{--pv-color-base:var(--pv-color-primary-tint-1)}.c-primary{--pv-color-base:var(--pv-color-primary)}.c-primary-shade-1{--pv-color-base:var(--pv-color-primary-shade-1)}.c-primary-shade-2{--pv-color-base:var(--pv-color-primary-shade-2)}.c-primary-shade-3{--pv-color-base:var(--pv-color-primary-shade-3)}.c-primary-shade-4{--pv-color-base:var(--pv-color-primary-shade-4)}.c-primary-shade-5{--pv-color-base:var(--pv-color-primary-shade-5)}.c-primary-contrast{--pv-color-base:var(--pv-color-primary-contrast)}.c-secondary-tint-5{--pv-color-base:var(--pv-color-secondary-tint-5)}.c-secondary-tint-4{--pv-color-base:var(--pv-color-secondary-tint-4)}.c-secondary-tint-3{--pv-color-base:var(--pv-color-secondary-tint-3)}.c-secondary-tint-2{--pv-color-base:var(--pv-color-secondary-tint-2)}.c-secondary-tint-1{--pv-color-base:var(--pv-color-secondary-tint-1)}.c-secondary{--pv-color-base:var(--pv-color-secondary)}.c-secondary-shade-1{--pv-color-base:var(--pv-color-secondary-shade-1)}.c-secondary-shade-2{--pv-color-base:var(--pv-color-secondary-shade-2)}.c-secondary-shade-3{--pv-color-base:var(--pv-color-secondary-shade-3)}.c-secondary-shade-4{--pv-color-base:var(--pv-color-secondary-shade-4)}.c-secondary-shade-5{--pv-color-base:var(--pv-color-secondary-shade-5)}.c-secondary-contrast{--pv-color-base:var(--pv-color-secondary-contrast)}.c-wrong-tint-5{--pv-color-base:var(--pv-color-wrong-tint-5)}.c-wrong-tint-4{--pv-color-base:var(--pv-color-wrong-tint-4)}.c-wrong-tint-3{--pv-color-base:var(--pv-color-wrong-tint-3)}.c-wrong-tint-2{--pv-color-base:var(--pv-color-wrong-tint-2)}.c-wrong-tint-1{--pv-color-base:var(--pv-color-wrong-tint-1)}.c-wrong{--pv-color-base:var(--pv-color-wrong)}.c-wrong-shade-1{--pv-color-base:var(--pv-color-wrong-shade-1)}.c-wrong-shade-2{--pv-color-base:var(--pv-color-wrong-shade-2)}.c-wrong-shade-3{--pv-color-base:var(--pv-color-wrong-shade-3)}.c-wrong-shade-4{--pv-color-base:var(--pv-color-wrong-shade-4)}.c-wrong-shade-5{--pv-color-base:var(--pv-color-wrong-shade-5)}.c-wrong-contrast{--pv-color-base:var(--pv-color-wrong-contrast)}.c-attention-tint-5{--pv-color-base:var(--pv-color-attention-tint-5)}.c-attention-tint-4{--pv-color-base:var(--pv-color-attention-tint-4)}.c-attention-tint-3{--pv-color-base:var(--pv-color-attention-tint-3)}.c-attention-tint-2{--pv-color-base:var(--pv-color-attention-tint-2)}.c-attention-tint-1{--pv-color-base:var(--pv-color-attention-tint-1)}.c-attention{--pv-color-base:var(--pv-color-attention)}.c-attention-shade-1{--pv-color-base:var(--pv-color-attention-shade-1)}.c-attention-shade-2{--pv-color-base:var(--pv-color-attention-shade-2)}.c-attention-shade-3{--pv-color-base:var(--pv-color-attention-shade-3)}.c-attention-shade-4{--pv-color-base:var(--pv-color-attention-shade-4)}.c-attention-shade-5{--pv-color-base:var(--pv-color-attention-shade-5)}.c-success-tint-5{--pv-color-base:var(--pv-color-success-tint-5)}.c-success-tint-4{--pv-color-base:var(--pv-color-success-tint-4)}.c-success-tint-3{--pv-color-base:var(--pv-color-success-tint-3)}.c-success-tint-2{--pv-color-base:var(--pv-color-success-tint-2)}.c-success-tint-1{--pv-color-base:var(--pv-color-success-tint-1)}.c-success{--pv-color-base:var(--pv-color-success)}.c-success-shade-1{--pv-color-base:var(--pv-color-success-shade-1)}.c-success-shade-2{--pv-color-base:var(--pv-color-success-shade-2)}.c-success-shade-3{--pv-color-base:var(--pv-color-success-shade-3)}.c-success-shade-4{--pv-color-base:var(--pv-color-success-shade-4)}.c-success-shade-5{--pv-color-base:var(--pv-color-success-shade-5)}.c-black{--pv-color-base:var(--pv-color-black)}.c-gray-10{--pv-color-base:var(--pv-color-gray-10)}.c-gray-9{--pv-color-base:var(--pv-color-gray-9)}.c-gray-8{--pv-color-base:var(--pv-color-gray-8)}.c-gray-7{--pv-color-base:var(--pv-color-gray-7)}.c-gray-6{--pv-color-base:var(--pv-color-gray-6)}.c-gray-5{--pv-color-base:var(--pv-color-gray-5)}.c-gray-4{--pv-color-base:var(--pv-color-gray-4)}.c-gray-3{--pv-color-base:var(--pv-color-gray-3)}.c-gray-2{--pv-color-base:var(--pv-color-gray-2)}.c-gray-1{--pv-color-base:var(--pv-color-gray-1)}.c-white{--pv-color-base:var(--pv-color-white)}.c-extra-1{--pv-color-base:var(--pv-color-extra-1)}.c-extra-2{--pv-color-base:var(--pv-color-extra-2)}.typography{color:var(--pv-color-base)}.button{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer;background:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-decoration:none;outline:none;font-family:inherit;border-radius:4px;height:var(--pv-size-base-6);min-width:var(--pv-size-base-6);padding:0 var(--pv-size-base-2);-webkit-transition:background-color 200ms ease 0s;transition:background-color 200ms ease 0s;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:var(--pv-size-base-2);font-size:0}.button.m_no_padding{padding:0}.button:hover{background-color:var(--pv-color-gray-3)}.button:focus{background-color:var(--pv-color-gray-4)}.button:active{background-color:var(--pv-color-gray-5)}:host{display:block;width:100%;position:relative;min-width:280px;min-height:300px;word-wrap:break-word;word-break:break-word}th,td{border:none}table{width:100%;border-spacing:0;border-collapse:collapse}table tr:last-child .divider{display:none}table td{padding:var(--pv-size-base-2) var(--pv-size-base-4);vertical-align:top}table td:first-child{width:220px}table td:last-child{width:calc(100% - 220px)}table td.monospace{max-width:0}table td.divider{padding:var(--pv-size-base-2) 0}table td.divider span{height:1px;display:block;background-color:var(--pv-color-gray-4)}table .title td{padding-top:var(--pv-size-base-6);padding-bottom:var(--pv-size-base-2)}table table{border-left:1px solid var(--pv-color-gray-5)}.status_wrapper{min-height:inherit;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host([data-mobile-screen-view=true]) table,:host([data-mobile-screen-view=true]) tr,:host([data-mobile-screen-view=true]) td{display:block}:host([data-mobile-screen-view=true]) table tr{padding:var(--pv-size-base-2) 0}:host([data-mobile-screen-view=true]) table tr.title{padding-top:var(--pv-size-base-6)}:host([data-mobile-screen-view=true]) table tr.title td{padding:0 var(--pv-size-base-4)}:host([data-mobile-screen-view=true]) table td{padding:0 var(--pv-size-base-4);width:100% !important;max-width:100% !important}:host([data-mobile-screen-view=true]) table td.divider{padding:0}";
|
|
21321
|
+
|
|
21322
|
+
class SshCertificateViewer {
|
|
21323
|
+
constructor(hostRef) {
|
|
21324
|
+
registerInstance(this, hostRef);
|
|
21325
|
+
/**
|
|
21326
|
+
* Mobile media query string to control screen view change.
|
|
21327
|
+
* <br />
|
|
21328
|
+
* **NOTE**: Based on https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia.
|
|
21329
|
+
* @example
|
|
21330
|
+
* (max-width: 900px)
|
|
21331
|
+
*/
|
|
21332
|
+
this.mobileMediaQueryString = '(max-width: 900px)';
|
|
21333
|
+
this.mobileScreenView = false;
|
|
21334
|
+
this.isDecodeInProcess = true;
|
|
21335
|
+
}
|
|
21336
|
+
handleMediaQueryChange(event) {
|
|
21337
|
+
this.mobileScreenView = event.matches;
|
|
21338
|
+
}
|
|
21339
|
+
componentWillLoad() {
|
|
21340
|
+
this.decodeCertificate(this.certificate);
|
|
21341
|
+
}
|
|
21342
|
+
disconnectedCallback() {
|
|
21343
|
+
this.mobileMediaQuery.removeEventListener('change', this.handleMediaQueryChange.bind(this));
|
|
21344
|
+
}
|
|
21345
|
+
async decodeCertificate(certificate) {
|
|
21346
|
+
this.isDecodeInProcess = true;
|
|
21347
|
+
try {
|
|
21348
|
+
if (certificate instanceof SshCertificate) {
|
|
21349
|
+
this.certificateDecoded = certificate;
|
|
21350
|
+
}
|
|
21351
|
+
else if (typeof certificate === 'string') {
|
|
21352
|
+
this.certificateDecoded = new SshCertificate(certificate);
|
|
21353
|
+
}
|
|
21354
|
+
else {
|
|
21355
|
+
return;
|
|
21356
|
+
}
|
|
21357
|
+
// this.certificateDecoded.parseExtensions();
|
|
21358
|
+
await this.certificateDecoded.parsePublicKey();
|
|
21359
|
+
await this.certificateDecoded.parseSignatureKey();
|
|
21360
|
+
}
|
|
21361
|
+
catch (error) {
|
|
21362
|
+
this.certificateDecodeError = error;
|
|
21363
|
+
console.error('Error certificate parse:', error);
|
|
21364
|
+
}
|
|
21365
|
+
this.isDecodeInProcess = false;
|
|
21366
|
+
}
|
|
21367
|
+
/**
|
|
21368
|
+
* Rerun decodeCertificate if previuos value not equal current value
|
|
21369
|
+
*/
|
|
21370
|
+
watchCertificateAndDecode(newValue, oldValue) {
|
|
21371
|
+
if (typeof newValue === 'string' && typeof oldValue === 'string') {
|
|
21372
|
+
if (newValue !== oldValue) {
|
|
21373
|
+
this.decodeCertificate(newValue);
|
|
21374
|
+
}
|
|
21375
|
+
return;
|
|
21376
|
+
}
|
|
21377
|
+
if (newValue instanceof SshCertificate && oldValue instanceof SshCertificate) {
|
|
21378
|
+
if (newValue.serialNumber !== oldValue.serialNumber) {
|
|
21379
|
+
this.decodeCertificate(newValue);
|
|
21380
|
+
}
|
|
21381
|
+
}
|
|
21382
|
+
}
|
|
21383
|
+
renderErrorState() {
|
|
21384
|
+
return (hAsync("div", { class: "status_wrapper" }, hAsync(Typography, null, "There was an error decoding this certificate.")));
|
|
21385
|
+
}
|
|
21386
|
+
renderEmptyState() {
|
|
21387
|
+
return (hAsync("div", { class: "status_wrapper" }, hAsync(Typography, null, "There is no certificate available.")));
|
|
21388
|
+
}
|
|
21389
|
+
render() {
|
|
21390
|
+
if (this.certificateDecodeError) {
|
|
21391
|
+
return this.renderErrorState();
|
|
21392
|
+
}
|
|
21393
|
+
if (!this.certificateDecoded) {
|
|
21394
|
+
return this.renderEmptyState();
|
|
21395
|
+
}
|
|
21396
|
+
return (hAsync(Host, { "data-mobile-screen-view": String(this.mobileScreenView) }, hAsync("table", null, hAsync(SshBasicInformation, Object.assign({}, this.certificateDecoded)), hAsync(SshPublicKey, { key: this.certificateDecoded.publicKey }), hAsync(SshSignatureKey, { key: this.certificateDecoded.signatureKey }))));
|
|
21397
|
+
}
|
|
21398
|
+
static get watchers() { return {
|
|
21399
|
+
"certificate": ["watchCertificateAndDecode"]
|
|
21400
|
+
}; }
|
|
21401
|
+
static get style() { return certificateViewerCss; }
|
|
21402
|
+
static get cmpMeta() { return {
|
|
21403
|
+
"$flags$": 265,
|
|
21404
|
+
"$tagName$": "peculiar-ssh-certificate-viewer",
|
|
21405
|
+
"$members$": {
|
|
21406
|
+
"certificate": [513],
|
|
21407
|
+
"download": [516],
|
|
21408
|
+
"mobileMediaQueryString": [1, "mobile-media-query-string"],
|
|
21409
|
+
"mobileScreenView": [32],
|
|
21410
|
+
"isDecodeInProcess": [32]
|
|
21411
|
+
},
|
|
21412
|
+
"$listeners$": undefined,
|
|
21413
|
+
"$lazyBundleId$": "-",
|
|
21414
|
+
"$attrsToReflect$": [["certificate", "certificate"], ["download", "download"]]
|
|
21415
|
+
}; }
|
|
21416
|
+
}
|
|
21417
|
+
|
|
19606
21418
|
const textHiderCss = ".sc-peculiar-text-hider-h{display:-ms-flexbox;display:flex;width:100%;gap:var(--pv-size-base-4)}[aria-expanded=true].sc-peculiar-text-hider-h .content.sc-peculiar-text-hider{white-space:initial}.content.sc-peculiar-text-hider{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}.action.sc-peculiar-text-hider{-ms-flex-negative:0;flex-shrink:0;margin-top:calc(var(--pv-size-base) * -1)}";
|
|
19607
21419
|
|
|
19608
21420
|
class TextHider {
|
|
@@ -19637,6 +21449,7 @@ registerComponents([
|
|
|
19637
21449
|
CrlViewer,
|
|
19638
21450
|
CsrViewer,
|
|
19639
21451
|
HighlightWords,
|
|
21452
|
+
SshCertificateViewer,
|
|
19640
21453
|
TextHider,
|
|
19641
21454
|
]);
|
|
19642
21455
|
|