@peculiar/certificates-viewer 4.0.1 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/components/actions.js +21 -0
- package/components/actions.js.map +1 -0
- package/components/arrow_top.js +1 -1
- package/components/attribute-certificate-viewer.js +7 -7
- package/components/attribute-certificate-viewer.js.map +1 -1
- package/components/button-menu.js +2 -14
- package/components/button-menu.js.map +1 -1
- package/components/certificate-viewer.js +5 -5
- package/components/certificate-viewer.js.map +1 -1
- package/components/crl-viewer.js +6 -6
- package/components/crl-viewer.js.map +1 -1
- package/components/cross.js +47 -0
- package/components/cross.js.map +1 -0
- package/components/csr-viewer.js +4 -4
- package/components/csr-viewer.js.map +1 -1
- package/components/download.js +404 -374
- package/components/download.js.map +1 -1
- package/components/index.js +5 -1
- package/components/index.js.map +1 -1
- package/components/index2.js +2 -2
- package/components/index2.js.map +1 -1
- package/components/issuer_name.js +2 -2
- package/components/miscellaneous.js +648 -245
- package/components/miscellaneous.js.map +1 -1
- package/components/peculiar-certificates-viewer.js +4 -42
- package/components/peculiar-certificates-viewer.js.map +1 -1
- package/components/peculiar-text-hider.js +1 -1
- package/components/subject_name.js +2 -2
- package/components/subject_name.js.map +1 -1
- package/dist/cjs/actions-19013d4a.js +23 -0
- package/dist/cjs/actions-19013d4a.js.map +1 -0
- package/dist/cjs/{certification_request-c0cafa72.js → certification_request-bf416170.js} +553 -214
- package/dist/cjs/certification_request-bf416170.js.map +1 -0
- package/dist/cjs/{crl-b4322166.js → crl-d9591b95.js} +14 -14
- package/dist/cjs/{crl-b4322166.js.map → crl-d9591b95.js.map} +1 -1
- package/dist/cjs/cross-9872c473.js +51 -0
- package/dist/cjs/cross-9872c473.js.map +1 -0
- package/dist/cjs/{download-972dda8a.js → download-0fa5b33c.js} +377 -377
- package/dist/cjs/download-0fa5b33c.js.map +1 -0
- package/dist/cjs/index.cjs.js +18 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/cjs/link-6aea0be4.js +25 -0
- package/dist/cjs/link-6aea0be4.js.map +1 -0
- package/dist/cjs/{miscellaneous-806a04a5.js → miscellaneous-6e800553.js} +114 -33
- package/dist/cjs/miscellaneous-6e800553.js.map +1 -0
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js +9 -8
- package/dist/cjs/peculiar-attribute-certificate-viewer_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js +2 -14
- package/dist/cjs/peculiar-button-menu_3.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificate-decoder.cjs.entry.js +4 -4
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js +5 -4
- package/dist/cjs/peculiar-certificate-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js +9 -47
- package/dist/cjs/peculiar-certificates-viewer.cjs.entry.js.map +1 -1
- package/dist/cjs/{x509_certificate-989b1435.js → x509_certificate-53feebd3.js} +7 -7
- package/dist/cjs/{x509_certificate-989b1435.js.map → x509_certificate-53feebd3.js.map} +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/index.js +5 -0
- package/dist/collection/components/certificate-details-parts/extensions/index.js.map +1 -1
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js +80 -0
- package/dist/collection/components/certificate-details-parts/extensions/key_description_extension.js.map +1 -0
- package/dist/collection/constants/oids.js +1 -0
- package/dist/collection/constants/oids.js.map +1 -1
- package/dist/collection/crypto/extension.js +4 -0
- package/dist/collection/crypto/extension.js.map +1 -1
- package/dist/collection/index.js +4 -0
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/utils/camel_case_to_words.js +15 -0
- package/dist/collection/utils/camel_case_to_words.js.map +1 -0
- package/dist/collection/utils/index.js +1 -0
- package/dist/collection/utils/index.js.map +1 -1
- package/dist/esm/actions-8d745b2a.js +21 -0
- package/dist/esm/actions-8d745b2a.js.map +1 -0
- package/dist/esm/{arrow_top-efd3a56d.js → arrow_top-fc298828.js} +2 -2
- package/dist/esm/{arrow_top-efd3a56d.js.map → arrow_top-fc298828.js.map} +1 -1
- package/dist/esm/{certification_request-5cadde9f.js → certification_request-c9dc8e9c.js} +545 -209
- package/dist/esm/certification_request-c9dc8e9c.js.map +1 -0
- package/dist/esm/{crl-11670c3e.js → crl-70e85374.js} +14 -14
- package/dist/esm/{crl-11670c3e.js.map → crl-70e85374.js.map} +1 -1
- package/dist/esm/cross-9ec9a759.js +47 -0
- package/dist/esm/cross-9ec9a759.js.map +1 -0
- package/dist/esm/{download-57c5bf8f.js → download-aacb6eff.js} +375 -375
- package/dist/esm/download-aacb6eff.js.map +1 -0
- package/dist/esm/index.js +8 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/link-ad24c3be.js +23 -0
- package/dist/esm/link-ad24c3be.js.map +1 -0
- package/dist/esm/{miscellaneous-1d4e8b41.js → miscellaneous-0763f98e.js} +108 -27
- package/dist/esm/miscellaneous-0763f98e.js.map +1 -0
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js +9 -8
- package/dist/esm/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm/peculiar-button-menu_3.entry.js +2 -14
- package/dist/esm/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm/peculiar-certificate-decoder.entry.js +4 -4
- package/dist/esm/peculiar-certificate-viewer.entry.js +5 -4
- package/dist/esm/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-certificates-viewer.entry.js +5 -43
- package/dist/esm/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm/peculiar-text-hider.entry.js +1 -1
- package/dist/esm/{x509_certificate-dfae6999.js → x509_certificate-8cf268d1.js} +7 -7
- package/dist/esm/{x509_certificate-dfae6999.js.map → x509_certificate-8cf268d1.js.map} +1 -1
- package/dist/esm-es5/actions-8d745b2a.js +12 -0
- package/dist/esm-es5/actions-8d745b2a.js.map +1 -0
- package/dist/esm-es5/{arrow_top-efd3a56d.js → arrow_top-fc298828.js} +2 -2
- package/dist/esm-es5/certification_request-c9dc8e9c.js +97 -0
- package/dist/esm-es5/certification_request-c9dc8e9c.js.map +1 -0
- package/dist/esm-es5/{crl-11670c3e.js → crl-70e85374.js} +6 -6
- package/dist/esm-es5/{crl-11670c3e.js.map → crl-70e85374.js.map} +1 -1
- package/dist/esm-es5/cross-9ec9a759.js +26 -0
- package/dist/esm-es5/cross-9ec9a759.js.map +1 -0
- package/dist/esm-es5/download-aacb6eff.js +43 -0
- package/dist/esm-es5/download-aacb6eff.js.map +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/link-ad24c3be.js +12 -0
- package/dist/esm-es5/link-ad24c3be.js.map +1 -0
- package/dist/esm-es5/{miscellaneous-1d4e8b41.js → miscellaneous-0763f98e.js} +58 -51
- package/dist/esm-es5/miscellaneous-0763f98e.js.map +1 -0
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js +3 -3
- package/dist/esm-es5/peculiar-attribute-certificate-viewer_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-button-menu_3.entry.js +1 -8
- package/dist/esm-es5/peculiar-button-menu_3.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificate-decoder.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js +1 -1
- package/dist/esm-es5/peculiar-certificate-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js +2 -23
- package/dist/esm-es5/peculiar-certificates-viewer.entry.js.map +1 -1
- package/dist/esm-es5/peculiar-text-hider.entry.js +1 -1
- package/dist/esm-es5/x509_certificate-8cf268d1.js +12 -0
- package/dist/esm-es5/{x509_certificate-dfae6999.js.map → x509_certificate-8cf268d1.js.map} +1 -1
- package/dist/peculiar/index.esm.js +1 -1
- package/dist/peculiar/p-025b3cfb.entry.js +5 -0
- package/dist/peculiar/{p-fd4b9a50.entry.js.map → p-025b3cfb.entry.js.map} +1 -1
- package/dist/peculiar/p-0bd7c6bc.system.entry.js +13 -0
- package/dist/peculiar/p-0bd7c6bc.system.entry.js.map +1 -0
- package/dist/peculiar/{p-709994c1.js → p-0fc2e2b4.js} +2 -2
- package/dist/peculiar/p-10d2d400.system.js +34 -0
- package/dist/peculiar/{p-6667fe6e.system.js.map → p-10d2d400.system.js.map} +1 -1
- package/dist/peculiar/p-14f281b0.system.js +43 -0
- package/dist/peculiar/p-14f281b0.system.js.map +1 -0
- package/dist/peculiar/p-15cb92b5.system.js +97 -0
- package/dist/peculiar/p-15cb92b5.system.js.map +1 -0
- package/dist/peculiar/p-1ceb0fe3.js +12 -0
- package/dist/peculiar/p-1ceb0fe3.js.map +1 -0
- package/dist/peculiar/p-1ef997ee.js +97 -0
- package/dist/peculiar/p-1ef997ee.js.map +1 -0
- package/dist/peculiar/{p-e39de121.system.entry.js → p-24050d82.system.entry.js} +2 -2
- package/dist/peculiar/p-2f48fe70.entry.js +12 -0
- package/dist/peculiar/p-2f48fe70.entry.js.map +1 -0
- package/dist/peculiar/{p-0bdcdbf7.system.js → p-31b60224.system.js} +59 -52
- package/dist/peculiar/p-31b60224.system.js.map +1 -0
- package/dist/peculiar/p-33196289.entry.js +5 -0
- package/dist/peculiar/{p-90459cec.entry.js.map → p-33196289.entry.js.map} +1 -1
- package/dist/peculiar/p-370cee20.js +26 -0
- package/dist/peculiar/p-370cee20.js.map +1 -0
- package/dist/peculiar/{p-7ed7cd97.system.entry.js → p-4ab9673f.system.entry.js} +4 -4
- package/dist/peculiar/{p-7ed7cd97.system.entry.js.map → p-4ab9673f.system.entry.js.map} +1 -1
- package/dist/peculiar/{p-8748391f.system.entry.js → p-5151cb6f.system.entry.js} +2 -2
- package/dist/peculiar/p-53784f15.system.entry.js +5 -0
- package/dist/peculiar/p-53784f15.system.entry.js.map +1 -0
- package/dist/peculiar/p-542412ae.js +33 -0
- package/dist/peculiar/{p-43eb3721.js.map → p-542412ae.js.map} +1 -1
- package/dist/peculiar/p-59e5ac12.js +43 -0
- package/dist/peculiar/p-59e5ac12.js.map +1 -0
- package/dist/peculiar/p-5ab007e9.entry.js +5 -0
- package/dist/peculiar/p-5ab007e9.entry.js.map +1 -0
- package/dist/peculiar/p-5e49b881.system.entry.js +5 -0
- package/dist/peculiar/{p-26981468.system.entry.js.map → p-5e49b881.system.entry.js.map} +1 -1
- package/dist/peculiar/p-6cb88fd6.system.js +13 -0
- package/dist/peculiar/p-6cb88fd6.system.js.map +1 -0
- package/dist/peculiar/p-72f53d81.js +12 -0
- package/dist/peculiar/{p-6e79b9c8.js.map → p-72f53d81.js.map} +1 -1
- package/dist/peculiar/p-80832207.system.js +1 -1
- package/dist/peculiar/p-94a453d7.js +12 -0
- package/dist/peculiar/p-94a453d7.js.map +1 -0
- package/dist/peculiar/{p-f3d85a5f.entry.js → p-9c91dd68.entry.js} +5 -5
- package/dist/peculiar/{p-f3d85a5f.entry.js.map → p-9c91dd68.entry.js.map} +1 -1
- package/dist/peculiar/p-a3eeb94b.system.js +5 -0
- package/dist/peculiar/p-b313be9e.system.js +13 -0
- package/dist/peculiar/p-b313be9e.system.js.map +1 -0
- package/dist/peculiar/{p-daf23673.system.js → p-c99507d4.system.js} +3 -3
- package/dist/peculiar/p-ca02a823.js +362 -0
- package/dist/peculiar/p-ca02a823.js.map +1 -0
- package/dist/peculiar/p-cfca7dae.system.js +13 -0
- package/dist/peculiar/{p-31586b23.system.js.map → p-cfca7dae.system.js.map} +1 -1
- package/dist/peculiar/p-ddae2f8e.system.js +27 -0
- package/dist/peculiar/p-ddae2f8e.system.js.map +1 -0
- package/dist/peculiar/{p-882e1281.entry.js → p-e5b18cd1.entry.js} +2 -2
- package/dist/peculiar/peculiar.esm.js +1 -1
- package/dist/types/components/certificate-details-parts/extensions/key_description_extension.d.ts +15 -0
- package/dist/types/constants/oids.d.ts +1 -0
- package/dist/types/crypto/extension.d.ts +2 -1
- package/dist/types/index.d.ts +4 -0
- package/dist/types/utils/camel_case_to_words.d.ts +8 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/hydrate/index.js +1039 -609
- package/package.json +22 -21
- package/dist/cjs/certification_request-c0cafa72.js.map +0 -1
- package/dist/cjs/download-972dda8a.js.map +0 -1
- package/dist/cjs/miscellaneous-806a04a5.js.map +0 -1
- package/dist/esm/certification_request-5cadde9f.js.map +0 -1
- package/dist/esm/download-57c5bf8f.js.map +0 -1
- package/dist/esm/miscellaneous-1d4e8b41.js.map +0 -1
- package/dist/esm-es5/certification_request-5cadde9f.js +0 -97
- package/dist/esm-es5/certification_request-5cadde9f.js.map +0 -1
- package/dist/esm-es5/download-57c5bf8f.js +0 -19
- package/dist/esm-es5/download-57c5bf8f.js.map +0 -1
- package/dist/esm-es5/miscellaneous-1d4e8b41.js.map +0 -1
- package/dist/esm-es5/x509_certificate-dfae6999.js +0 -12
- package/dist/peculiar/p-0bdcdbf7.system.js.map +0 -1
- package/dist/peculiar/p-23555789.system.entry.js +0 -34
- package/dist/peculiar/p-23555789.system.entry.js.map +0 -1
- package/dist/peculiar/p-26981468.system.entry.js +0 -5
- package/dist/peculiar/p-31586b23.system.js +0 -13
- package/dist/peculiar/p-43eb3721.js +0 -33
- package/dist/peculiar/p-5823e6e8.entry.js +0 -12
- package/dist/peculiar/p-5823e6e8.entry.js.map +0 -1
- package/dist/peculiar/p-596836a7.entry.js +0 -33
- package/dist/peculiar/p-596836a7.entry.js.map +0 -1
- package/dist/peculiar/p-6667fe6e.system.js +0 -34
- package/dist/peculiar/p-6e79b9c8.js +0 -12
- package/dist/peculiar/p-74c241e7.js +0 -97
- package/dist/peculiar/p-74c241e7.js.map +0 -1
- package/dist/peculiar/p-90459cec.entry.js +0 -5
- package/dist/peculiar/p-97688065.js +0 -355
- package/dist/peculiar/p-97688065.js.map +0 -1
- package/dist/peculiar/p-a053c132.js +0 -19
- package/dist/peculiar/p-a053c132.js.map +0 -1
- package/dist/peculiar/p-ae9189f6.system.js +0 -19
- package/dist/peculiar/p-ae9189f6.system.js.map +0 -1
- package/dist/peculiar/p-bd485115.system.entry.js +0 -13
- package/dist/peculiar/p-bd485115.system.entry.js.map +0 -1
- package/dist/peculiar/p-c0a298fd.system.js +0 -97
- package/dist/peculiar/p-c0a298fd.system.js.map +0 -1
- package/dist/peculiar/p-e1960173.system.js +0 -5
- package/dist/peculiar/p-fd4b9a50.entry.js +0 -5
- /package/dist/esm-es5/{arrow_top-efd3a56d.js.map → arrow_top-fc298828.js.map} +0 -0
- /package/dist/peculiar/{p-709994c1.js.map → p-0fc2e2b4.js.map} +0 -0
- /package/dist/peculiar/{p-e39de121.system.entry.js.map → p-24050d82.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-8748391f.system.entry.js.map → p-5151cb6f.system.entry.js.map} +0 -0
- /package/dist/peculiar/{p-e1960173.system.js.map → p-a3eeb94b.system.js.map} +0 -0
- /package/dist/peculiar/{p-daf23673.system.js.map → p-c99507d4.system.js.map} +0 -0
- /package/dist/peculiar/{p-882e1281.entry.js.map → p-e5b18cd1.entry.js.map} +0 -0
package/hydrate/index.js
CHANGED
|
@@ -5767,379 +5767,379 @@ const cmpModules = new Map, getModule = e => {
|
|
|
5767
5767
|
e["s-p"] = [], e["s-rc"] = [], hostRefs.set(e, o);
|
|
5768
5768
|
}, styles = new Map;
|
|
5769
5769
|
|
|
5770
|
-
|
|
5770
|
+
/*!
|
|
5771
|
+
* MIT License
|
|
5772
|
+
*
|
|
5773
|
+
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
5774
|
+
*
|
|
5775
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5776
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
5777
|
+
* in the Software without restriction, including without limitation the rights
|
|
5778
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
5779
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
5780
|
+
* furnished to do so, subject to the following conditions:
|
|
5781
|
+
*
|
|
5782
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
5783
|
+
* copies or substantial portions of the Software.
|
|
5784
|
+
*
|
|
5785
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
5786
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
5787
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
5788
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
5789
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
5790
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
5791
|
+
* SOFTWARE.
|
|
5792
|
+
*
|
|
5793
|
+
*/
|
|
5771
5794
|
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5795
|
+
const ARRAY_BUFFER_NAME = "[object ArrayBuffer]";
|
|
5796
|
+
class BufferSourceConverter {
|
|
5797
|
+
static isArrayBuffer(data) {
|
|
5798
|
+
return Object.prototype.toString.call(data) === ARRAY_BUFFER_NAME;
|
|
5799
|
+
}
|
|
5800
|
+
static toArrayBuffer(data) {
|
|
5801
|
+
if (this.isArrayBuffer(data)) {
|
|
5802
|
+
return data;
|
|
5803
|
+
}
|
|
5804
|
+
if (data.byteLength === data.buffer.byteLength) {
|
|
5805
|
+
return data.buffer;
|
|
5806
|
+
}
|
|
5807
|
+
if (data.byteOffset === 0 && data.byteLength === data.buffer.byteLength) {
|
|
5808
|
+
return data.buffer;
|
|
5809
|
+
}
|
|
5810
|
+
return this.toUint8Array(data.buffer)
|
|
5811
|
+
.slice(data.byteOffset, data.byteOffset + data.byteLength)
|
|
5812
|
+
.buffer;
|
|
5813
|
+
}
|
|
5814
|
+
static toUint8Array(data) {
|
|
5815
|
+
return this.toView(data, Uint8Array);
|
|
5816
|
+
}
|
|
5817
|
+
static toView(data, type) {
|
|
5818
|
+
if (data.constructor === type) {
|
|
5819
|
+
return data;
|
|
5820
|
+
}
|
|
5821
|
+
if (this.isArrayBuffer(data)) {
|
|
5822
|
+
return new type(data);
|
|
5823
|
+
}
|
|
5824
|
+
if (this.isArrayBufferView(data)) {
|
|
5825
|
+
return new type(data.buffer, data.byteOffset, data.byteLength);
|
|
5826
|
+
}
|
|
5827
|
+
throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");
|
|
5828
|
+
}
|
|
5829
|
+
static isBufferSource(data) {
|
|
5830
|
+
return this.isArrayBufferView(data)
|
|
5831
|
+
|| this.isArrayBuffer(data);
|
|
5832
|
+
}
|
|
5833
|
+
static isArrayBufferView(data) {
|
|
5834
|
+
return ArrayBuffer.isView(data)
|
|
5835
|
+
|| (data && this.isArrayBuffer(data.buffer));
|
|
5836
|
+
}
|
|
5837
|
+
static isEqual(a, b) {
|
|
5838
|
+
const aView = BufferSourceConverter.toUint8Array(a);
|
|
5839
|
+
const bView = BufferSourceConverter.toUint8Array(b);
|
|
5840
|
+
if (aView.length !== bView.byteLength) {
|
|
5841
|
+
return false;
|
|
5842
|
+
}
|
|
5843
|
+
for (let i = 0; i < aView.length; i++) {
|
|
5844
|
+
if (aView[i] !== bView[i]) {
|
|
5845
|
+
return false;
|
|
5846
|
+
}
|
|
5847
|
+
}
|
|
5848
|
+
return true;
|
|
5849
|
+
}
|
|
5850
|
+
static concat(...args) {
|
|
5851
|
+
let buffers;
|
|
5852
|
+
if (Array.isArray(args[0]) && !(args[1] instanceof Function)) {
|
|
5853
|
+
buffers = args[0];
|
|
5854
|
+
}
|
|
5855
|
+
else if (Array.isArray(args[0]) && args[1] instanceof Function) {
|
|
5856
|
+
buffers = args[0];
|
|
5857
|
+
}
|
|
5858
|
+
else {
|
|
5859
|
+
if (args[args.length - 1] instanceof Function) {
|
|
5860
|
+
buffers = args.slice(0, args.length - 1);
|
|
5861
|
+
}
|
|
5862
|
+
else {
|
|
5863
|
+
buffers = args;
|
|
5864
|
+
}
|
|
5865
|
+
}
|
|
5866
|
+
let size = 0;
|
|
5867
|
+
for (const buffer of buffers) {
|
|
5868
|
+
size += buffer.byteLength;
|
|
5869
|
+
}
|
|
5870
|
+
const res = new Uint8Array(size);
|
|
5871
|
+
let offset = 0;
|
|
5872
|
+
for (const buffer of buffers) {
|
|
5873
|
+
const view = this.toUint8Array(buffer);
|
|
5874
|
+
res.set(view, offset);
|
|
5875
|
+
offset += view.length;
|
|
5876
|
+
}
|
|
5877
|
+
if (args[args.length - 1] instanceof Function) {
|
|
5878
|
+
return this.toView(res, args[args.length - 1]);
|
|
5879
|
+
}
|
|
5880
|
+
return res.buffer;
|
|
5881
|
+
}
|
|
5780
5882
|
}
|
|
5781
5883
|
|
|
5782
|
-
|
|
5783
|
-
|
|
5884
|
+
const STRING_TYPE = "string";
|
|
5885
|
+
const HEX_REGEX = /^[0-9a-f]+$/i;
|
|
5886
|
+
const BASE64_REGEX = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/;
|
|
5887
|
+
const BASE64URL_REGEX = /^[a-zA-Z0-9-_]+$/;
|
|
5888
|
+
class Utf8Converter {
|
|
5889
|
+
static fromString(text) {
|
|
5890
|
+
const s = unescape(encodeURIComponent(text));
|
|
5891
|
+
const uintArray = new Uint8Array(s.length);
|
|
5892
|
+
for (let i = 0; i < s.length; i++) {
|
|
5893
|
+
uintArray[i] = s.charCodeAt(i);
|
|
5894
|
+
}
|
|
5895
|
+
return uintArray.buffer;
|
|
5896
|
+
}
|
|
5897
|
+
static toString(buffer) {
|
|
5898
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5899
|
+
let encodedString = "";
|
|
5900
|
+
for (let i = 0; i < buf.length; i++) {
|
|
5901
|
+
encodedString += String.fromCharCode(buf[i]);
|
|
5902
|
+
}
|
|
5903
|
+
const decodedString = decodeURIComponent(escape(encodedString));
|
|
5904
|
+
return decodedString;
|
|
5905
|
+
}
|
|
5784
5906
|
}
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
}
|
|
5802
|
-
return
|
|
5803
|
-
}
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
return
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
}
|
|
5840
|
-
static
|
|
5841
|
-
if (
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5907
|
+
class Utf16Converter {
|
|
5908
|
+
static toString(buffer, littleEndian = false) {
|
|
5909
|
+
const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);
|
|
5910
|
+
const dataView = new DataView(arrayBuffer);
|
|
5911
|
+
let res = "";
|
|
5912
|
+
for (let i = 0; i < arrayBuffer.byteLength; i += 2) {
|
|
5913
|
+
const code = dataView.getUint16(i, littleEndian);
|
|
5914
|
+
res += String.fromCharCode(code);
|
|
5915
|
+
}
|
|
5916
|
+
return res;
|
|
5917
|
+
}
|
|
5918
|
+
static fromString(text, littleEndian = false) {
|
|
5919
|
+
const res = new ArrayBuffer(text.length * 2);
|
|
5920
|
+
const dataView = new DataView(res);
|
|
5921
|
+
for (let i = 0; i < text.length; i++) {
|
|
5922
|
+
dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);
|
|
5923
|
+
}
|
|
5924
|
+
return res;
|
|
5925
|
+
}
|
|
5926
|
+
}
|
|
5927
|
+
class Convert {
|
|
5928
|
+
static isHex(data) {
|
|
5929
|
+
return typeof data === STRING_TYPE
|
|
5930
|
+
&& HEX_REGEX.test(data);
|
|
5931
|
+
}
|
|
5932
|
+
static isBase64(data) {
|
|
5933
|
+
return typeof data === STRING_TYPE
|
|
5934
|
+
&& BASE64_REGEX.test(data);
|
|
5935
|
+
}
|
|
5936
|
+
static isBase64Url(data) {
|
|
5937
|
+
return typeof data === STRING_TYPE
|
|
5938
|
+
&& BASE64URL_REGEX.test(data);
|
|
5939
|
+
}
|
|
5940
|
+
static ToString(buffer, enc = "utf8") {
|
|
5941
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5942
|
+
switch (enc.toLowerCase()) {
|
|
5943
|
+
case "utf8":
|
|
5944
|
+
return this.ToUtf8String(buf);
|
|
5945
|
+
case "binary":
|
|
5946
|
+
return this.ToBinary(buf);
|
|
5947
|
+
case "hex":
|
|
5948
|
+
return this.ToHex(buf);
|
|
5949
|
+
case "base64":
|
|
5950
|
+
return this.ToBase64(buf);
|
|
5951
|
+
case "base64url":
|
|
5952
|
+
return this.ToBase64Url(buf);
|
|
5953
|
+
case "utf16le":
|
|
5954
|
+
return Utf16Converter.toString(buf, true);
|
|
5955
|
+
case "utf16":
|
|
5956
|
+
case "utf16be":
|
|
5957
|
+
return Utf16Converter.toString(buf);
|
|
5958
|
+
default:
|
|
5959
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
5960
|
+
}
|
|
5961
|
+
}
|
|
5962
|
+
static FromString(str, enc = "utf8") {
|
|
5963
|
+
if (!str) {
|
|
5964
|
+
return new ArrayBuffer(0);
|
|
5965
|
+
}
|
|
5966
|
+
switch (enc.toLowerCase()) {
|
|
5967
|
+
case "utf8":
|
|
5968
|
+
return this.FromUtf8String(str);
|
|
5969
|
+
case "binary":
|
|
5970
|
+
return this.FromBinary(str);
|
|
5971
|
+
case "hex":
|
|
5972
|
+
return this.FromHex(str);
|
|
5973
|
+
case "base64":
|
|
5974
|
+
return this.FromBase64(str);
|
|
5975
|
+
case "base64url":
|
|
5976
|
+
return this.FromBase64Url(str);
|
|
5977
|
+
case "utf16le":
|
|
5978
|
+
return Utf16Converter.fromString(str, true);
|
|
5979
|
+
case "utf16":
|
|
5980
|
+
case "utf16be":
|
|
5981
|
+
return Utf16Converter.fromString(str);
|
|
5982
|
+
default:
|
|
5983
|
+
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
5984
|
+
}
|
|
5985
|
+
}
|
|
5986
|
+
static ToBase64(buffer) {
|
|
5987
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5988
|
+
if (typeof btoa !== "undefined") {
|
|
5989
|
+
const binary = this.ToString(buf, "binary");
|
|
5990
|
+
return btoa(binary);
|
|
5991
|
+
}
|
|
5992
|
+
else {
|
|
5993
|
+
return Buffer.from(buf).toString("base64");
|
|
5994
|
+
}
|
|
5995
|
+
}
|
|
5996
|
+
static FromBase64(base64) {
|
|
5997
|
+
const formatted = this.formatString(base64);
|
|
5998
|
+
if (!formatted) {
|
|
5999
|
+
return new ArrayBuffer(0);
|
|
6000
|
+
}
|
|
6001
|
+
if (!Convert.isBase64(formatted)) {
|
|
6002
|
+
throw new TypeError("Argument 'base64Text' is not Base64 encoded");
|
|
6003
|
+
}
|
|
6004
|
+
if (typeof atob !== "undefined") {
|
|
6005
|
+
return this.FromBinary(atob(formatted));
|
|
6006
|
+
}
|
|
6007
|
+
else {
|
|
6008
|
+
return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
|
|
6009
|
+
}
|
|
6010
|
+
}
|
|
6011
|
+
static FromBase64Url(base64url) {
|
|
6012
|
+
const formatted = this.formatString(base64url);
|
|
6013
|
+
if (!formatted) {
|
|
6014
|
+
return new ArrayBuffer(0);
|
|
6015
|
+
}
|
|
6016
|
+
if (!Convert.isBase64Url(formatted)) {
|
|
6017
|
+
throw new TypeError("Argument 'base64url' is not Base64Url encoded");
|
|
6018
|
+
}
|
|
6019
|
+
return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/")));
|
|
6020
|
+
}
|
|
6021
|
+
static ToBase64Url(data) {
|
|
6022
|
+
return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
6023
|
+
}
|
|
6024
|
+
static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
6025
|
+
switch (encoding) {
|
|
6026
|
+
case "ascii":
|
|
6027
|
+
return this.FromBinary(text);
|
|
6028
|
+
case "utf8":
|
|
6029
|
+
return Utf8Converter.fromString(text);
|
|
6030
|
+
case "utf16":
|
|
6031
|
+
case "utf16be":
|
|
6032
|
+
return Utf16Converter.fromString(text);
|
|
6033
|
+
case "utf16le":
|
|
6034
|
+
case "usc2":
|
|
6035
|
+
return Utf16Converter.fromString(text, true);
|
|
6036
|
+
default:
|
|
6037
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
6038
|
+
}
|
|
6039
|
+
}
|
|
6040
|
+
static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
6041
|
+
switch (encoding) {
|
|
6042
|
+
case "ascii":
|
|
6043
|
+
return this.ToBinary(buffer);
|
|
6044
|
+
case "utf8":
|
|
6045
|
+
return Utf8Converter.toString(buffer);
|
|
6046
|
+
case "utf16":
|
|
6047
|
+
case "utf16be":
|
|
6048
|
+
return Utf16Converter.toString(buffer);
|
|
6049
|
+
case "utf16le":
|
|
6050
|
+
case "usc2":
|
|
6051
|
+
return Utf16Converter.toString(buffer, true);
|
|
6052
|
+
default:
|
|
6053
|
+
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
6054
|
+
}
|
|
6055
|
+
}
|
|
6056
|
+
static FromBinary(text) {
|
|
6057
|
+
const stringLength = text.length;
|
|
6058
|
+
const resultView = new Uint8Array(stringLength);
|
|
6059
|
+
for (let i = 0; i < stringLength; i++) {
|
|
6060
|
+
resultView[i] = text.charCodeAt(i);
|
|
6061
|
+
}
|
|
6062
|
+
return resultView.buffer;
|
|
6063
|
+
}
|
|
6064
|
+
static ToBinary(buffer) {
|
|
6065
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
6066
|
+
let res = "";
|
|
6067
|
+
for (let i = 0; i < buf.length; i++) {
|
|
6068
|
+
res += String.fromCharCode(buf[i]);
|
|
6069
|
+
}
|
|
6070
|
+
return res;
|
|
6071
|
+
}
|
|
6072
|
+
static ToHex(buffer) {
|
|
6073
|
+
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
6074
|
+
let result = "";
|
|
6075
|
+
const len = buf.length;
|
|
6076
|
+
for (let i = 0; i < len; i++) {
|
|
6077
|
+
const byte = buf[i];
|
|
6078
|
+
if (byte < 16) {
|
|
6079
|
+
result += "0";
|
|
6080
|
+
}
|
|
6081
|
+
result += byte.toString(16);
|
|
6082
|
+
}
|
|
6083
|
+
return result;
|
|
6084
|
+
}
|
|
6085
|
+
static FromHex(hexString) {
|
|
6086
|
+
let formatted = this.formatString(hexString);
|
|
6087
|
+
if (!formatted) {
|
|
6088
|
+
return new ArrayBuffer(0);
|
|
6089
|
+
}
|
|
6090
|
+
if (!Convert.isHex(formatted)) {
|
|
6091
|
+
throw new TypeError("Argument 'hexString' is not HEX encoded");
|
|
6092
|
+
}
|
|
6093
|
+
if (formatted.length % 2) {
|
|
6094
|
+
formatted = `0${formatted}`;
|
|
6095
|
+
}
|
|
6096
|
+
const res = new Uint8Array(formatted.length / 2);
|
|
6097
|
+
for (let i = 0; i < formatted.length; i = i + 2) {
|
|
6098
|
+
const c = formatted.slice(i, i + 2);
|
|
6099
|
+
res[i / 2] = parseInt(c, 16);
|
|
6100
|
+
}
|
|
6101
|
+
return res.buffer;
|
|
6102
|
+
}
|
|
6103
|
+
static ToUtf16String(buffer, littleEndian = false) {
|
|
6104
|
+
return Utf16Converter.toString(buffer, littleEndian);
|
|
6105
|
+
}
|
|
6106
|
+
static FromUtf16String(text, littleEndian = false) {
|
|
6107
|
+
return Utf16Converter.fromString(text, littleEndian);
|
|
6108
|
+
}
|
|
6109
|
+
static Base64Padding(base64) {
|
|
6110
|
+
const padCount = 4 - (base64.length % 4);
|
|
6111
|
+
if (padCount < 4) {
|
|
6112
|
+
for (let i = 0; i < padCount; i++) {
|
|
6113
|
+
base64 += "=";
|
|
6114
|
+
}
|
|
6115
|
+
}
|
|
6116
|
+
return base64;
|
|
6117
|
+
}
|
|
6118
|
+
static formatString(data) {
|
|
6119
|
+
return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || "";
|
|
6120
|
+
}
|
|
5863
6121
|
}
|
|
5864
|
-
|
|
5865
|
-
class Utf8Converter {
|
|
5866
|
-
static fromString(text) {
|
|
5867
|
-
const s = unescape(encodeURIComponent(text));
|
|
5868
|
-
const uintArray = new Uint8Array(s.length);
|
|
5869
|
-
for (let i = 0; i < s.length; i++) {
|
|
5870
|
-
uintArray[i] = s.charCodeAt(i);
|
|
5871
|
-
}
|
|
5872
|
-
return uintArray.buffer;
|
|
5873
|
-
}
|
|
5874
|
-
static toString(buffer) {
|
|
5875
|
-
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5876
|
-
let encodedString = "";
|
|
5877
|
-
for (let i = 0; i < buf.length; i++) {
|
|
5878
|
-
encodedString += String.fromCharCode(buf[i]);
|
|
5879
|
-
}
|
|
5880
|
-
const decodedString = decodeURIComponent(escape(encodedString));
|
|
5881
|
-
return decodedString;
|
|
5882
|
-
}
|
|
5883
|
-
}
|
|
5884
|
-
class Utf16Converter {
|
|
5885
|
-
static toString(buffer, littleEndian = false) {
|
|
5886
|
-
const arrayBuffer = BufferSourceConverter.toArrayBuffer(buffer);
|
|
5887
|
-
const dataView = new DataView(arrayBuffer);
|
|
5888
|
-
let res = "";
|
|
5889
|
-
for (let i = 0; i < arrayBuffer.byteLength; i += 2) {
|
|
5890
|
-
const code = dataView.getUint16(i, littleEndian);
|
|
5891
|
-
res += String.fromCharCode(code);
|
|
5892
|
-
}
|
|
5893
|
-
return res;
|
|
5894
|
-
}
|
|
5895
|
-
static fromString(text, littleEndian = false) {
|
|
5896
|
-
const res = new ArrayBuffer(text.length * 2);
|
|
5897
|
-
const dataView = new DataView(res);
|
|
5898
|
-
for (let i = 0; i < text.length; i++) {
|
|
5899
|
-
dataView.setUint16(i * 2, text.charCodeAt(i), littleEndian);
|
|
5900
|
-
}
|
|
5901
|
-
return res;
|
|
5902
|
-
}
|
|
5903
|
-
}
|
|
5904
|
-
class Convert {
|
|
5905
|
-
static isHex(data) {
|
|
5906
|
-
return typeof data === "string"
|
|
5907
|
-
&& /^[a-z0-9]+$/i.test(data);
|
|
5908
|
-
}
|
|
5909
|
-
static isBase64(data) {
|
|
5910
|
-
return typeof data === "string"
|
|
5911
|
-
&& /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(data);
|
|
5912
|
-
}
|
|
5913
|
-
static isBase64Url(data) {
|
|
5914
|
-
return typeof data === "string"
|
|
5915
|
-
&& /^[a-zA-Z0-9-_]+$/i.test(data);
|
|
5916
|
-
}
|
|
5917
|
-
static ToString(buffer, enc = "utf8") {
|
|
5918
|
-
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5919
|
-
switch (enc.toLowerCase()) {
|
|
5920
|
-
case "utf8":
|
|
5921
|
-
return this.ToUtf8String(buf);
|
|
5922
|
-
case "binary":
|
|
5923
|
-
return this.ToBinary(buf);
|
|
5924
|
-
case "hex":
|
|
5925
|
-
return this.ToHex(buf);
|
|
5926
|
-
case "base64":
|
|
5927
|
-
return this.ToBase64(buf);
|
|
5928
|
-
case "base64url":
|
|
5929
|
-
return this.ToBase64Url(buf);
|
|
5930
|
-
case "utf16le":
|
|
5931
|
-
return Utf16Converter.toString(buf, true);
|
|
5932
|
-
case "utf16":
|
|
5933
|
-
case "utf16be":
|
|
5934
|
-
return Utf16Converter.toString(buf);
|
|
5935
|
-
default:
|
|
5936
|
-
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
5937
|
-
}
|
|
5938
|
-
}
|
|
5939
|
-
static FromString(str, enc = "utf8") {
|
|
5940
|
-
if (!str) {
|
|
5941
|
-
return new ArrayBuffer(0);
|
|
5942
|
-
}
|
|
5943
|
-
switch (enc.toLowerCase()) {
|
|
5944
|
-
case "utf8":
|
|
5945
|
-
return this.FromUtf8String(str);
|
|
5946
|
-
case "binary":
|
|
5947
|
-
return this.FromBinary(str);
|
|
5948
|
-
case "hex":
|
|
5949
|
-
return this.FromHex(str);
|
|
5950
|
-
case "base64":
|
|
5951
|
-
return this.FromBase64(str);
|
|
5952
|
-
case "base64url":
|
|
5953
|
-
return this.FromBase64Url(str);
|
|
5954
|
-
case "utf16le":
|
|
5955
|
-
return Utf16Converter.fromString(str, true);
|
|
5956
|
-
case "utf16":
|
|
5957
|
-
case "utf16be":
|
|
5958
|
-
return Utf16Converter.fromString(str);
|
|
5959
|
-
default:
|
|
5960
|
-
throw new Error(`Unknown type of encoding '${enc}'`);
|
|
5961
|
-
}
|
|
5962
|
-
}
|
|
5963
|
-
static ToBase64(buffer) {
|
|
5964
|
-
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
5965
|
-
if (typeof btoa !== "undefined") {
|
|
5966
|
-
const binary = this.ToString(buf, "binary");
|
|
5967
|
-
return btoa(binary);
|
|
5968
|
-
}
|
|
5969
|
-
else {
|
|
5970
|
-
return Buffer.from(buf).toString("base64");
|
|
5971
|
-
}
|
|
5972
|
-
}
|
|
5973
|
-
static FromBase64(base64) {
|
|
5974
|
-
const formatted = this.formatString(base64);
|
|
5975
|
-
if (!formatted) {
|
|
5976
|
-
return new ArrayBuffer(0);
|
|
5977
|
-
}
|
|
5978
|
-
if (!Convert.isBase64(formatted)) {
|
|
5979
|
-
throw new TypeError("Argument 'base64Text' is not Base64 encoded");
|
|
5980
|
-
}
|
|
5981
|
-
if (typeof atob !== "undefined") {
|
|
5982
|
-
return this.FromBinary(atob(formatted));
|
|
5983
|
-
}
|
|
5984
|
-
else {
|
|
5985
|
-
return new Uint8Array(Buffer.from(formatted, "base64")).buffer;
|
|
5986
|
-
}
|
|
5987
|
-
}
|
|
5988
|
-
static FromBase64Url(base64url) {
|
|
5989
|
-
const formatted = this.formatString(base64url);
|
|
5990
|
-
if (!formatted) {
|
|
5991
|
-
return new ArrayBuffer(0);
|
|
5992
|
-
}
|
|
5993
|
-
if (!Convert.isBase64Url(formatted)) {
|
|
5994
|
-
throw new TypeError("Argument 'base64url' is not Base64Url encoded");
|
|
5995
|
-
}
|
|
5996
|
-
return this.FromBase64(this.Base64Padding(formatted.replace(/\-/g, "+").replace(/\_/g, "/")));
|
|
5997
|
-
}
|
|
5998
|
-
static ToBase64Url(data) {
|
|
5999
|
-
return this.ToBase64(data).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
6000
|
-
}
|
|
6001
|
-
static FromUtf8String(text, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
6002
|
-
switch (encoding) {
|
|
6003
|
-
case "ascii":
|
|
6004
|
-
return this.FromBinary(text);
|
|
6005
|
-
case "utf8":
|
|
6006
|
-
return Utf8Converter.fromString(text);
|
|
6007
|
-
case "utf16":
|
|
6008
|
-
case "utf16be":
|
|
6009
|
-
return Utf16Converter.fromString(text);
|
|
6010
|
-
case "utf16le":
|
|
6011
|
-
case "usc2":
|
|
6012
|
-
return Utf16Converter.fromString(text, true);
|
|
6013
|
-
default:
|
|
6014
|
-
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
6015
|
-
}
|
|
6016
|
-
}
|
|
6017
|
-
static ToUtf8String(buffer, encoding = Convert.DEFAULT_UTF8_ENCODING) {
|
|
6018
|
-
switch (encoding) {
|
|
6019
|
-
case "ascii":
|
|
6020
|
-
return this.ToBinary(buffer);
|
|
6021
|
-
case "utf8":
|
|
6022
|
-
return Utf8Converter.toString(buffer);
|
|
6023
|
-
case "utf16":
|
|
6024
|
-
case "utf16be":
|
|
6025
|
-
return Utf16Converter.toString(buffer);
|
|
6026
|
-
case "utf16le":
|
|
6027
|
-
case "usc2":
|
|
6028
|
-
return Utf16Converter.toString(buffer, true);
|
|
6029
|
-
default:
|
|
6030
|
-
throw new Error(`Unknown type of encoding '${encoding}'`);
|
|
6031
|
-
}
|
|
6032
|
-
}
|
|
6033
|
-
static FromBinary(text) {
|
|
6034
|
-
const stringLength = text.length;
|
|
6035
|
-
const resultView = new Uint8Array(stringLength);
|
|
6036
|
-
for (let i = 0; i < stringLength; i++) {
|
|
6037
|
-
resultView[i] = text.charCodeAt(i);
|
|
6038
|
-
}
|
|
6039
|
-
return resultView.buffer;
|
|
6040
|
-
}
|
|
6041
|
-
static ToBinary(buffer) {
|
|
6042
|
-
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
6043
|
-
let res = "";
|
|
6044
|
-
for (let i = 0; i < buf.length; i++) {
|
|
6045
|
-
res += String.fromCharCode(buf[i]);
|
|
6046
|
-
}
|
|
6047
|
-
return res;
|
|
6048
|
-
}
|
|
6049
|
-
static ToHex(buffer) {
|
|
6050
|
-
const buf = BufferSourceConverter.toUint8Array(buffer);
|
|
6051
|
-
const splitter = "";
|
|
6052
|
-
const res = [];
|
|
6053
|
-
const len = buf.length;
|
|
6054
|
-
for (let i = 0; i < len; i++) {
|
|
6055
|
-
const char = buf[i].toString(16).padStart(2, "0");
|
|
6056
|
-
res.push(char);
|
|
6057
|
-
}
|
|
6058
|
-
return res.join(splitter);
|
|
6059
|
-
}
|
|
6060
|
-
static FromHex(hexString) {
|
|
6061
|
-
let formatted = this.formatString(hexString);
|
|
6062
|
-
if (!formatted) {
|
|
6063
|
-
return new ArrayBuffer(0);
|
|
6064
|
-
}
|
|
6065
|
-
if (!Convert.isHex(formatted)) {
|
|
6066
|
-
throw new TypeError("Argument 'hexString' is not HEX encoded");
|
|
6067
|
-
}
|
|
6068
|
-
if (formatted.length % 2) {
|
|
6069
|
-
formatted = `0${formatted}`;
|
|
6070
|
-
}
|
|
6071
|
-
const res = new Uint8Array(formatted.length / 2);
|
|
6072
|
-
for (let i = 0; i < formatted.length; i = i + 2) {
|
|
6073
|
-
const c = formatted.slice(i, i + 2);
|
|
6074
|
-
res[i / 2] = parseInt(c, 16);
|
|
6075
|
-
}
|
|
6076
|
-
return res.buffer;
|
|
6077
|
-
}
|
|
6078
|
-
static ToUtf16String(buffer, littleEndian = false) {
|
|
6079
|
-
return Utf16Converter.toString(buffer, littleEndian);
|
|
6080
|
-
}
|
|
6081
|
-
static FromUtf16String(text, littleEndian = false) {
|
|
6082
|
-
return Utf16Converter.fromString(text, littleEndian);
|
|
6083
|
-
}
|
|
6084
|
-
static Base64Padding(base64) {
|
|
6085
|
-
const padCount = 4 - (base64.length % 4);
|
|
6086
|
-
if (padCount < 4) {
|
|
6087
|
-
for (let i = 0; i < padCount; i++) {
|
|
6088
|
-
base64 += "=";
|
|
6089
|
-
}
|
|
6090
|
-
}
|
|
6091
|
-
return base64;
|
|
6092
|
-
}
|
|
6093
|
-
static formatString(data) {
|
|
6094
|
-
return (data === null || data === void 0 ? void 0 : data.replace(/[\n\r\t ]/g, "")) || "";
|
|
6095
|
-
}
|
|
6096
|
-
}
|
|
6097
6122
|
Convert.DEFAULT_UTF8_ENCODING = "utf8";
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
buf.map((item) => new Uint8Array(item)).forEach((arr) => {
|
|
6114
|
-
for (const item2 of arr) {
|
|
6115
|
-
res[currentPos++] = item2;
|
|
6116
|
-
}
|
|
6117
|
-
});
|
|
6118
|
-
return res.buffer;
|
|
6119
|
-
}
|
|
6120
|
-
function isEqual(bytes1, bytes2) {
|
|
6121
|
-
if (!(bytes1 && bytes2)) {
|
|
6122
|
-
return false;
|
|
6123
|
-
}
|
|
6124
|
-
if (bytes1.byteLength !== bytes2.byteLength) {
|
|
6125
|
-
return false;
|
|
6126
|
-
}
|
|
6127
|
-
const b1 = new Uint8Array(bytes1);
|
|
6128
|
-
const b2 = new Uint8Array(bytes2);
|
|
6129
|
-
for (let i = 0; i < bytes1.byteLength; i++) {
|
|
6130
|
-
if (b1[i] !== b2[i]) {
|
|
6131
|
-
return false;
|
|
6132
|
-
}
|
|
6133
|
-
}
|
|
6134
|
-
return true;
|
|
6123
|
+
function isEqual(bytes1, bytes2) {
|
|
6124
|
+
if (!(bytes1 && bytes2)) {
|
|
6125
|
+
return false;
|
|
6126
|
+
}
|
|
6127
|
+
if (bytes1.byteLength !== bytes2.byteLength) {
|
|
6128
|
+
return false;
|
|
6129
|
+
}
|
|
6130
|
+
const b1 = new Uint8Array(bytes1);
|
|
6131
|
+
const b2 = new Uint8Array(bytes2);
|
|
6132
|
+
for (let i = 0; i < bytes1.byteLength; i++) {
|
|
6133
|
+
if (b1[i] !== b2[i]) {
|
|
6134
|
+
return false;
|
|
6135
|
+
}
|
|
6136
|
+
}
|
|
6137
|
+
return true;
|
|
6135
6138
|
}
|
|
6136
6139
|
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
exports.combine = combine;
|
|
6141
|
-
exports.isEqual = isEqual;
|
|
6142
|
-
});
|
|
6140
|
+
var BufferSourceConverter_1 = BufferSourceConverter;
|
|
6141
|
+
var Convert_1 = Convert;
|
|
6142
|
+
var isEqual_1 = isEqual;
|
|
6143
6143
|
|
|
6144
6144
|
/*!
|
|
6145
6145
|
Copyright (c) Peculiar Ventures, LLC
|
|
@@ -6398,7 +6398,7 @@ function HexBlock(BaseClass) {
|
|
|
6398
6398
|
super(...args);
|
|
6399
6399
|
const params = args[0] || {};
|
|
6400
6400
|
this.isHexOnly = (_a = params.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
6401
|
-
this.valueHexView = params.valueHex ?
|
|
6401
|
+
this.valueHexView = params.valueHex ? BufferSourceConverter_1.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
6402
6402
|
}
|
|
6403
6403
|
get valueHex() {
|
|
6404
6404
|
return this.valueHexView.slice().buffer;
|
|
@@ -6436,7 +6436,7 @@ function HexBlock(BaseClass) {
|
|
|
6436
6436
|
return {
|
|
6437
6437
|
...super.toJSON(),
|
|
6438
6438
|
isHexOnly: this.isHexOnly,
|
|
6439
|
-
valueHex:
|
|
6439
|
+
valueHex: Convert_1.ToHex(this.valueHexView),
|
|
6440
6440
|
};
|
|
6441
6441
|
}
|
|
6442
6442
|
},
|
|
@@ -6449,7 +6449,7 @@ class LocalBaseBlock {
|
|
|
6449
6449
|
this.blockLength = blockLength;
|
|
6450
6450
|
this.error = error;
|
|
6451
6451
|
this.warnings = warnings;
|
|
6452
|
-
this.valueBeforeDecodeView =
|
|
6452
|
+
this.valueBeforeDecodeView = BufferSourceConverter_1.toUint8Array(valueBeforeDecode);
|
|
6453
6453
|
}
|
|
6454
6454
|
static blockName() {
|
|
6455
6455
|
return this.NAME;
|
|
@@ -6466,7 +6466,7 @@ class LocalBaseBlock {
|
|
|
6466
6466
|
blockLength: this.blockLength,
|
|
6467
6467
|
error: this.error,
|
|
6468
6468
|
warnings: this.warnings,
|
|
6469
|
-
valueBeforeDecode:
|
|
6469
|
+
valueBeforeDecode: Convert_1.ToHex(this.valueBeforeDecodeView),
|
|
6470
6470
|
};
|
|
6471
6471
|
}
|
|
6472
6472
|
}
|
|
@@ -6488,7 +6488,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
6488
6488
|
super();
|
|
6489
6489
|
if (idBlock) {
|
|
6490
6490
|
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
6491
|
-
this.valueHexView = idBlock.valueHex ?
|
|
6491
|
+
this.valueHexView = idBlock.valueHex ? BufferSourceConverter_1.toUint8Array(idBlock.valueHex) : EMPTY_VIEW;
|
|
6492
6492
|
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
6493
6493
|
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
6494
6494
|
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
@@ -6554,7 +6554,7 @@ class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
|
6554
6554
|
return retView.buffer;
|
|
6555
6555
|
}
|
|
6556
6556
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
6557
|
-
const inputView =
|
|
6557
|
+
const inputView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
6558
6558
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
6559
6559
|
return -1;
|
|
6560
6560
|
}
|
|
@@ -6663,7 +6663,7 @@ class LocalLengthBlock extends LocalBaseBlock {
|
|
|
6663
6663
|
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
6664
6664
|
}
|
|
6665
6665
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
6666
|
-
const view =
|
|
6666
|
+
const view = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
6667
6667
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
6668
6668
|
return -1;
|
|
6669
6669
|
}
|
|
@@ -6822,10 +6822,10 @@ class BaseBlock extends LocalBaseBlock {
|
|
|
6822
6822
|
if (encoding === "ascii") {
|
|
6823
6823
|
return this.onAsciiEncoding();
|
|
6824
6824
|
}
|
|
6825
|
-
return
|
|
6825
|
+
return Convert_1.ToHex(this.toBER());
|
|
6826
6826
|
}
|
|
6827
6827
|
onAsciiEncoding() {
|
|
6828
|
-
return `${this.constructor.NAME} : ${
|
|
6828
|
+
return `${this.constructor.NAME} : ${Convert_1.ToHex(this.valueBlock.valueBeforeDecodeView)}`;
|
|
6829
6829
|
}
|
|
6830
6830
|
isEqual(other) {
|
|
6831
6831
|
if (this === other) {
|
|
@@ -7123,7 +7123,7 @@ function fromBER(inputBuffer) {
|
|
|
7123
7123
|
result
|
|
7124
7124
|
};
|
|
7125
7125
|
}
|
|
7126
|
-
return localFromBER(
|
|
7126
|
+
return localFromBER(BufferSourceConverter_1.toUint8Array(inputBuffer).slice(), 0, inputBuffer.byteLength);
|
|
7127
7127
|
}
|
|
7128
7128
|
|
|
7129
7129
|
function checkLen(indefiniteLength, length) {
|
|
@@ -7139,7 +7139,7 @@ class LocalConstructedValueBlock extends ValueBlock {
|
|
|
7139
7139
|
this.isIndefiniteForm = isIndefiniteForm;
|
|
7140
7140
|
}
|
|
7141
7141
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
7142
|
-
const view =
|
|
7142
|
+
const view = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
7143
7143
|
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
7144
7144
|
return -1;
|
|
7145
7145
|
}
|
|
@@ -7309,7 +7309,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
7309
7309
|
constructor({ value, ...parameters } = {}) {
|
|
7310
7310
|
super(parameters);
|
|
7311
7311
|
if (parameters.valueHex) {
|
|
7312
|
-
this.valueHexView =
|
|
7312
|
+
this.valueHexView = BufferSourceConverter_1.toUint8Array(parameters.valueHex);
|
|
7313
7313
|
}
|
|
7314
7314
|
else {
|
|
7315
7315
|
this.valueHexView = new Uint8Array(1);
|
|
@@ -7330,7 +7330,7 @@ class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
|
7330
7330
|
this.valueHexView[0] = value ? 0xFF : 0x00;
|
|
7331
7331
|
}
|
|
7332
7332
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
7333
|
-
const inputView =
|
|
7333
|
+
const inputView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
7334
7334
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
7335
7335
|
return -1;
|
|
7336
7336
|
}
|
|
@@ -7477,7 +7477,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
7477
7477
|
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
7478
7478
|
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
7479
7479
|
}
|
|
7480
|
-
return `${this.constructor.NAME} : ${
|
|
7480
|
+
return `${this.constructor.NAME} : ${Convert_1.ToHex(this.valueBlock.valueHexView)}`;
|
|
7481
7481
|
}
|
|
7482
7482
|
getValue() {
|
|
7483
7483
|
if (!this.idBlock.isConstructed) {
|
|
@@ -7489,7 +7489,7 @@ class OctetString$1 extends BaseBlock {
|
|
|
7489
7489
|
array.push(content.valueBlock.valueHexView);
|
|
7490
7490
|
}
|
|
7491
7491
|
}
|
|
7492
|
-
return
|
|
7492
|
+
return BufferSourceConverter_1.concat(array);
|
|
7493
7493
|
}
|
|
7494
7494
|
}
|
|
7495
7495
|
_a$r = OctetString$1;
|
|
@@ -7537,7 +7537,7 @@ class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
|
7537
7537
|
}
|
|
7538
7538
|
return resultOffset;
|
|
7539
7539
|
}
|
|
7540
|
-
const inputView =
|
|
7540
|
+
const inputView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
7541
7541
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
7542
7542
|
return -1;
|
|
7543
7543
|
}
|
|
@@ -7877,13 +7877,13 @@ class Integer extends BaseBlock {
|
|
|
7877
7877
|
const bigIntValue = BigInt(value);
|
|
7878
7878
|
const writer = new ViewWriter();
|
|
7879
7879
|
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
7880
|
-
const view = new Uint8Array(
|
|
7880
|
+
const view = new Uint8Array(Convert_1.FromHex(hex));
|
|
7881
7881
|
if (bigIntValue < 0) {
|
|
7882
7882
|
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
7883
7883
|
first[0] |= 0x80;
|
|
7884
|
-
const firstInt = BigInt(`0x${
|
|
7884
|
+
const firstInt = BigInt(`0x${Convert_1.ToHex(first)}`);
|
|
7885
7885
|
const secondInt = firstInt + bigIntValue;
|
|
7886
|
-
const second =
|
|
7886
|
+
const second = BufferSourceConverter_1.toUint8Array(Convert_1.FromHex(secondInt.toString(16)));
|
|
7887
7887
|
second[0] |= 0x80;
|
|
7888
7888
|
writer.write(second);
|
|
7889
7889
|
}
|
|
@@ -7944,7 +7944,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
7944
7944
|
if (!inputLength) {
|
|
7945
7945
|
return inputOffset;
|
|
7946
7946
|
}
|
|
7947
|
-
const inputView =
|
|
7947
|
+
const inputView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
7948
7948
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
7949
7949
|
return -1;
|
|
7950
7950
|
}
|
|
@@ -8016,7 +8016,7 @@ class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
|
8016
8016
|
toString() {
|
|
8017
8017
|
let result = "";
|
|
8018
8018
|
if (this.isHexOnly)
|
|
8019
|
-
result =
|
|
8019
|
+
result = Convert_1.ToHex(this.valueHexView);
|
|
8020
8020
|
else {
|
|
8021
8021
|
if (this.isFirstSid) {
|
|
8022
8022
|
let sidValue = this.valueDec;
|
|
@@ -8213,7 +8213,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
8213
8213
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
8214
8214
|
if (inputLength === 0)
|
|
8215
8215
|
return inputOffset;
|
|
8216
|
-
const inputView =
|
|
8216
|
+
const inputView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
8217
8217
|
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
8218
8218
|
return -1;
|
|
8219
8219
|
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
@@ -8271,7 +8271,7 @@ class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
|
8271
8271
|
toString() {
|
|
8272
8272
|
let result = "";
|
|
8273
8273
|
if (this.isHexOnly)
|
|
8274
|
-
result =
|
|
8274
|
+
result = Convert_1.ToHex(this.valueHexView);
|
|
8275
8275
|
else {
|
|
8276
8276
|
result = this.valueDec.toString();
|
|
8277
8277
|
}
|
|
@@ -8453,7 +8453,7 @@ class LocalSimpleStringBlock extends BaseStringBlock {
|
|
|
8453
8453
|
super(parameters, LocalSimpleStringValueBlock);
|
|
8454
8454
|
}
|
|
8455
8455
|
fromBuffer(inputBuffer) {
|
|
8456
|
-
this.valueBlock.value = String.fromCharCode.apply(null,
|
|
8456
|
+
this.valueBlock.value = String.fromCharCode.apply(null, BufferSourceConverter_1.toUint8Array(inputBuffer));
|
|
8457
8457
|
}
|
|
8458
8458
|
fromString(inputString) {
|
|
8459
8459
|
const strLen = inputString.length;
|
|
@@ -8467,17 +8467,17 @@ LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
|
8467
8467
|
|
|
8468
8468
|
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
8469
8469
|
fromBuffer(inputBuffer) {
|
|
8470
|
-
this.valueBlock.valueHexView =
|
|
8470
|
+
this.valueBlock.valueHexView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
8471
8471
|
try {
|
|
8472
|
-
this.valueBlock.value =
|
|
8472
|
+
this.valueBlock.value = Convert_1.ToUtf8String(inputBuffer);
|
|
8473
8473
|
}
|
|
8474
8474
|
catch (ex) {
|
|
8475
8475
|
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
8476
|
-
this.valueBlock.value =
|
|
8476
|
+
this.valueBlock.value = Convert_1.ToBinary(inputBuffer);
|
|
8477
8477
|
}
|
|
8478
8478
|
}
|
|
8479
8479
|
fromString(inputString) {
|
|
8480
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
8480
|
+
this.valueBlock.valueHexView = new Uint8Array(Convert_1.FromUtf8String(inputString));
|
|
8481
8481
|
this.valueBlock.value = inputString;
|
|
8482
8482
|
}
|
|
8483
8483
|
}
|
|
@@ -8499,12 +8499,12 @@ Utf8String.NAME = "UTF8String";
|
|
|
8499
8499
|
|
|
8500
8500
|
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
8501
8501
|
fromBuffer(inputBuffer) {
|
|
8502
|
-
this.valueBlock.value =
|
|
8503
|
-
this.valueBlock.valueHexView =
|
|
8502
|
+
this.valueBlock.value = Convert_1.ToUtf16String(inputBuffer);
|
|
8503
|
+
this.valueBlock.valueHexView = BufferSourceConverter_1.toUint8Array(inputBuffer);
|
|
8504
8504
|
}
|
|
8505
8505
|
fromString(inputString) {
|
|
8506
8506
|
this.valueBlock.value = inputString;
|
|
8507
|
-
this.valueBlock.valueHexView = new Uint8Array(
|
|
8507
|
+
this.valueBlock.valueHexView = new Uint8Array(Convert_1.FromUtf16String(inputString));
|
|
8508
8508
|
}
|
|
8509
8509
|
}
|
|
8510
8510
|
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
@@ -8716,7 +8716,7 @@ class UTCTime extends VisibleString {
|
|
|
8716
8716
|
this.idBlock.tagNumber = 23;
|
|
8717
8717
|
}
|
|
8718
8718
|
fromBuffer(inputBuffer) {
|
|
8719
|
-
this.fromString(String.fromCharCode.apply(null,
|
|
8719
|
+
this.fromString(String.fromCharCode.apply(null, BufferSourceConverter_1.toUint8Array(inputBuffer)));
|
|
8720
8720
|
}
|
|
8721
8721
|
toBuffer() {
|
|
8722
8722
|
const str = this.toString();
|
|
@@ -9066,17 +9066,17 @@ class Repeated extends Any {
|
|
|
9066
9066
|
|
|
9067
9067
|
class RawData {
|
|
9068
9068
|
constructor({ data = EMPTY_VIEW } = {}) {
|
|
9069
|
-
this.dataView =
|
|
9069
|
+
this.dataView = BufferSourceConverter_1.toUint8Array(data);
|
|
9070
9070
|
}
|
|
9071
9071
|
get data() {
|
|
9072
9072
|
return this.dataView.slice().buffer;
|
|
9073
9073
|
}
|
|
9074
9074
|
set data(value) {
|
|
9075
|
-
this.dataView =
|
|
9075
|
+
this.dataView = BufferSourceConverter_1.toUint8Array(value);
|
|
9076
9076
|
}
|
|
9077
9077
|
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
9078
9078
|
const endLength = inputOffset + inputLength;
|
|
9079
|
-
this.dataView =
|
|
9079
|
+
this.dataView = BufferSourceConverter_1.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
9080
9080
|
return endLength;
|
|
9081
9081
|
}
|
|
9082
9082
|
toBER(sizeOnly) {
|
|
@@ -9395,7 +9395,7 @@ function verifySchema(inputBuffer, inputSchema) {
|
|
|
9395
9395
|
result: { error: "Wrong ASN.1 schema type" }
|
|
9396
9396
|
};
|
|
9397
9397
|
}
|
|
9398
|
-
const asn1 = localFromBER(
|
|
9398
|
+
const asn1 = localFromBER(BufferSourceConverter_1.toUint8Array(inputBuffer));
|
|
9399
9399
|
if (asn1.offset === -1) {
|
|
9400
9400
|
return {
|
|
9401
9401
|
verified: false,
|
|
@@ -9498,9 +9498,9 @@ class BitString {
|
|
|
9498
9498
|
if (typeof params === "number") {
|
|
9499
9499
|
this.fromNumber(params);
|
|
9500
9500
|
}
|
|
9501
|
-
else if (
|
|
9501
|
+
else if (BufferSourceConverter_1.isBufferSource(params)) {
|
|
9502
9502
|
this.unusedBits = unusedBits;
|
|
9503
|
-
this.value =
|
|
9503
|
+
this.value = BufferSourceConverter_1.toArrayBuffer(params);
|
|
9504
9504
|
}
|
|
9505
9505
|
else {
|
|
9506
9506
|
throw TypeError("Unsupported type of 'params' argument for BitString");
|
|
@@ -9549,13 +9549,19 @@ class BitString {
|
|
|
9549
9549
|
}
|
|
9550
9550
|
|
|
9551
9551
|
class OctetString {
|
|
9552
|
+
get byteLength() {
|
|
9553
|
+
return this.buffer.byteLength;
|
|
9554
|
+
}
|
|
9555
|
+
get byteOffset() {
|
|
9556
|
+
return 0;
|
|
9557
|
+
}
|
|
9552
9558
|
constructor(param) {
|
|
9553
9559
|
if (typeof param === "number") {
|
|
9554
9560
|
this.buffer = new ArrayBuffer(param);
|
|
9555
9561
|
}
|
|
9556
9562
|
else {
|
|
9557
|
-
if (
|
|
9558
|
-
this.buffer =
|
|
9563
|
+
if (BufferSourceConverter_1.isBufferSource(param)) {
|
|
9564
|
+
this.buffer = BufferSourceConverter_1.toArrayBuffer(param);
|
|
9559
9565
|
}
|
|
9560
9566
|
else if (Array.isArray(param)) {
|
|
9561
9567
|
this.buffer = new Uint8Array(param);
|
|
@@ -9565,12 +9571,6 @@ class OctetString {
|
|
|
9565
9571
|
}
|
|
9566
9572
|
}
|
|
9567
9573
|
}
|
|
9568
|
-
get byteLength() {
|
|
9569
|
-
return this.buffer.byteLength;
|
|
9570
|
-
}
|
|
9571
|
-
get byteOffset() {
|
|
9572
|
-
return 0;
|
|
9573
|
-
}
|
|
9574
9574
|
fromASN(asn) {
|
|
9575
9575
|
if (!(asn instanceof OctetString$1)) {
|
|
9576
9576
|
throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");
|
|
@@ -10257,8 +10257,8 @@ class AsnConvert {
|
|
|
10257
10257
|
return AsnParser.parse(data, target);
|
|
10258
10258
|
}
|
|
10259
10259
|
static toString(data) {
|
|
10260
|
-
const buf =
|
|
10261
|
-
?
|
|
10260
|
+
const buf = BufferSourceConverter_1.isBufferSource(data)
|
|
10261
|
+
? BufferSourceConverter_1.toArrayBuffer(data)
|
|
10262
10262
|
: AsnConvert.serialize(data);
|
|
10263
10263
|
const asn = fromBER(buf);
|
|
10264
10264
|
if (asn.offset === -1) {
|
|
@@ -10288,6 +10288,27 @@ function __decorate(decorators, target, key, desc) {
|
|
|
10288
10288
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
10289
10289
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10290
10290
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10291
|
+
}
|
|
10292
|
+
|
|
10293
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
10294
|
+
var e = new Error(message);
|
|
10295
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
10296
|
+
};
|
|
10297
|
+
|
|
10298
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
10299
|
+
|
|
10300
|
+
function createCommonjsModule(fn, basedir, module) {
|
|
10301
|
+
return module = {
|
|
10302
|
+
path: basedir,
|
|
10303
|
+
exports: {},
|
|
10304
|
+
require: function (path, base) {
|
|
10305
|
+
return commonjsRequire();
|
|
10306
|
+
}
|
|
10307
|
+
}, fn(module, module.exports), module.exports;
|
|
10308
|
+
}
|
|
10309
|
+
|
|
10310
|
+
function commonjsRequire () {
|
|
10311
|
+
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
10291
10312
|
}
|
|
10292
10313
|
|
|
10293
10314
|
var ipaddr = createCommonjsModule(function (module) {
|
|
@@ -10495,6 +10516,7 @@ var ipaddr = createCommonjsModule(function (module) {
|
|
|
10495
10516
|
[new IPv4([192, 0, 0, 0]), 24],
|
|
10496
10517
|
[new IPv4([192, 0, 2, 0]), 24],
|
|
10497
10518
|
[new IPv4([192, 88, 99, 0]), 24],
|
|
10519
|
+
[new IPv4([198, 18, 0, 0]), 15],
|
|
10498
10520
|
[new IPv4([198, 51, 100, 0]), 24],
|
|
10499
10521
|
[new IPv4([203, 0, 113, 0]), 24],
|
|
10500
10522
|
[new IPv4([240, 0, 0, 0]), 4]
|
|
@@ -10837,7 +10859,12 @@ var ipaddr = createCommonjsModule(function (module) {
|
|
|
10837
10859
|
// RFC6052, RFC6146
|
|
10838
10860
|
teredo: [new IPv6([0x2001, 0, 0, 0, 0, 0, 0, 0]), 32],
|
|
10839
10861
|
// RFC4291
|
|
10840
|
-
reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]]
|
|
10862
|
+
reserved: [[new IPv6([0x2001, 0xdb8, 0, 0, 0, 0, 0, 0]), 32]],
|
|
10863
|
+
benchmarking: [new IPv6([0x2001, 0x2, 0, 0, 0, 0, 0, 0]), 48],
|
|
10864
|
+
amt: [new IPv6([0x2001, 0x3, 0, 0, 0, 0, 0, 0]), 32],
|
|
10865
|
+
as112v6: [new IPv6([0x2001, 0x4, 0x112, 0, 0, 0, 0, 0]), 48],
|
|
10866
|
+
deprecated: [new IPv6([0x2001, 0x10, 0, 0, 0, 0, 0, 0]), 28],
|
|
10867
|
+
orchid2: [new IPv6([0x2001, 0x20, 0, 0, 0, 0, 0, 0]), 28]
|
|
10841
10868
|
};
|
|
10842
10869
|
|
|
10843
10870
|
// Checks if this address is an IPv4-mapped IPv6 address.
|
|
@@ -11022,11 +11049,9 @@ var ipaddr = createCommonjsModule(function (module) {
|
|
|
11022
11049
|
|
|
11023
11050
|
// Returns the address in compact, human-readable format like
|
|
11024
11051
|
// 2001:db8:8:66::1
|
|
11025
|
-
//
|
|
11026
|
-
// Deprecated: use toRFC5952String() instead.
|
|
11052
|
+
// Calls toRFC5952String under the hood.
|
|
11027
11053
|
IPv6.prototype.toString = function () {
|
|
11028
|
-
|
|
11029
|
-
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, '::');
|
|
11054
|
+
return this.toRFC5952String();
|
|
11030
11055
|
};
|
|
11031
11056
|
|
|
11032
11057
|
return IPv6;
|
|
@@ -11311,7 +11336,7 @@ class IpConverter {
|
|
|
11311
11336
|
const addr = ipaddr.fromByteArray(Array.from(uint8));
|
|
11312
11337
|
return addr.toString();
|
|
11313
11338
|
}
|
|
11314
|
-
return this.decodeIP(
|
|
11339
|
+
return this.decodeIP(Convert_1.ToHex(buf));
|
|
11315
11340
|
}
|
|
11316
11341
|
static fromString(text) {
|
|
11317
11342
|
const addr = ipaddr.parse(text);
|
|
@@ -11353,7 +11378,7 @@ let AttributeValue = class AttributeValue extends DirectoryString {
|
|
|
11353
11378
|
Object.assign(this, params);
|
|
11354
11379
|
}
|
|
11355
11380
|
toString() {
|
|
11356
|
-
return this.ia5String || (this.anyValue ?
|
|
11381
|
+
return this.ia5String || (this.anyValue ? Convert_1.ToHex(this.anyValue) : super.toString());
|
|
11357
11382
|
}
|
|
11358
11383
|
};
|
|
11359
11384
|
__decorate([
|
|
@@ -12147,7 +12172,7 @@ class AlgorithmIdentifier {
|
|
|
12147
12172
|
return data instanceof AlgorithmIdentifier
|
|
12148
12173
|
&& data.algorithm == this.algorithm
|
|
12149
12174
|
&& ((data.parameters && this.parameters
|
|
12150
|
-
&&
|
|
12175
|
+
&& isEqual_1(data.parameters, this.parameters))
|
|
12151
12176
|
||
|
|
12152
12177
|
(data.parameters === this.parameters));
|
|
12153
12178
|
}
|
|
@@ -12266,16 +12291,16 @@ Extensions$1 = Extensions_1 = __decorate([
|
|
|
12266
12291
|
AsnType({ type: AsnTypeTypes.Sequence, itemType: Extension$1 })
|
|
12267
12292
|
], Extensions$1);
|
|
12268
12293
|
|
|
12269
|
-
var Version$
|
|
12294
|
+
var Version$4;
|
|
12270
12295
|
(function (Version) {
|
|
12271
12296
|
Version[Version["v1"] = 0] = "v1";
|
|
12272
12297
|
Version[Version["v2"] = 1] = "v2";
|
|
12273
12298
|
Version[Version["v3"] = 2] = "v3";
|
|
12274
|
-
})(Version$
|
|
12299
|
+
})(Version$4 || (Version$4 = {}));
|
|
12275
12300
|
|
|
12276
12301
|
class TBSCertificate {
|
|
12277
12302
|
constructor(params = {}) {
|
|
12278
|
-
this.version = Version$
|
|
12303
|
+
this.version = Version$4.v1;
|
|
12279
12304
|
this.serialNumber = new ArrayBuffer(0);
|
|
12280
12305
|
this.signature = new AlgorithmIdentifier();
|
|
12281
12306
|
this.issuer = new Name$1();
|
|
@@ -12289,7 +12314,7 @@ __decorate([
|
|
|
12289
12314
|
AsnProp({
|
|
12290
12315
|
type: AsnPropTypes.Integer,
|
|
12291
12316
|
context: 0,
|
|
12292
|
-
defaultValue: Version$
|
|
12317
|
+
defaultValue: Version$4.v1,
|
|
12293
12318
|
})
|
|
12294
12319
|
], TBSCertificate.prototype, "version", void 0);
|
|
12295
12320
|
__decorate([
|
|
@@ -12719,10 +12744,10 @@ __decorate([
|
|
|
12719
12744
|
], EncryptedPrivateKeyInfo$1.prototype, "encryptedData", void 0);
|
|
12720
12745
|
|
|
12721
12746
|
var Attributes_1$1;
|
|
12722
|
-
var Version$
|
|
12747
|
+
var Version$3;
|
|
12723
12748
|
(function (Version) {
|
|
12724
12749
|
Version[Version["v1"] = 0] = "v1";
|
|
12725
|
-
})(Version$
|
|
12750
|
+
})(Version$3 || (Version$3 = {}));
|
|
12726
12751
|
class PrivateKey extends OctetString {
|
|
12727
12752
|
}
|
|
12728
12753
|
let Attributes$2 = Attributes_1$1 = class Attributes extends AsnArray {
|
|
@@ -12736,7 +12761,7 @@ Attributes$2 = Attributes_1$1 = __decorate([
|
|
|
12736
12761
|
], Attributes$2);
|
|
12737
12762
|
class PrivateKeyInfo$1 {
|
|
12738
12763
|
constructor(params = {}) {
|
|
12739
|
-
this.version = Version$
|
|
12764
|
+
this.version = Version$3.v1;
|
|
12740
12765
|
this.privateKeyAlgorithm = new AlgorithmIdentifier();
|
|
12741
12766
|
this.privateKey = new PrivateKey();
|
|
12742
12767
|
Object.assign(this, params);
|
|
@@ -12756,11 +12781,11 @@ __decorate([
|
|
|
12756
12781
|
], PrivateKeyInfo$1.prototype, "attributes", void 0);
|
|
12757
12782
|
|
|
12758
12783
|
var AsymmetricKeyPackage_1;
|
|
12759
|
-
var Version$
|
|
12784
|
+
var Version$2;
|
|
12760
12785
|
(function (Version) {
|
|
12761
12786
|
Version[Version["v1"] = 0] = "v1";
|
|
12762
12787
|
Version[Version["v2"] = 1] = "v2";
|
|
12763
|
-
})(Version$
|
|
12788
|
+
})(Version$2 || (Version$2 = {}));
|
|
12764
12789
|
let PrivateKeyAlgorithmIdentifier = class PrivateKeyAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
12765
12790
|
};
|
|
12766
12791
|
PrivateKeyAlgorithmIdentifier = __decorate([
|
|
@@ -12768,7 +12793,7 @@ PrivateKeyAlgorithmIdentifier = __decorate([
|
|
|
12768
12793
|
], PrivateKeyAlgorithmIdentifier);
|
|
12769
12794
|
let OneAsymmetricKey = class OneAsymmetricKey {
|
|
12770
12795
|
constructor() {
|
|
12771
|
-
this.version = Version$
|
|
12796
|
+
this.version = Version$2.v1;
|
|
12772
12797
|
this.privateKeyAlgorithm = new AlgorithmIdentifier();
|
|
12773
12798
|
this.privateKey = new ArrayBuffer(0);
|
|
12774
12799
|
}
|
|
@@ -13114,34 +13139,34 @@ class Download {
|
|
|
13114
13139
|
}
|
|
13115
13140
|
Download.cert = {
|
|
13116
13141
|
asPEM: (pem, name) => {
|
|
13117
|
-
downloadFromBuffer(
|
|
13142
|
+
downloadFromBuffer(Convert_1.FromString(pem), name, 'cer', 'application/pkix-cert');
|
|
13118
13143
|
},
|
|
13119
13144
|
asDER: (hex, name) => {
|
|
13120
|
-
downloadFromBuffer(
|
|
13145
|
+
downloadFromBuffer(Convert_1.FromString(hex), name, 'cer', 'application/pkix-cert');
|
|
13121
13146
|
},
|
|
13122
13147
|
};
|
|
13123
13148
|
Download.attrCert = {
|
|
13124
13149
|
asPEM: (pem, name) => {
|
|
13125
|
-
downloadFromBuffer(
|
|
13150
|
+
downloadFromBuffer(Convert_1.FromString(pem), name, 'cer', 'application/pkix-attr-cert');
|
|
13126
13151
|
},
|
|
13127
13152
|
asDER: (hex, name) => {
|
|
13128
|
-
downloadFromBuffer(
|
|
13153
|
+
downloadFromBuffer(Convert_1.FromString(hex), name, 'cer', 'application/pkix-attr-cert');
|
|
13129
13154
|
},
|
|
13130
13155
|
};
|
|
13131
13156
|
Download.csr = {
|
|
13132
13157
|
asPEM: (pem, name) => {
|
|
13133
|
-
downloadFromBuffer(
|
|
13158
|
+
downloadFromBuffer(Convert_1.FromString(pem), name, 'csr', 'application/pkcs10');
|
|
13134
13159
|
},
|
|
13135
13160
|
asDER: (hex, name) => {
|
|
13136
|
-
downloadFromBuffer(
|
|
13161
|
+
downloadFromBuffer(Convert_1.FromString(hex), name, 'csr', 'application/pkcs10');
|
|
13137
13162
|
},
|
|
13138
13163
|
};
|
|
13139
13164
|
Download.crl = {
|
|
13140
13165
|
asPEM: (pem, name) => {
|
|
13141
|
-
downloadFromBuffer(
|
|
13166
|
+
downloadFromBuffer(Convert_1.FromString(pem), name, 'crl', 'application/pkix-crl');
|
|
13142
13167
|
},
|
|
13143
13168
|
asDER: (hex, name) => {
|
|
13144
|
-
downloadFromBuffer(
|
|
13169
|
+
downloadFromBuffer(Convert_1.FromString(hex), name, 'crl', 'application/pkix-crl');
|
|
13145
13170
|
},
|
|
13146
13171
|
};
|
|
13147
13172
|
|
|
@@ -15448,6 +15473,7 @@ const OIDs = {
|
|
|
15448
15473
|
'1.3.6.1.4.1.4329.7': 'Siemens Public Key Infrastructure',
|
|
15449
15474
|
'1.3.6.1.4.1.52266.1': 'Legal Entity Identifier',
|
|
15450
15475
|
'1.3.6.1.4.1.52266.2': 'Role',
|
|
15476
|
+
'1.3.6.1.4.1.11129.2.1.17': 'Android Key Attestation',
|
|
15451
15477
|
// https://ec.europa.eu/futurium/sites/futurium/files/ntqwac_pilot.pdf
|
|
15452
15478
|
'0.4.0.9496.1': 'Domain Name Beneficiary',
|
|
15453
15479
|
'0.4.0.9496.2': 'DNB Legal representative',
|
|
@@ -15485,6 +15511,18 @@ function getStringByOID(value) {
|
|
|
15485
15511
|
return value;
|
|
15486
15512
|
}
|
|
15487
15513
|
|
|
15514
|
+
/**
|
|
15515
|
+
* @license
|
|
15516
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
15517
|
+
*
|
|
15518
|
+
* This source code is licensed under the MIT license found in the
|
|
15519
|
+
* LICENSE file in the root directory of this source tree.
|
|
15520
|
+
*/
|
|
15521
|
+
function camelCaseToWords(value) {
|
|
15522
|
+
const result = value.replace(/([A-Z])/g, ' $1');
|
|
15523
|
+
return result.charAt(0).toUpperCase() + result.slice(1);
|
|
15524
|
+
}
|
|
15525
|
+
|
|
15488
15526
|
/**
|
|
15489
15527
|
* @license
|
|
15490
15528
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -15507,7 +15545,7 @@ var _Name_asn;
|
|
|
15507
15545
|
class Name {
|
|
15508
15546
|
constructor(data) {
|
|
15509
15547
|
_Name_asn.set(this, new Name$1());
|
|
15510
|
-
if (
|
|
15548
|
+
if (BufferSourceConverter_1.isBufferSource(data)) {
|
|
15511
15549
|
__classPrivateFieldSet$1(this, _Name_asn, AsnParser.parse(data, Name$1), "f");
|
|
15512
15550
|
}
|
|
15513
15551
|
else {
|
|
@@ -15715,8 +15753,8 @@ let CaVersion = class CaVersion {
|
|
|
15715
15753
|
data.set(new Uint8Array(this.value), 4 - this.value.byteLength);
|
|
15716
15754
|
}
|
|
15717
15755
|
return {
|
|
15718
|
-
keyIndex: parseInt(
|
|
15719
|
-
certificateIndex: parseInt(
|
|
15756
|
+
keyIndex: parseInt(Convert_1.ToHex(data.slice(0, 2)), 16),
|
|
15757
|
+
certificateIndex: parseInt(Convert_1.ToHex(data.slice(2)), 16),
|
|
15720
15758
|
};
|
|
15721
15759
|
}
|
|
15722
15760
|
};
|
|
@@ -16062,11 +16100,6 @@ Lei = __decorate([
|
|
|
16062
16100
|
AsnType({ type: AsnTypeTypes.Sequence })
|
|
16063
16101
|
], Lei);
|
|
16064
16102
|
let BaseLeiChoice = class BaseLeiChoice {
|
|
16065
|
-
constructor(value) {
|
|
16066
|
-
if (value) {
|
|
16067
|
-
this.text = value;
|
|
16068
|
-
}
|
|
16069
|
-
}
|
|
16070
16103
|
get text() {
|
|
16071
16104
|
if (this.bmpString !== undefined) {
|
|
16072
16105
|
return this.bmpString;
|
|
@@ -16088,6 +16121,11 @@ let BaseLeiChoice = class BaseLeiChoice {
|
|
|
16088
16121
|
set text(value) {
|
|
16089
16122
|
this.printableString = value;
|
|
16090
16123
|
}
|
|
16124
|
+
constructor(value) {
|
|
16125
|
+
if (value) {
|
|
16126
|
+
this.text = value;
|
|
16127
|
+
}
|
|
16128
|
+
}
|
|
16091
16129
|
};
|
|
16092
16130
|
__decorate([
|
|
16093
16131
|
AsnProp({ type: AsnPropTypes.IA5String })
|
|
@@ -16132,13 +16170,13 @@ LeiRole = __decorate([
|
|
|
16132
16170
|
], LeiRole);
|
|
16133
16171
|
|
|
16134
16172
|
class ByteStream {
|
|
16135
|
-
constructor(bytes) {
|
|
16136
|
-
this.offset = 0;
|
|
16137
|
-
this.view = build.BufferSourceConverter.toUint8Array(bytes);
|
|
16138
|
-
}
|
|
16139
16173
|
get position() {
|
|
16140
16174
|
return this.offset;
|
|
16141
16175
|
}
|
|
16176
|
+
constructor(bytes) {
|
|
16177
|
+
this.offset = 0;
|
|
16178
|
+
this.view = BufferSourceConverter_1.toUint8Array(bytes);
|
|
16179
|
+
}
|
|
16142
16180
|
read(size = 1) {
|
|
16143
16181
|
const res = this.view.slice(this.offset, this.offset + size);
|
|
16144
16182
|
this.offset = this.offset + res.length;
|
|
@@ -16153,7 +16191,7 @@ class ByteStream {
|
|
|
16153
16191
|
}
|
|
16154
16192
|
readNumber(size) {
|
|
16155
16193
|
const bytes = this.read(size);
|
|
16156
|
-
const hex =
|
|
16194
|
+
const hex = Convert_1.ToHex(bytes);
|
|
16157
16195
|
return parseInt(hex, 16);
|
|
16158
16196
|
}
|
|
16159
16197
|
readEnd() {
|
|
@@ -16166,7 +16204,7 @@ class ByteStream {
|
|
|
16166
16204
|
|
|
16167
16205
|
class Structure {
|
|
16168
16206
|
static createStream(bytes) {
|
|
16169
|
-
const view =
|
|
16207
|
+
const view = BufferSourceConverter_1.toUint8Array(bytes);
|
|
16170
16208
|
return new ByteStream(view);
|
|
16171
16209
|
}
|
|
16172
16210
|
}
|
|
@@ -16210,7 +16248,7 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
16210
16248
|
parse(stream) {
|
|
16211
16249
|
this.version = stream.readByte();
|
|
16212
16250
|
stream.read(2);
|
|
16213
|
-
this.logId =
|
|
16251
|
+
this.logId = BufferSourceConverter_1.toArrayBuffer(stream.read(32));
|
|
16214
16252
|
this.timestamp = new Date(stream.readNumber(8));
|
|
16215
16253
|
const extLen = stream.readNumber(2);
|
|
16216
16254
|
this.extensions = stream.read(extLen).buffer;
|
|
@@ -16221,12 +16259,12 @@ class SignedCertificateTimestamp extends Structure {
|
|
|
16221
16259
|
toJSON() {
|
|
16222
16260
|
return {
|
|
16223
16261
|
version: this.version,
|
|
16224
|
-
logId:
|
|
16262
|
+
logId: Convert_1.ToHex(this.logId),
|
|
16225
16263
|
timestamp: this.timestamp,
|
|
16226
|
-
extensions:
|
|
16264
|
+
extensions: Convert_1.ToBase64(this.extensions),
|
|
16227
16265
|
hashAlgorithm: HashAlgorithm[this.hashAlgorithm] || "undefined",
|
|
16228
16266
|
signatureAlgorithm: SignatureAlgorithm[this.signatureAlgorithm] || "undefined",
|
|
16229
|
-
signature:
|
|
16267
|
+
signature: Convert_1.ToBase64(this.signature),
|
|
16230
16268
|
};
|
|
16231
16269
|
}
|
|
16232
16270
|
}
|
|
@@ -16252,15 +16290,15 @@ class CertificateTransparency extends OctetString {
|
|
|
16252
16290
|
}
|
|
16253
16291
|
}
|
|
16254
16292
|
|
|
16255
|
-
var Version;
|
|
16293
|
+
var Version$1;
|
|
16256
16294
|
(function (Version) {
|
|
16257
16295
|
Version[Version["v1"] = 1] = "v1";
|
|
16258
|
-
})(Version || (Version = {}));
|
|
16296
|
+
})(Version$1 || (Version$1 = {}));
|
|
16259
16297
|
|
|
16260
16298
|
const id_adbe_archiveRevInfo = "1.2.840.113583.1.1.9.2";
|
|
16261
16299
|
class ArchiveRevInfo {
|
|
16262
16300
|
constructor(params = {}) {
|
|
16263
|
-
this.version = Version.v1;
|
|
16301
|
+
this.version = Version$1.v1;
|
|
16264
16302
|
Object.assign(this, params);
|
|
16265
16303
|
}
|
|
16266
16304
|
}
|
|
@@ -16271,7 +16309,7 @@ __decorate([
|
|
|
16271
16309
|
const id_adbe_timestamp = "1.2.840.113583.1.1.9.1";
|
|
16272
16310
|
class Timestamp {
|
|
16273
16311
|
constructor(params = {}) {
|
|
16274
|
-
this.version = Version.v1;
|
|
16312
|
+
this.version = Version$1.v1;
|
|
16275
16313
|
this.location = new GeneralName();
|
|
16276
16314
|
this.requiresAuth = false;
|
|
16277
16315
|
Object.assign(this, params);
|
|
@@ -16616,6 +16654,302 @@ TNAuthorizationList = TNAuthorizationList_1 = __decorate([
|
|
|
16616
16654
|
})
|
|
16617
16655
|
], TNAuthorizationList);
|
|
16618
16656
|
|
|
16657
|
+
var IntegerSet_1;
|
|
16658
|
+
const id_ce_keyDescription = "1.3.6.1.4.1.11129.2.1.17";
|
|
16659
|
+
var VerifiedBootState;
|
|
16660
|
+
(function (VerifiedBootState) {
|
|
16661
|
+
VerifiedBootState[VerifiedBootState["verified"] = 0] = "verified";
|
|
16662
|
+
VerifiedBootState[VerifiedBootState["selfSigned"] = 1] = "selfSigned";
|
|
16663
|
+
VerifiedBootState[VerifiedBootState["unverified"] = 2] = "unverified";
|
|
16664
|
+
VerifiedBootState[VerifiedBootState["failed"] = 3] = "failed";
|
|
16665
|
+
})(VerifiedBootState || (VerifiedBootState = {}));
|
|
16666
|
+
class RootOfTrust {
|
|
16667
|
+
constructor(params = {}) {
|
|
16668
|
+
this.verifiedBootKey = new OctetString();
|
|
16669
|
+
this.deviceLocked = false;
|
|
16670
|
+
this.verifiedBootState = VerifiedBootState.verified;
|
|
16671
|
+
Object.assign(this, params);
|
|
16672
|
+
}
|
|
16673
|
+
}
|
|
16674
|
+
__decorate([
|
|
16675
|
+
AsnProp({ type: OctetString })
|
|
16676
|
+
], RootOfTrust.prototype, "verifiedBootKey", void 0);
|
|
16677
|
+
__decorate([
|
|
16678
|
+
AsnProp({ type: AsnPropTypes.Boolean })
|
|
16679
|
+
], RootOfTrust.prototype, "deviceLocked", void 0);
|
|
16680
|
+
__decorate([
|
|
16681
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
16682
|
+
], RootOfTrust.prototype, "verifiedBootState", void 0);
|
|
16683
|
+
__decorate([
|
|
16684
|
+
AsnProp({ type: OctetString, optional: true })
|
|
16685
|
+
], RootOfTrust.prototype, "verifiedBootHash", void 0);
|
|
16686
|
+
let IntegerSet = IntegerSet_1 = class IntegerSet extends AsnArray {
|
|
16687
|
+
constructor(items) {
|
|
16688
|
+
super(items);
|
|
16689
|
+
Object.setPrototypeOf(this, IntegerSet_1.prototype);
|
|
16690
|
+
}
|
|
16691
|
+
};
|
|
16692
|
+
IntegerSet = IntegerSet_1 = __decorate([
|
|
16693
|
+
AsnType({ type: AsnTypeTypes.Set, itemType: AsnPropTypes.Integer })
|
|
16694
|
+
], IntegerSet);
|
|
16695
|
+
class AuthorizationList {
|
|
16696
|
+
constructor(params = {}) {
|
|
16697
|
+
Object.assign(this, params);
|
|
16698
|
+
}
|
|
16699
|
+
}
|
|
16700
|
+
__decorate([
|
|
16701
|
+
AsnProp({ context: 1, type: IntegerSet, optional: true })
|
|
16702
|
+
], AuthorizationList.prototype, "purpose", void 0);
|
|
16703
|
+
__decorate([
|
|
16704
|
+
AsnProp({ context: 2, type: AsnPropTypes.Integer, optional: true })
|
|
16705
|
+
], AuthorizationList.prototype, "algorithm", void 0);
|
|
16706
|
+
__decorate([
|
|
16707
|
+
AsnProp({ context: 3, type: AsnPropTypes.Integer, optional: true })
|
|
16708
|
+
], AuthorizationList.prototype, "keySize", void 0);
|
|
16709
|
+
__decorate([
|
|
16710
|
+
AsnProp({ context: 5, type: IntegerSet, optional: true })
|
|
16711
|
+
], AuthorizationList.prototype, "digest", void 0);
|
|
16712
|
+
__decorate([
|
|
16713
|
+
AsnProp({ context: 6, type: IntegerSet, optional: true })
|
|
16714
|
+
], AuthorizationList.prototype, "padding", void 0);
|
|
16715
|
+
__decorate([
|
|
16716
|
+
AsnProp({ context: 10, type: AsnPropTypes.Integer, optional: true })
|
|
16717
|
+
], AuthorizationList.prototype, "ecCurve", void 0);
|
|
16718
|
+
__decorate([
|
|
16719
|
+
AsnProp({ context: 200, type: AsnPropTypes.Integer, optional: true })
|
|
16720
|
+
], AuthorizationList.prototype, "rsaPublicExponent", void 0);
|
|
16721
|
+
__decorate([
|
|
16722
|
+
AsnProp({ context: 303, type: AsnPropTypes.Null, optional: true })
|
|
16723
|
+
], AuthorizationList.prototype, "rollbackResistance", void 0);
|
|
16724
|
+
__decorate([
|
|
16725
|
+
AsnProp({ context: 305, type: AsnPropTypes.Null, optional: true })
|
|
16726
|
+
], AuthorizationList.prototype, "earlyBootOnly", void 0);
|
|
16727
|
+
__decorate([
|
|
16728
|
+
AsnProp({ context: 400, type: AsnPropTypes.Integer, optional: true })
|
|
16729
|
+
], AuthorizationList.prototype, "activeDateTime", void 0);
|
|
16730
|
+
__decorate([
|
|
16731
|
+
AsnProp({ context: 401, type: AsnPropTypes.Integer, optional: true })
|
|
16732
|
+
], AuthorizationList.prototype, "originationExpireDateTime", void 0);
|
|
16733
|
+
__decorate([
|
|
16734
|
+
AsnProp({ context: 402, type: AsnPropTypes.Integer, optional: true })
|
|
16735
|
+
], AuthorizationList.prototype, "usageExpireDateTime", void 0);
|
|
16736
|
+
__decorate([
|
|
16737
|
+
AsnProp({ context: 503, type: AsnPropTypes.Null, optional: true })
|
|
16738
|
+
], AuthorizationList.prototype, "noAuthRequired", void 0);
|
|
16739
|
+
__decorate([
|
|
16740
|
+
AsnProp({ context: 504, type: AsnPropTypes.Integer, optional: true })
|
|
16741
|
+
], AuthorizationList.prototype, "userAuthType", void 0);
|
|
16742
|
+
__decorate([
|
|
16743
|
+
AsnProp({ context: 505, type: AsnPropTypes.Integer, optional: true })
|
|
16744
|
+
], AuthorizationList.prototype, "authTimeout", void 0);
|
|
16745
|
+
__decorate([
|
|
16746
|
+
AsnProp({ context: 506, type: AsnPropTypes.Null, optional: true })
|
|
16747
|
+
], AuthorizationList.prototype, "allowWhileOnBody", void 0);
|
|
16748
|
+
__decorate([
|
|
16749
|
+
AsnProp({ context: 507, type: AsnPropTypes.Null, optional: true })
|
|
16750
|
+
], AuthorizationList.prototype, "trustedUserPresenceRequired", void 0);
|
|
16751
|
+
__decorate([
|
|
16752
|
+
AsnProp({ context: 508, type: AsnPropTypes.Null, optional: true })
|
|
16753
|
+
], AuthorizationList.prototype, "trustedConfirmationRequired", void 0);
|
|
16754
|
+
__decorate([
|
|
16755
|
+
AsnProp({ context: 509, type: AsnPropTypes.Null, optional: true })
|
|
16756
|
+
], AuthorizationList.prototype, "unlockedDeviceRequired", void 0);
|
|
16757
|
+
__decorate([
|
|
16758
|
+
AsnProp({ context: 600, type: AsnPropTypes.Null, optional: true })
|
|
16759
|
+
], AuthorizationList.prototype, "allApplications", void 0);
|
|
16760
|
+
__decorate([
|
|
16761
|
+
AsnProp({ context: 601, type: OctetString, optional: true })
|
|
16762
|
+
], AuthorizationList.prototype, "applicationId", void 0);
|
|
16763
|
+
__decorate([
|
|
16764
|
+
AsnProp({ context: 701, type: AsnPropTypes.Integer, optional: true })
|
|
16765
|
+
], AuthorizationList.prototype, "creationDateTime", void 0);
|
|
16766
|
+
__decorate([
|
|
16767
|
+
AsnProp({ context: 702, type: AsnPropTypes.Integer, optional: true })
|
|
16768
|
+
], AuthorizationList.prototype, "origin", void 0);
|
|
16769
|
+
__decorate([
|
|
16770
|
+
AsnProp({ context: 703, type: AsnPropTypes.Null, optional: true })
|
|
16771
|
+
], AuthorizationList.prototype, "rollbackResistant", void 0);
|
|
16772
|
+
__decorate([
|
|
16773
|
+
AsnProp({ context: 704, type: RootOfTrust, optional: true })
|
|
16774
|
+
], AuthorizationList.prototype, "rootOfTrust", void 0);
|
|
16775
|
+
__decorate([
|
|
16776
|
+
AsnProp({ context: 705, type: AsnPropTypes.Integer, optional: true })
|
|
16777
|
+
], AuthorizationList.prototype, "osVersion", void 0);
|
|
16778
|
+
__decorate([
|
|
16779
|
+
AsnProp({ context: 706, type: AsnPropTypes.Integer, optional: true })
|
|
16780
|
+
], AuthorizationList.prototype, "osPatchLevel", void 0);
|
|
16781
|
+
__decorate([
|
|
16782
|
+
AsnProp({ context: 709, type: OctetString, optional: true })
|
|
16783
|
+
], AuthorizationList.prototype, "attestationApplicationId", void 0);
|
|
16784
|
+
__decorate([
|
|
16785
|
+
AsnProp({ context: 710, type: OctetString, optional: true })
|
|
16786
|
+
], AuthorizationList.prototype, "attestationIdBrand", void 0);
|
|
16787
|
+
__decorate([
|
|
16788
|
+
AsnProp({ context: 711, type: OctetString, optional: true })
|
|
16789
|
+
], AuthorizationList.prototype, "attestationIdDevice", void 0);
|
|
16790
|
+
__decorate([
|
|
16791
|
+
AsnProp({ context: 712, type: OctetString, optional: true })
|
|
16792
|
+
], AuthorizationList.prototype, "attestationIdProduct", void 0);
|
|
16793
|
+
__decorate([
|
|
16794
|
+
AsnProp({ context: 713, type: OctetString, optional: true })
|
|
16795
|
+
], AuthorizationList.prototype, "attestationIdSerial", void 0);
|
|
16796
|
+
__decorate([
|
|
16797
|
+
AsnProp({ context: 714, type: OctetString, optional: true })
|
|
16798
|
+
], AuthorizationList.prototype, "attestationIdImei", void 0);
|
|
16799
|
+
__decorate([
|
|
16800
|
+
AsnProp({ context: 715, type: OctetString, optional: true })
|
|
16801
|
+
], AuthorizationList.prototype, "attestationIdMeid", void 0);
|
|
16802
|
+
__decorate([
|
|
16803
|
+
AsnProp({ context: 716, type: OctetString, optional: true })
|
|
16804
|
+
], AuthorizationList.prototype, "attestationIdManufacturer", void 0);
|
|
16805
|
+
__decorate([
|
|
16806
|
+
AsnProp({ context: 717, type: OctetString, optional: true })
|
|
16807
|
+
], AuthorizationList.prototype, "attestationIdModel", void 0);
|
|
16808
|
+
__decorate([
|
|
16809
|
+
AsnProp({ context: 718, type: AsnPropTypes.Integer, optional: true })
|
|
16810
|
+
], AuthorizationList.prototype, "vendorPatchLevel", void 0);
|
|
16811
|
+
__decorate([
|
|
16812
|
+
AsnProp({ context: 719, type: AsnPropTypes.Integer, optional: true })
|
|
16813
|
+
], AuthorizationList.prototype, "bootPatchLevel", void 0);
|
|
16814
|
+
__decorate([
|
|
16815
|
+
AsnProp({ context: 720, type: AsnPropTypes.Null, optional: true })
|
|
16816
|
+
], AuthorizationList.prototype, "deviceUniqueAttestation", void 0);
|
|
16817
|
+
var SecurityLevel;
|
|
16818
|
+
(function (SecurityLevel) {
|
|
16819
|
+
SecurityLevel[SecurityLevel["software"] = 0] = "software";
|
|
16820
|
+
SecurityLevel[SecurityLevel["trustedEnvironment"] = 1] = "trustedEnvironment";
|
|
16821
|
+
SecurityLevel[SecurityLevel["strongBox"] = 2] = "strongBox";
|
|
16822
|
+
})(SecurityLevel || (SecurityLevel = {}));
|
|
16823
|
+
var Version;
|
|
16824
|
+
(function (Version) {
|
|
16825
|
+
Version[Version["KM2"] = 1] = "KM2";
|
|
16826
|
+
Version[Version["KM3"] = 2] = "KM3";
|
|
16827
|
+
Version[Version["KM4"] = 3] = "KM4";
|
|
16828
|
+
Version[Version["KM4_1"] = 4] = "KM4_1";
|
|
16829
|
+
Version[Version["keyMint1"] = 100] = "keyMint1";
|
|
16830
|
+
Version[Version["keyMint2"] = 200] = "keyMint2";
|
|
16831
|
+
})(Version || (Version = {}));
|
|
16832
|
+
class KeyDescription {
|
|
16833
|
+
constructor(params = {}) {
|
|
16834
|
+
this.attestationVersion = Version.KM4;
|
|
16835
|
+
this.attestationSecurityLevel = SecurityLevel.software;
|
|
16836
|
+
this.keymasterVersion = 0;
|
|
16837
|
+
this.keymasterSecurityLevel = SecurityLevel.software;
|
|
16838
|
+
this.attestationChallenge = new OctetString();
|
|
16839
|
+
this.uniqueId = new OctetString();
|
|
16840
|
+
this.softwareEnforced = new AuthorizationList();
|
|
16841
|
+
this.teeEnforced = new AuthorizationList();
|
|
16842
|
+
Object.assign(this, params);
|
|
16843
|
+
}
|
|
16844
|
+
}
|
|
16845
|
+
__decorate([
|
|
16846
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
16847
|
+
], KeyDescription.prototype, "attestationVersion", void 0);
|
|
16848
|
+
__decorate([
|
|
16849
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
16850
|
+
], KeyDescription.prototype, "attestationSecurityLevel", void 0);
|
|
16851
|
+
__decorate([
|
|
16852
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
16853
|
+
], KeyDescription.prototype, "keymasterVersion", void 0);
|
|
16854
|
+
__decorate([
|
|
16855
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
16856
|
+
], KeyDescription.prototype, "keymasterSecurityLevel", void 0);
|
|
16857
|
+
__decorate([
|
|
16858
|
+
AsnProp({ type: OctetString })
|
|
16859
|
+
], KeyDescription.prototype, "attestationChallenge", void 0);
|
|
16860
|
+
__decorate([
|
|
16861
|
+
AsnProp({ type: OctetString })
|
|
16862
|
+
], KeyDescription.prototype, "uniqueId", void 0);
|
|
16863
|
+
__decorate([
|
|
16864
|
+
AsnProp({ type: AuthorizationList })
|
|
16865
|
+
], KeyDescription.prototype, "softwareEnforced", void 0);
|
|
16866
|
+
__decorate([
|
|
16867
|
+
AsnProp({ type: AuthorizationList })
|
|
16868
|
+
], KeyDescription.prototype, "teeEnforced", void 0);
|
|
16869
|
+
|
|
16870
|
+
var NonStandardAuthorizationList_1;
|
|
16871
|
+
let NonStandardAuthorization = class NonStandardAuthorization extends AuthorizationList {
|
|
16872
|
+
};
|
|
16873
|
+
NonStandardAuthorization = __decorate([
|
|
16874
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
16875
|
+
], NonStandardAuthorization);
|
|
16876
|
+
let NonStandardAuthorizationList = NonStandardAuthorizationList_1 = class NonStandardAuthorizationList extends AsnArray {
|
|
16877
|
+
constructor(items) {
|
|
16878
|
+
super(items);
|
|
16879
|
+
Object.setPrototypeOf(this, NonStandardAuthorizationList_1.prototype);
|
|
16880
|
+
}
|
|
16881
|
+
findProperty(key) {
|
|
16882
|
+
const prop = this.find((o => key in o));
|
|
16883
|
+
if (prop) {
|
|
16884
|
+
return prop[key];
|
|
16885
|
+
}
|
|
16886
|
+
return undefined;
|
|
16887
|
+
}
|
|
16888
|
+
};
|
|
16889
|
+
NonStandardAuthorizationList = NonStandardAuthorizationList_1 = __decorate([
|
|
16890
|
+
AsnType({ type: AsnTypeTypes.Sequence, itemType: NonStandardAuthorization })
|
|
16891
|
+
], NonStandardAuthorizationList);
|
|
16892
|
+
class NonStandardKeyDescription {
|
|
16893
|
+
constructor(params = {}) {
|
|
16894
|
+
this.attestationVersion = Version.KM4;
|
|
16895
|
+
this.attestationSecurityLevel = SecurityLevel.software;
|
|
16896
|
+
this.keymasterVersion = 0;
|
|
16897
|
+
this.keymasterSecurityLevel = SecurityLevel.software;
|
|
16898
|
+
this.attestationChallenge = new OctetString();
|
|
16899
|
+
this.uniqueId = new OctetString();
|
|
16900
|
+
this.softwareEnforced = new NonStandardAuthorizationList();
|
|
16901
|
+
this.teeEnforced = new NonStandardAuthorizationList();
|
|
16902
|
+
Object.assign(this, params);
|
|
16903
|
+
}
|
|
16904
|
+
}
|
|
16905
|
+
__decorate([
|
|
16906
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
16907
|
+
], NonStandardKeyDescription.prototype, "attestationVersion", void 0);
|
|
16908
|
+
__decorate([
|
|
16909
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
16910
|
+
], NonStandardKeyDescription.prototype, "attestationSecurityLevel", void 0);
|
|
16911
|
+
__decorate([
|
|
16912
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
16913
|
+
], NonStandardKeyDescription.prototype, "keymasterVersion", void 0);
|
|
16914
|
+
__decorate([
|
|
16915
|
+
AsnProp({ type: AsnPropTypes.Enumerated })
|
|
16916
|
+
], NonStandardKeyDescription.prototype, "keymasterSecurityLevel", void 0);
|
|
16917
|
+
__decorate([
|
|
16918
|
+
AsnProp({ type: OctetString })
|
|
16919
|
+
], NonStandardKeyDescription.prototype, "attestationChallenge", void 0);
|
|
16920
|
+
__decorate([
|
|
16921
|
+
AsnProp({ type: OctetString })
|
|
16922
|
+
], NonStandardKeyDescription.prototype, "uniqueId", void 0);
|
|
16923
|
+
__decorate([
|
|
16924
|
+
AsnProp({ type: NonStandardAuthorizationList })
|
|
16925
|
+
], NonStandardKeyDescription.prototype, "softwareEnforced", void 0);
|
|
16926
|
+
__decorate([
|
|
16927
|
+
AsnProp({ type: NonStandardAuthorizationList })
|
|
16928
|
+
], NonStandardKeyDescription.prototype, "teeEnforced", void 0);
|
|
16929
|
+
|
|
16930
|
+
class AttestationPackageInfo {
|
|
16931
|
+
constructor(params = {}) {
|
|
16932
|
+
Object.assign(this, params);
|
|
16933
|
+
}
|
|
16934
|
+
}
|
|
16935
|
+
__decorate([
|
|
16936
|
+
AsnProp({ type: AsnPropTypes.OctetString })
|
|
16937
|
+
], AttestationPackageInfo.prototype, "packageName", void 0);
|
|
16938
|
+
__decorate([
|
|
16939
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
16940
|
+
], AttestationPackageInfo.prototype, "version", void 0);
|
|
16941
|
+
class AttestationApplicationId {
|
|
16942
|
+
constructor(params = {}) {
|
|
16943
|
+
Object.assign(this, params);
|
|
16944
|
+
}
|
|
16945
|
+
}
|
|
16946
|
+
__decorate([
|
|
16947
|
+
AsnProp({ type: AttestationPackageInfo, repeated: "set" })
|
|
16948
|
+
], AttestationApplicationId.prototype, "packageInfos", void 0);
|
|
16949
|
+
__decorate([
|
|
16950
|
+
AsnProp({ type: AsnPropTypes.OctetString, repeated: "set" })
|
|
16951
|
+
], AttestationApplicationId.prototype, "signatureDigests", void 0);
|
|
16952
|
+
|
|
16619
16953
|
/**
|
|
16620
16954
|
* @license
|
|
16621
16955
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -16648,7 +16982,7 @@ class AsnData {
|
|
|
16648
16982
|
else {
|
|
16649
16983
|
// raw, type
|
|
16650
16984
|
__classPrivateFieldSet(this, _AsnData_asn, AsnConvert.parse(args[0], args[1]), "f");
|
|
16651
|
-
__classPrivateFieldSet(this, _AsnData_raw,
|
|
16985
|
+
__classPrivateFieldSet(this, _AsnData_raw, BufferSourceConverter_1.toArrayBuffer(args[0]), "f");
|
|
16652
16986
|
}
|
|
16653
16987
|
}
|
|
16654
16988
|
get asn() {
|
|
@@ -16792,14 +17126,17 @@ class Extension extends AsnData {
|
|
|
16792
17126
|
case id_ce_deltaCRLIndicator:
|
|
16793
17127
|
this.value = AsnParser.parse(asnExtnValue, BaseCRLNumber);
|
|
16794
17128
|
break;
|
|
17129
|
+
case id_ce_keyDescription:
|
|
17130
|
+
this.value = AsnParser.parse(asnExtnValue, NonStandardKeyDescription);
|
|
17131
|
+
break;
|
|
16795
17132
|
default:
|
|
16796
17133
|
console.warn(`Didn't detect parser for "${this.asn.extnID}" extension.`);
|
|
16797
|
-
this.value =
|
|
17134
|
+
this.value = Convert_1.ToHex(asnExtnValue);
|
|
16798
17135
|
}
|
|
16799
17136
|
}
|
|
16800
17137
|
catch (error) {
|
|
16801
17138
|
console.error(`Error parse "${this.asn.extnID}" extension:`, error.message);
|
|
16802
|
-
this.value =
|
|
17139
|
+
this.value = Convert_1.ToHex(asnExtnValue);
|
|
16803
17140
|
}
|
|
16804
17141
|
}
|
|
16805
17142
|
}
|
|
@@ -16861,13 +17198,13 @@ const certificateRawToBuffer = (raw) => {
|
|
|
16861
17198
|
const rawClarified = base64Clarify(raw);
|
|
16862
17199
|
let buffer;
|
|
16863
17200
|
if (isHex(rawClarified)) {
|
|
16864
|
-
buffer =
|
|
17201
|
+
buffer = Convert_1.FromHex(rawClarified);
|
|
16865
17202
|
}
|
|
16866
17203
|
else if (isBase64(rawClarified) || isPem(rawClarified)) {
|
|
16867
|
-
buffer =
|
|
17204
|
+
buffer = Convert_1.FromBase64(rawClarified);
|
|
16868
17205
|
}
|
|
16869
17206
|
else {
|
|
16870
|
-
buffer =
|
|
17207
|
+
buffer = Convert_1.FromBinary(raw);
|
|
16871
17208
|
}
|
|
16872
17209
|
return buffer;
|
|
16873
17210
|
};
|
|
@@ -16892,7 +17229,7 @@ class X509Certificate extends AsnData {
|
|
|
16892
17229
|
this.thumbprints = {};
|
|
16893
17230
|
this.type = 'X.509 Certificate';
|
|
16894
17231
|
const { tbsCertificate } = this.asn;
|
|
16895
|
-
this.serialNumber =
|
|
17232
|
+
this.serialNumber = Convert_1.ToHex(tbsCertificate.serialNumber);
|
|
16896
17233
|
this.subject = new Name(tbsCertificate.subject).toJSON();
|
|
16897
17234
|
this.issuer = new Name(tbsCertificate.issuer).toJSON();
|
|
16898
17235
|
this.version = tbsCertificate.version + 1;
|
|
@@ -16955,10 +17292,10 @@ class X509Certificate extends AsnData {
|
|
|
16955
17292
|
};
|
|
16956
17293
|
}
|
|
16957
17294
|
exportAsBase64() {
|
|
16958
|
-
return
|
|
17295
|
+
return Convert_1.ToBase64(this.raw);
|
|
16959
17296
|
}
|
|
16960
17297
|
exportAsHexFormatted() {
|
|
16961
|
-
return hexFormat(
|
|
17298
|
+
return hexFormat(Convert_1.ToHex(this.raw));
|
|
16962
17299
|
}
|
|
16963
17300
|
exportAsPemFormatted() {
|
|
16964
17301
|
return `-----BEGIN CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE-----`;
|
|
@@ -16967,7 +17304,7 @@ class X509Certificate extends AsnData {
|
|
|
16967
17304
|
try {
|
|
16968
17305
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
16969
17306
|
if (thumbprint) {
|
|
16970
|
-
this.thumbprints[algorithm] =
|
|
17307
|
+
this.thumbprints[algorithm] = Convert_1.ToHex(thumbprint);
|
|
16971
17308
|
}
|
|
16972
17309
|
}
|
|
16973
17310
|
catch (error) {
|
|
@@ -17584,6 +17921,75 @@ WebGDPR = __decorate([
|
|
|
17584
17921
|
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17585
17922
|
], WebGDPR);
|
|
17586
17923
|
|
|
17924
|
+
class IssuerAndSerialNumber {
|
|
17925
|
+
constructor(params = {}) {
|
|
17926
|
+
this.issuer = new Name$1;
|
|
17927
|
+
this.serialNumber = new ArrayBuffer(0);
|
|
17928
|
+
Object.assign(this, params);
|
|
17929
|
+
}
|
|
17930
|
+
}
|
|
17931
|
+
__decorate([
|
|
17932
|
+
AsnProp({ type: Name$1 })
|
|
17933
|
+
], IssuerAndSerialNumber.prototype, "issuer", void 0);
|
|
17934
|
+
__decorate([
|
|
17935
|
+
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
|
|
17936
|
+
], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
|
|
17937
|
+
|
|
17938
|
+
let SignerIdentifier = class SignerIdentifier {
|
|
17939
|
+
constructor(params = {}) {
|
|
17940
|
+
Object.assign(this, params);
|
|
17941
|
+
}
|
|
17942
|
+
};
|
|
17943
|
+
__decorate([
|
|
17944
|
+
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
|
|
17945
|
+
], SignerIdentifier.prototype, "subjectKeyIdentifier", void 0);
|
|
17946
|
+
__decorate([
|
|
17947
|
+
AsnProp({ type: IssuerAndSerialNumber })
|
|
17948
|
+
], SignerIdentifier.prototype, "issuerAndSerialNumber", void 0);
|
|
17949
|
+
SignerIdentifier = __decorate([
|
|
17950
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
17951
|
+
], SignerIdentifier);
|
|
17952
|
+
|
|
17953
|
+
var CMSVersion;
|
|
17954
|
+
(function (CMSVersion) {
|
|
17955
|
+
CMSVersion[CMSVersion["v0"] = 0] = "v0";
|
|
17956
|
+
CMSVersion[CMSVersion["v1"] = 1] = "v1";
|
|
17957
|
+
CMSVersion[CMSVersion["v2"] = 2] = "v2";
|
|
17958
|
+
CMSVersion[CMSVersion["v3"] = 3] = "v3";
|
|
17959
|
+
CMSVersion[CMSVersion["v4"] = 4] = "v4";
|
|
17960
|
+
CMSVersion[CMSVersion["v5"] = 5] = "v5";
|
|
17961
|
+
})(CMSVersion || (CMSVersion = {}));
|
|
17962
|
+
let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17963
|
+
};
|
|
17964
|
+
DigestAlgorithmIdentifier = __decorate([
|
|
17965
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17966
|
+
], DigestAlgorithmIdentifier);
|
|
17967
|
+
let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17968
|
+
};
|
|
17969
|
+
SignatureAlgorithmIdentifier = __decorate([
|
|
17970
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17971
|
+
], SignatureAlgorithmIdentifier);
|
|
17972
|
+
let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17973
|
+
};
|
|
17974
|
+
KeyEncryptionAlgorithmIdentifier = __decorate([
|
|
17975
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17976
|
+
], KeyEncryptionAlgorithmIdentifier);
|
|
17977
|
+
let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17978
|
+
};
|
|
17979
|
+
ContentEncryptionAlgorithmIdentifier = __decorate([
|
|
17980
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17981
|
+
], ContentEncryptionAlgorithmIdentifier);
|
|
17982
|
+
let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
|
|
17983
|
+
};
|
|
17984
|
+
MessageAuthenticationCodeAlgorithm = __decorate([
|
|
17985
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17986
|
+
], MessageAuthenticationCodeAlgorithm);
|
|
17987
|
+
let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17988
|
+
};
|
|
17989
|
+
KeyDerivationAlgorithmIdentifier = __decorate([
|
|
17990
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17991
|
+
], KeyDerivationAlgorithmIdentifier);
|
|
17992
|
+
|
|
17587
17993
|
class Attribute$1 {
|
|
17588
17994
|
constructor(params = {}) {
|
|
17589
17995
|
this.attrType = "";
|
|
@@ -17598,6 +18004,59 @@ __decorate([
|
|
|
17598
18004
|
AsnProp({ type: AsnPropTypes.Any, repeated: "set" })
|
|
17599
18005
|
], Attribute$1.prototype, "attrValues", void 0);
|
|
17600
18006
|
|
|
18007
|
+
var SignerInfos_1;
|
|
18008
|
+
class SignerInfo {
|
|
18009
|
+
constructor(params = {}) {
|
|
18010
|
+
this.version = CMSVersion.v0;
|
|
18011
|
+
this.sid = new SignerIdentifier();
|
|
18012
|
+
this.digestAlgorithm = new DigestAlgorithmIdentifier();
|
|
18013
|
+
this.signatureAlgorithm = new SignatureAlgorithmIdentifier();
|
|
18014
|
+
this.signature = new OctetString();
|
|
18015
|
+
Object.assign(this, params);
|
|
18016
|
+
}
|
|
18017
|
+
}
|
|
18018
|
+
__decorate([
|
|
18019
|
+
AsnProp({ type: AsnPropTypes.Integer })
|
|
18020
|
+
], SignerInfo.prototype, "version", void 0);
|
|
18021
|
+
__decorate([
|
|
18022
|
+
AsnProp({ type: SignerIdentifier })
|
|
18023
|
+
], SignerInfo.prototype, "sid", void 0);
|
|
18024
|
+
__decorate([
|
|
18025
|
+
AsnProp({ type: DigestAlgorithmIdentifier })
|
|
18026
|
+
], SignerInfo.prototype, "digestAlgorithm", void 0);
|
|
18027
|
+
__decorate([
|
|
18028
|
+
AsnProp({ type: Attribute$1, repeated: "set", context: 0, implicit: true, optional: true })
|
|
18029
|
+
], SignerInfo.prototype, "signedAttrs", void 0);
|
|
18030
|
+
__decorate([
|
|
18031
|
+
AsnProp({ type: SignatureAlgorithmIdentifier })
|
|
18032
|
+
], SignerInfo.prototype, "signatureAlgorithm", void 0);
|
|
18033
|
+
__decorate([
|
|
18034
|
+
AsnProp({ type: OctetString })
|
|
18035
|
+
], SignerInfo.prototype, "signature", void 0);
|
|
18036
|
+
__decorate([
|
|
18037
|
+
AsnProp({ type: Attribute$1, repeated: "set", context: 1, implicit: true, optional: true })
|
|
18038
|
+
], SignerInfo.prototype, "unsignedAttrs", void 0);
|
|
18039
|
+
let SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {
|
|
18040
|
+
constructor(items) {
|
|
18041
|
+
super(items);
|
|
18042
|
+
Object.setPrototypeOf(this, SignerInfos_1.prototype);
|
|
18043
|
+
}
|
|
18044
|
+
};
|
|
18045
|
+
SignerInfos = SignerInfos_1 = __decorate([
|
|
18046
|
+
AsnType({ type: AsnTypeTypes.Set, itemType: SignerInfo })
|
|
18047
|
+
], SignerInfos);
|
|
18048
|
+
|
|
18049
|
+
let SigningTime$1 = class SigningTime extends Time {
|
|
18050
|
+
};
|
|
18051
|
+
SigningTime$1 = __decorate([
|
|
18052
|
+
AsnType({ type: AsnTypeTypes.Choice })
|
|
18053
|
+
], SigningTime$1);
|
|
18054
|
+
let CounterSignature$1 = class CounterSignature extends SignerInfo {
|
|
18055
|
+
};
|
|
18056
|
+
CounterSignature$1 = __decorate([
|
|
18057
|
+
AsnType({ type: AsnTypeTypes.Sequence })
|
|
18058
|
+
], CounterSignature$1);
|
|
18059
|
+
|
|
17601
18060
|
var CertificateSet_1;
|
|
17602
18061
|
class OtherCertificateFormat {
|
|
17603
18062
|
constructor(params = {}) {
|
|
@@ -17680,46 +18139,6 @@ __decorate([
|
|
|
17680
18139
|
AsnProp({ type: EncapsulatedContent, context: 0, optional: true })
|
|
17681
18140
|
], EncapsulatedContentInfo.prototype, "eContent", void 0);
|
|
17682
18141
|
|
|
17683
|
-
var CMSVersion;
|
|
17684
|
-
(function (CMSVersion) {
|
|
17685
|
-
CMSVersion[CMSVersion["v0"] = 0] = "v0";
|
|
17686
|
-
CMSVersion[CMSVersion["v1"] = 1] = "v1";
|
|
17687
|
-
CMSVersion[CMSVersion["v2"] = 2] = "v2";
|
|
17688
|
-
CMSVersion[CMSVersion["v3"] = 3] = "v3";
|
|
17689
|
-
CMSVersion[CMSVersion["v4"] = 4] = "v4";
|
|
17690
|
-
CMSVersion[CMSVersion["v5"] = 5] = "v5";
|
|
17691
|
-
})(CMSVersion || (CMSVersion = {}));
|
|
17692
|
-
let DigestAlgorithmIdentifier = class DigestAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17693
|
-
};
|
|
17694
|
-
DigestAlgorithmIdentifier = __decorate([
|
|
17695
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17696
|
-
], DigestAlgorithmIdentifier);
|
|
17697
|
-
let SignatureAlgorithmIdentifier = class SignatureAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17698
|
-
};
|
|
17699
|
-
SignatureAlgorithmIdentifier = __decorate([
|
|
17700
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17701
|
-
], SignatureAlgorithmIdentifier);
|
|
17702
|
-
let KeyEncryptionAlgorithmIdentifier = class KeyEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17703
|
-
};
|
|
17704
|
-
KeyEncryptionAlgorithmIdentifier = __decorate([
|
|
17705
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17706
|
-
], KeyEncryptionAlgorithmIdentifier);
|
|
17707
|
-
let ContentEncryptionAlgorithmIdentifier = class ContentEncryptionAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17708
|
-
};
|
|
17709
|
-
ContentEncryptionAlgorithmIdentifier = __decorate([
|
|
17710
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17711
|
-
], ContentEncryptionAlgorithmIdentifier);
|
|
17712
|
-
let MessageAuthenticationCodeAlgorithm = class MessageAuthenticationCodeAlgorithm extends AlgorithmIdentifier {
|
|
17713
|
-
};
|
|
17714
|
-
MessageAuthenticationCodeAlgorithm = __decorate([
|
|
17715
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17716
|
-
], MessageAuthenticationCodeAlgorithm);
|
|
17717
|
-
let KeyDerivationAlgorithmIdentifier = class KeyDerivationAlgorithmIdentifier extends AlgorithmIdentifier {
|
|
17718
|
-
};
|
|
17719
|
-
KeyDerivationAlgorithmIdentifier = __decorate([
|
|
17720
|
-
AsnType({ type: AsnTypeTypes.Sequence })
|
|
17721
|
-
], KeyDerivationAlgorithmIdentifier);
|
|
17722
|
-
|
|
17723
18142
|
let EncryptedContent = class EncryptedContent {
|
|
17724
18143
|
constructor(params = {}) {
|
|
17725
18144
|
Object.assign(this, params);
|
|
@@ -17751,20 +18170,6 @@ __decorate([
|
|
|
17751
18170
|
AsnProp({ type: EncryptedContent, optional: true })
|
|
17752
18171
|
], EncryptedContentInfo.prototype, "encryptedContent", void 0);
|
|
17753
18172
|
|
|
17754
|
-
class IssuerAndSerialNumber {
|
|
17755
|
-
constructor(params = {}) {
|
|
17756
|
-
this.issuer = new Name$1;
|
|
17757
|
-
this.serialNumber = new ArrayBuffer(0);
|
|
17758
|
-
Object.assign(this, params);
|
|
17759
|
-
}
|
|
17760
|
-
}
|
|
17761
|
-
__decorate([
|
|
17762
|
-
AsnProp({ type: Name$1 })
|
|
17763
|
-
], IssuerAndSerialNumber.prototype, "issuer", void 0);
|
|
17764
|
-
__decorate([
|
|
17765
|
-
AsnProp({ type: AsnPropTypes.Integer, converter: AsnIntegerArrayBufferConverter })
|
|
17766
|
-
], IssuerAndSerialNumber.prototype, "serialNumber", void 0);
|
|
17767
|
-
|
|
17768
18173
|
class OtherKeyAttribute {
|
|
17769
18174
|
constructor(params = {}) {
|
|
17770
18175
|
this.keyAttrId = "";
|
|
@@ -18109,63 +18514,6 @@ __decorate([
|
|
|
18109
18514
|
AsnProp({ type: UnprotectedAttributes, context: 1, implicit: true, optional: true })
|
|
18110
18515
|
], EnvelopedData.prototype, "unprotectedAttrs", void 0);
|
|
18111
18516
|
|
|
18112
|
-
let SignerIdentifier = class SignerIdentifier {
|
|
18113
|
-
constructor(params = {}) {
|
|
18114
|
-
Object.assign(this, params);
|
|
18115
|
-
}
|
|
18116
|
-
};
|
|
18117
|
-
__decorate([
|
|
18118
|
-
AsnProp({ type: SubjectKeyIdentifier, context: 0, implicit: true })
|
|
18119
|
-
], SignerIdentifier.prototype, "subjectKeyIdentifier", void 0);
|
|
18120
|
-
__decorate([
|
|
18121
|
-
AsnProp({ type: IssuerAndSerialNumber })
|
|
18122
|
-
], SignerIdentifier.prototype, "issuerAndSerialNumber", void 0);
|
|
18123
|
-
SignerIdentifier = __decorate([
|
|
18124
|
-
AsnType({ type: AsnTypeTypes.Choice })
|
|
18125
|
-
], SignerIdentifier);
|
|
18126
|
-
|
|
18127
|
-
var SignerInfos_1;
|
|
18128
|
-
class SignerInfo {
|
|
18129
|
-
constructor(params = {}) {
|
|
18130
|
-
this.version = CMSVersion.v0;
|
|
18131
|
-
this.sid = new SignerIdentifier();
|
|
18132
|
-
this.digestAlgorithm = new DigestAlgorithmIdentifier();
|
|
18133
|
-
this.signatureAlgorithm = new SignatureAlgorithmIdentifier();
|
|
18134
|
-
this.signature = new OctetString();
|
|
18135
|
-
Object.assign(this, params);
|
|
18136
|
-
}
|
|
18137
|
-
}
|
|
18138
|
-
__decorate([
|
|
18139
|
-
AsnProp({ type: AsnPropTypes.Integer })
|
|
18140
|
-
], SignerInfo.prototype, "version", void 0);
|
|
18141
|
-
__decorate([
|
|
18142
|
-
AsnProp({ type: SignerIdentifier })
|
|
18143
|
-
], SignerInfo.prototype, "sid", void 0);
|
|
18144
|
-
__decorate([
|
|
18145
|
-
AsnProp({ type: DigestAlgorithmIdentifier })
|
|
18146
|
-
], SignerInfo.prototype, "digestAlgorithm", void 0);
|
|
18147
|
-
__decorate([
|
|
18148
|
-
AsnProp({ type: Attribute$1, repeated: "set", context: 0, implicit: true, optional: true })
|
|
18149
|
-
], SignerInfo.prototype, "signedAttrs", void 0);
|
|
18150
|
-
__decorate([
|
|
18151
|
-
AsnProp({ type: SignatureAlgorithmIdentifier })
|
|
18152
|
-
], SignerInfo.prototype, "signatureAlgorithm", void 0);
|
|
18153
|
-
__decorate([
|
|
18154
|
-
AsnProp({ type: OctetString })
|
|
18155
|
-
], SignerInfo.prototype, "signature", void 0);
|
|
18156
|
-
__decorate([
|
|
18157
|
-
AsnProp({ type: Attribute$1, repeated: "set", context: 1, implicit: true, optional: true })
|
|
18158
|
-
], SignerInfo.prototype, "unsignedAttrs", void 0);
|
|
18159
|
-
let SignerInfos = SignerInfos_1 = class SignerInfos extends AsnArray {
|
|
18160
|
-
constructor(items) {
|
|
18161
|
-
super(items);
|
|
18162
|
-
Object.setPrototypeOf(this, SignerInfos_1.prototype);
|
|
18163
|
-
}
|
|
18164
|
-
};
|
|
18165
|
-
SignerInfos = SignerInfos_1 = __decorate([
|
|
18166
|
-
AsnType({ type: AsnTypeTypes.Set, itemType: SignerInfo })
|
|
18167
|
-
], SignerInfos);
|
|
18168
|
-
|
|
18169
18517
|
var DigestAlgorithmIdentifiers_1;
|
|
18170
18518
|
let DigestAlgorithmIdentifiers = DigestAlgorithmIdentifiers_1 = class DigestAlgorithmIdentifiers extends AsnArray {
|
|
18171
18519
|
constructor(items) {
|
|
@@ -18615,7 +18963,7 @@ class Attribute extends AsnData {
|
|
|
18615
18963
|
break;
|
|
18616
18964
|
}
|
|
18617
18965
|
default:
|
|
18618
|
-
this.value =
|
|
18966
|
+
this.value = Convert_1.ToHex(asnExtnValue);
|
|
18619
18967
|
}
|
|
18620
18968
|
}
|
|
18621
18969
|
}
|
|
@@ -18634,7 +18982,7 @@ class X509AttributeCertificate extends AsnData {
|
|
|
18634
18982
|
this.thumbprints = {};
|
|
18635
18983
|
this.type = 'X.509 Attribute Certificate';
|
|
18636
18984
|
const { acinfo } = this.asn;
|
|
18637
|
-
this.serialNumber =
|
|
18985
|
+
this.serialNumber = Convert_1.ToHex(acinfo.serialNumber);
|
|
18638
18986
|
this.version = acinfo.version;
|
|
18639
18987
|
const notBefore = acinfo.attrCertValidityPeriod.notBeforeTime;
|
|
18640
18988
|
if (!notBefore) {
|
|
@@ -18675,7 +19023,7 @@ class X509AttributeCertificate extends AsnData {
|
|
|
18675
19023
|
try {
|
|
18676
19024
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
18677
19025
|
if (thumbprint) {
|
|
18678
|
-
this.thumbprints[algorithm] =
|
|
19026
|
+
this.thumbprints[algorithm] = Convert_1.ToHex(thumbprint);
|
|
18679
19027
|
}
|
|
18680
19028
|
}
|
|
18681
19029
|
catch (error) {
|
|
@@ -18683,10 +19031,10 @@ class X509AttributeCertificate extends AsnData {
|
|
|
18683
19031
|
}
|
|
18684
19032
|
}
|
|
18685
19033
|
exportAsBase64() {
|
|
18686
|
-
return
|
|
19034
|
+
return Convert_1.ToBase64(this.raw);
|
|
18687
19035
|
}
|
|
18688
19036
|
exportAsHexFormatted() {
|
|
18689
|
-
return hexFormat(
|
|
19037
|
+
return hexFormat(Convert_1.ToHex(this.raw));
|
|
18690
19038
|
}
|
|
18691
19039
|
exportAsPemFormatted() {
|
|
18692
19040
|
return `-----BEGIN ATTRIBUTE CERTIFICATE-----\n${base64Format(this.exportAsBase64())}\n-----END ATTRIBUTE CERTIFICATE-----`;
|
|
@@ -18808,7 +19156,7 @@ class CSR extends AsnData {
|
|
|
18808
19156
|
try {
|
|
18809
19157
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
18810
19158
|
if (thumbprint) {
|
|
18811
|
-
this.thumbprints[algorithm] =
|
|
19159
|
+
this.thumbprints[algorithm] = Convert_1.ToHex(thumbprint);
|
|
18812
19160
|
}
|
|
18813
19161
|
}
|
|
18814
19162
|
catch (error) {
|
|
@@ -18823,10 +19171,10 @@ class CSR extends AsnData {
|
|
|
18823
19171
|
}
|
|
18824
19172
|
}
|
|
18825
19173
|
exportAsBase64() {
|
|
18826
|
-
return
|
|
19174
|
+
return Convert_1.ToBase64(this.raw);
|
|
18827
19175
|
}
|
|
18828
19176
|
exportAsHexFormatted() {
|
|
18829
|
-
return hexFormat(
|
|
19177
|
+
return hexFormat(Convert_1.ToHex(this.raw));
|
|
18830
19178
|
}
|
|
18831
19179
|
exportAsPemFormatted() {
|
|
18832
19180
|
return `-----BEGIN CERTIFICATE REQUEST-----\n${base64Format(this.exportAsBase64())}\n-----END CERTIFICATE REQUEST-----`;
|
|
@@ -18870,7 +19218,7 @@ class CRL extends AsnData {
|
|
|
18870
19218
|
try {
|
|
18871
19219
|
const thumbprint = await getCertificateThumbprint(algorithm, this.raw);
|
|
18872
19220
|
if (thumbprint) {
|
|
18873
|
-
this.thumbprints[algorithm] =
|
|
19221
|
+
this.thumbprints[algorithm] = Convert_1.ToHex(thumbprint);
|
|
18874
19222
|
}
|
|
18875
19223
|
}
|
|
18876
19224
|
catch (error) {
|
|
@@ -18904,10 +19252,10 @@ class CRL extends AsnData {
|
|
|
18904
19252
|
}
|
|
18905
19253
|
}
|
|
18906
19254
|
exportAsBase64() {
|
|
18907
|
-
return
|
|
19255
|
+
return Convert_1.ToBase64(this.raw);
|
|
18908
19256
|
}
|
|
18909
19257
|
exportAsHexFormatted() {
|
|
18910
|
-
return hexFormat(
|
|
19258
|
+
return hexFormat(Convert_1.ToHex(this.raw));
|
|
18911
19259
|
}
|
|
18912
19260
|
exportAsPemFormatted() {
|
|
18913
19261
|
return `-----BEGIN X509 CRL-----\n${base64Format(this.exportAsBase64())}\n-----END X509 CRL-----`;
|
|
@@ -19109,7 +19457,7 @@ const PublicKey = (props) => {
|
|
|
19109
19457
|
hAsync(RowValue, { name: l10n.getString('namedCurve'), value: getStringByOID((key.params && 'namedCurve' in key.params) ? key.params.namedCurve : undefined) }),
|
|
19110
19458
|
hAsync(RowValue, { name: l10n.getString('exponent'), value: getPublicKeyExponent(key) }),
|
|
19111
19459
|
hAsync(RowValue, { name: l10n.getString('modulus'), value: getPublicKeyModulus(key) }),
|
|
19112
|
-
hAsync(RowValue, { name: l10n.getString('value'), value:
|
|
19460
|
+
hAsync(RowValue, { name: l10n.getString('value'), value: Convert_1.ToHex(key.value), monospace: true, collapse: true }),
|
|
19113
19461
|
];
|
|
19114
19462
|
}
|
|
19115
19463
|
return [
|
|
@@ -19165,7 +19513,7 @@ const Signature = (props) => {
|
|
|
19165
19513
|
function renderSignatureDetails(data) {
|
|
19166
19514
|
return [
|
|
19167
19515
|
hAsync(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(data.algorithm) }),
|
|
19168
|
-
hAsync(RowValue, { name: l10n.getString('value'), value:
|
|
19516
|
+
hAsync(RowValue, { name: l10n.getString('value'), value: Convert_1.ToHex(data.value), monospace: true, collapse: true }),
|
|
19169
19517
|
];
|
|
19170
19518
|
}
|
|
19171
19519
|
return [
|
|
@@ -19268,7 +19616,7 @@ const ExtendedKeyUsageExtension = (props) => {
|
|
|
19268
19616
|
*/
|
|
19269
19617
|
const SubjectKeyIdentifierExtension = (props) => {
|
|
19270
19618
|
const { extension, getSubjectKeyIdChildrenLink, getSubjectKeyIdSiblingsLink } = props;
|
|
19271
|
-
const keyId =
|
|
19619
|
+
const keyId = Convert_1.ToHex(extension.value.buffer);
|
|
19272
19620
|
const childrenLink = getSubjectKeyIdChildrenLink(keyId);
|
|
19273
19621
|
const siblingsLink = getSubjectKeyIdSiblingsLink(keyId);
|
|
19274
19622
|
return (hAsync(BasicExtension, { extension: extension },
|
|
@@ -19293,7 +19641,7 @@ const SubjectKeyIdentifierExtension = (props) => {
|
|
|
19293
19641
|
*/
|
|
19294
19642
|
const AuthorityKeyIdentifierExtension = (props) => {
|
|
19295
19643
|
const { extension, getAuthKeyIdParentLink, getAuthKeyIdSiblingsLink } = props;
|
|
19296
|
-
const keyId =
|
|
19644
|
+
const keyId = Convert_1.ToHex(extension.value.keyIdentifier.buffer);
|
|
19297
19645
|
const parentLink = getAuthKeyIdParentLink(keyId);
|
|
19298
19646
|
const siblingsLink = getAuthKeyIdSiblingsLink(keyId);
|
|
19299
19647
|
return (hAsync(BasicExtension, { extension: extension },
|
|
@@ -19357,10 +19705,10 @@ const GeneralNamePart = (props) => {
|
|
|
19357
19705
|
catch (error) {
|
|
19358
19706
|
//
|
|
19359
19707
|
}
|
|
19360
|
-
return (hAsync(RowValue, { name: OIDs[value.typeId] || value.typeId, value:
|
|
19708
|
+
return (hAsync(RowValue, { name: OIDs[value.typeId] || value.typeId, value: Convert_1.ToHex(value.value), monospace: true }));
|
|
19361
19709
|
}
|
|
19362
|
-
if (
|
|
19363
|
-
return (hAsync(RowValue, { name: names[name] || name, value:
|
|
19710
|
+
if (BufferSourceConverter_1.isBufferSource(value)) {
|
|
19711
|
+
return (hAsync(RowValue, { name: names[name] || name, value: Convert_1.ToString(value) }));
|
|
19364
19712
|
}
|
|
19365
19713
|
if (value instanceof EDIPartyName) {
|
|
19366
19714
|
return (hAsync(RowValue, { name: names[name] || name, value: value.partyName.toString() }));
|
|
@@ -19766,7 +20114,7 @@ const QCStatementsExtension = (props) => {
|
|
|
19766
20114
|
hAsync(RowValue, { name: "Language", value: location.language })))),
|
|
19767
20115
|
]);
|
|
19768
20116
|
}
|
|
19769
|
-
return (hAsync(RowValue, { name: "Info", value:
|
|
20117
|
+
return (hAsync(RowValue, { name: "Info", value: Convert_1.ToHex(statementInfo), monospace: true }));
|
|
19770
20118
|
}
|
|
19771
20119
|
return (hAsync(BasicExtension, { extension: extension }, Boolean(extension.value.length) && ([
|
|
19772
20120
|
hAsync(RowValue, { name: "Statements", value: "" }),
|
|
@@ -19877,7 +20225,7 @@ const CRLReasonExtension = (props) => {
|
|
|
19877
20225
|
* LICENSE file in the root directory of this source tree.
|
|
19878
20226
|
*/
|
|
19879
20227
|
function getAttributeValue(attribute) {
|
|
19880
|
-
return
|
|
20228
|
+
return Convert_1.ToString(attribute.values[0]);
|
|
19881
20229
|
}
|
|
19882
20230
|
|
|
19883
20231
|
/**
|
|
@@ -19953,7 +20301,7 @@ const BiometricSyntaxExtension = (props) => {
|
|
|
19953
20301
|
hAsync(RowValue, { name: "OID", value: getStringByOID(data.typeOfBiometricData.biometricDataOid) }),
|
|
19954
20302
|
hAsync(RowValue, { name: "Type", value: data.typeOfBiometricData.predefinedBiometricType }),
|
|
19955
20303
|
hAsync(RowValue, { name: "Algorithm", value: getStringByOID(data.hashAlgorithm.algorithm) }),
|
|
19956
|
-
hAsync(RowValue, { name: "Hash", value:
|
|
20304
|
+
hAsync(RowValue, { name: "Hash", value: Convert_1.ToHex(data.biometricDataHash.buffer), monospace: true }),
|
|
19957
20305
|
hAsync(RowValue, { name: "Source Uri", value: data.sourceDataUri })))),
|
|
19958
20306
|
])));
|
|
19959
20307
|
};
|
|
@@ -19975,7 +20323,7 @@ const LogotypeExtension = (props) => {
|
|
|
19975
20323
|
const { imageDetails } = img;
|
|
19976
20324
|
return [
|
|
19977
20325
|
hAsync(RowValue, { name: "Image Type", value: imageDetails.mediaType }),
|
|
19978
|
-
hAsync(RowValue, { name: "Image Hash", value:
|
|
20326
|
+
hAsync(RowValue, { name: "Image Hash", value: Convert_1.ToHex(imageDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
19979
20327
|
hAsync(RowValue, { name: "Image URL", value: imageDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
19980
20328
|
hAsync(RowValue, { name: "Image Hash Algorithm", value: getStringByOID(imageDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
19981
20329
|
];
|
|
@@ -19989,7 +20337,7 @@ const LogotypeExtension = (props) => {
|
|
|
19989
20337
|
const { audioDetails } = aud;
|
|
19990
20338
|
return [
|
|
19991
20339
|
hAsync(RowValue, { name: "Audio Type", value: audioDetails.mediaType }),
|
|
19992
|
-
hAsync(RowValue, { name: "Audio Hash", value:
|
|
20340
|
+
hAsync(RowValue, { name: "Audio Hash", value: Convert_1.ToHex(audioDetails.logotypeHash[0].hashValue), monospace: true }),
|
|
19993
20341
|
hAsync(RowValue, { name: "Audio URL", value: audioDetails.logotypeURI[0], monospace: true, collapse: true }),
|
|
19994
20342
|
hAsync(RowValue, { name: "Audio Hash Algorithm", value: getStringByOID(audioDetails.logotypeHash[0].hashAlg.algorithm) }),
|
|
19995
20343
|
];
|
|
@@ -20094,6 +20442,85 @@ const IssuingDistributionPointExtension = (props) => {
|
|
|
20094
20442
|
extension.value.onlyContainsCACerts && (hAsync(RowValue, { name: l10n.getString('onlyCACertificates'), value: l10n.getString('yes') }))));
|
|
20095
20443
|
};
|
|
20096
20444
|
|
|
20445
|
+
/**
|
|
20446
|
+
* @license
|
|
20447
|
+
* Copyright (c) Peculiar Ventures, LLC.
|
|
20448
|
+
*
|
|
20449
|
+
* This source code is licensed under the MIT license found in the
|
|
20450
|
+
* LICENSE file in the root directory of this source tree.
|
|
20451
|
+
*/
|
|
20452
|
+
const KeyDescriptionExtension = (props) => {
|
|
20453
|
+
const { extension } = props;
|
|
20454
|
+
const renderRowValue = (data) => Object.keys(data).map((keyName) => {
|
|
20455
|
+
const keyValue = data[keyName];
|
|
20456
|
+
let value = '';
|
|
20457
|
+
switch (true) {
|
|
20458
|
+
case typeof keyValue === 'string' || typeof keyValue === 'number':
|
|
20459
|
+
value = keyValue;
|
|
20460
|
+
break;
|
|
20461
|
+
case keyValue instanceof IntegerSet:
|
|
20462
|
+
value = keyValue.join(', ');
|
|
20463
|
+
break;
|
|
20464
|
+
case typeof keyValue === 'boolean':
|
|
20465
|
+
value = keyValue
|
|
20466
|
+
? l10n.getString('yes')
|
|
20467
|
+
: l10n.getString('no');
|
|
20468
|
+
break;
|
|
20469
|
+
case Object.is(keyValue, null):
|
|
20470
|
+
value = 'NULL';
|
|
20471
|
+
break;
|
|
20472
|
+
case keyValue instanceof RootOfTrust:
|
|
20473
|
+
return [
|
|
20474
|
+
hAsync(RowValue, { name: camelCaseToWords(keyName), value: "" }),
|
|
20475
|
+
hAsync(TableRowTable, null, renderRowValue(keyValue)),
|
|
20476
|
+
];
|
|
20477
|
+
case BufferSourceConverter_1.isBufferSource(keyValue):
|
|
20478
|
+
if (keyName === 'attestationApplicationId') {
|
|
20479
|
+
try {
|
|
20480
|
+
const parsed = AsnParser.parse(keyValue, AttestationApplicationId);
|
|
20481
|
+
if (parsed.packageInfos.length || parsed.signatureDigests.length) {
|
|
20482
|
+
return [
|
|
20483
|
+
hAsync(RowValue, { name: camelCaseToWords(keyName), value: "" }),
|
|
20484
|
+
Boolean(parsed.packageInfos) && (hAsync(TableRowTable, null,
|
|
20485
|
+
hAsync(RowValue, { name: camelCaseToWords('packageInfos'), value: "" }),
|
|
20486
|
+
parsed.packageInfos.map((attestationPackageInfo) => (hAsync(TableRowTable, null, renderRowValue(attestationPackageInfo)))))),
|
|
20487
|
+
];
|
|
20488
|
+
}
|
|
20489
|
+
}
|
|
20490
|
+
catch (error) {
|
|
20491
|
+
//
|
|
20492
|
+
}
|
|
20493
|
+
}
|
|
20494
|
+
try {
|
|
20495
|
+
value = Convert_1.ToString(keyValue);
|
|
20496
|
+
}
|
|
20497
|
+
catch (error) {
|
|
20498
|
+
value = Convert_1.ToHex(keyValue);
|
|
20499
|
+
}
|
|
20500
|
+
break;
|
|
20501
|
+
}
|
|
20502
|
+
return (hAsync(RowValue, { name: camelCaseToWords(keyName), value: value }));
|
|
20503
|
+
});
|
|
20504
|
+
const renderAuthorizationList = (title, authorizationList) => {
|
|
20505
|
+
if (authorizationList.length === 0) {
|
|
20506
|
+
return null;
|
|
20507
|
+
}
|
|
20508
|
+
return [
|
|
20509
|
+
hAsync(RowValue, { name: title, value: "" }),
|
|
20510
|
+
hAsync(TableRowTable, null, authorizationList.map(renderRowValue)),
|
|
20511
|
+
];
|
|
20512
|
+
};
|
|
20513
|
+
return (hAsync(BasicExtension, { extension: extension },
|
|
20514
|
+
hAsync(RowValue, { name: camelCaseToWords('attestationVersion'), value: extension.value.attestationVersion }),
|
|
20515
|
+
hAsync(RowValue, { name: camelCaseToWords('attestationSecurityLevel'), value: extension.value.attestationSecurityLevel }),
|
|
20516
|
+
hAsync(RowValue, { name: camelCaseToWords('keymasterVersion'), value: extension.value.keymasterVersion }),
|
|
20517
|
+
hAsync(RowValue, { name: camelCaseToWords('keymasterSecurityLevel'), value: extension.value.keymasterSecurityLevel }),
|
|
20518
|
+
hAsync(RowValue, { name: camelCaseToWords('attestationChallenge'), value: Convert_1.ToString(extension.value.attestationChallenge) }),
|
|
20519
|
+
hAsync(RowValue, { name: camelCaseToWords('uniqueId'), value: Convert_1.ToString(extension.value.uniqueId) || undefined }),
|
|
20520
|
+
renderAuthorizationList(camelCaseToWords('softwareEnforced'), extension.value.softwareEnforced),
|
|
20521
|
+
renderAuthorizationList(camelCaseToWords('teeEnforced'), extension.value.teeEnforced)));
|
|
20522
|
+
};
|
|
20523
|
+
|
|
20097
20524
|
/**
|
|
20098
20525
|
* @license
|
|
20099
20526
|
* Copyright (c) Peculiar Ventures, LLC.
|
|
@@ -20207,6 +20634,9 @@ const Extensions = (props) => {
|
|
|
20207
20634
|
if (extension.value instanceof IssuingDistributionPoint) {
|
|
20208
20635
|
return (hAsync(IssuingDistributionPointExtension, Object.assign({ extension: extension }, props)));
|
|
20209
20636
|
}
|
|
20637
|
+
if (extension.value instanceof NonStandardKeyDescription) {
|
|
20638
|
+
return (hAsync(KeyDescriptionExtension, Object.assign({ extension: extension }, props)));
|
|
20639
|
+
}
|
|
20210
20640
|
if (typeof extension.value === 'string') {
|
|
20211
20641
|
return (hAsync(AsStringExtension, { extension: extension }));
|
|
20212
20642
|
}
|
|
@@ -20596,7 +21026,7 @@ const RevokedCertificates = (props) => {
|
|
|
20596
21026
|
return [
|
|
20597
21027
|
hAsync(RowTitle, { value: l10n.getString('revokedCertificates') }),
|
|
20598
21028
|
revokedCertificates.map((certificate) => ([
|
|
20599
|
-
hAsync(RowValue, { name: l10n.getString('serialNumber'), value:
|
|
21029
|
+
hAsync(RowValue, { name: l10n.getString('serialNumber'), value: Convert_1.ToHex(certificate.userCertificate), monospace: true }),
|
|
20600
21030
|
hAsync(RowValue, { name: l10n.getString('revocationDate'), value: dateShort(certificate.revocationDate.getTime()) }),
|
|
20601
21031
|
(certificate.crlEntryExtensions && certificate.crlEntryExtensions.length && ([
|
|
20602
21032
|
hAsync(RowValue, { name: `${l10n.getString('crlEntryExtensions')}:`, value: "" }),
|
|
@@ -20614,7 +21044,7 @@ const RevokedCertificates = (props) => {
|
|
|
20614
21044
|
hAsync(GeneralNamePart, { generalName: gn, getDNSNameLink: getDNSNameLink, getIPAddressLink: getIPAddressLink })))),
|
|
20615
21045
|
]);
|
|
20616
21046
|
}
|
|
20617
|
-
return (hAsync(RowValue, { name: getStringByOID(extension.asn.extnID), value:
|
|
21047
|
+
return (hAsync(RowValue, { name: getStringByOID(extension.asn.extnID), value: Convert_1.ToHex(extension.asn.extnValue), monospace: true }));
|
|
20618
21048
|
})),
|
|
20619
21049
|
])),
|
|
20620
21050
|
hAsync("tr", null,
|
|
@@ -20644,7 +21074,7 @@ const Holder = (props) => {
|
|
|
20644
21074
|
hAsync("tr", null,
|
|
20645
21075
|
hAsync("td", null),
|
|
20646
21076
|
hAsync("td", null)),
|
|
20647
|
-
hAsync(RowValue, { name: l10n.getString('serialNumber'), value:
|
|
21077
|
+
hAsync(RowValue, { name: l10n.getString('serialNumber'), value: Convert_1.ToHex(baseCertificateID.serial), monospace: true }),
|
|
20648
21078
|
hAsync("tr", null,
|
|
20649
21079
|
hAsync("td", null),
|
|
20650
21080
|
hAsync("td", null)),
|
|
@@ -20652,7 +21082,7 @@ const Holder = (props) => {
|
|
|
20652
21082
|
objectDigestInfo && ([
|
|
20653
21083
|
hAsync(RowValue, { name: l10n.getString('digestInfo'), value: "" }),
|
|
20654
21084
|
hAsync(RowValue, { name: l10n.getString('algorithm'), value: getStringByOID(objectDigestInfo.digestAlgorithm.algorithm) }),
|
|
20655
|
-
hAsync(RowValue, { name: l10n.getString('value'), value:
|
|
21085
|
+
hAsync(RowValue, { name: l10n.getString('value'), value: Convert_1.ToHex(objectDigestInfo.objectDigest), monospace: true }),
|
|
20656
21086
|
hAsync(RowValue, { name: l10n.getString('type'), value: objectDigestInfo.digestedObjectType }),
|
|
20657
21087
|
]),
|
|
20658
21088
|
];
|