mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-21 21:44:40 +03:00
Merge branch 'feat/cert-key-parser' into chore/all-my-stuffs
# Conflicts: # package.json # pnpm-lock.yaml # src/components/TextareaCopyable.vue
This commit is contained in:
commit
b3aff65c23
11 files changed
+836
-76
No files matched your search
+5
-1
@@ -75,7 +75,7 @@
|
|||||||
"iarna-toml-esm": "^3.0.5",
|
"iarna-toml-esm": "^3.0.5",
|
||||||
"ibantools": "^4.3.3",
|
"ibantools": "^4.3.3",
|
||||||
"js-base64": "^3.7.7",
|
"js-base64": "^3.7.7",
|
||||||
"jsbarcode": "^3.11.6",
|
"jsbarcode": "^3.11.7",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"jwt-decode": "^3.1.2",
|
"jwt-decode": "^3.1.2",
|
||||||
"libphonenumber-js": "^1.10.28",
|
"libphonenumber-js": "^1.10.28",
|
||||||
@@ -88,6 +88,7 @@
|
|||||||
"naive-ui": "^2.35.0",
|
"naive-ui": "^2.35.0",
|
||||||
"netmask": "^2.0.2",
|
"netmask": "^2.0.2",
|
||||||
"node-forge": "^1.3.1",
|
"node-forge": "^1.3.1",
|
||||||
|
"openpgp": "^5.11.1",
|
||||||
"oui-data": "^1.0.10",
|
"oui-data": "^1.0.10",
|
||||||
"pdf-signature-reader": "^1.4.2",
|
"pdf-signature-reader": "^1.4.2",
|
||||||
"pinia": "^2.0.34",
|
"pinia": "^2.0.34",
|
||||||
@@ -95,6 +96,7 @@
|
|||||||
"qrcode": "^1.5.1",
|
"qrcode": "^1.5.1",
|
||||||
"randexp": "^0.5.3",
|
"randexp": "^0.5.3",
|
||||||
"sql-formatter": "^13.0.0",
|
"sql-formatter": "^13.0.0",
|
||||||
|
"sshpk": "^1.18.0",
|
||||||
"ua-parser-js": "^1.0.35",
|
"ua-parser-js": "^1.0.35",
|
||||||
"ulid": "^2.3.0",
|
"ulid": "^2.3.0",
|
||||||
"unicode-emoji-json": "^0.4.0",
|
"unicode-emoji-json": "^0.4.0",
|
||||||
@@ -127,6 +129,7 @@
|
|||||||
"@types/node": "^18.15.11",
|
"@types/node": "^18.15.11",
|
||||||
"@types/node-forge": "^1.3.2",
|
"@types/node-forge": "^1.3.2",
|
||||||
"@types/qrcode": "^1.5.0",
|
"@types/qrcode": "^1.5.0",
|
||||||
|
"@types/sshpk": "^1.17.4",
|
||||||
"@types/ua-parser-js": "^0.7.36",
|
"@types/ua-parser-js": "^0.7.36",
|
||||||
"@types/uuid": "^9.0.0",
|
"@types/uuid": "^9.0.0",
|
||||||
"@unocss/eslint-config": "^0.57.0",
|
"@unocss/eslint-config": "^0.57.0",
|
||||||
@@ -148,6 +151,7 @@
|
|||||||
"unplugin-icons": "^0.17.0",
|
"unplugin-icons": "^0.17.0",
|
||||||
"unplugin-vue-components": "^0.25.0",
|
"unplugin-vue-components": "^0.25.0",
|
||||||
"vite": "^4.4.9",
|
"vite": "^4.4.9",
|
||||||
|
"vite-plugin-node-polyfills": "^0.21.0",
|
||||||
"vite-plugin-pwa": "^0.16.0",
|
"vite-plugin-pwa": "^0.16.0",
|
||||||
"vite-plugin-vue-markdown": "^0.23.5",
|
"vite-plugin-vue-markdown": "^0.23.5",
|
||||||
"vite-svg-loader": "^4.0.0",
|
"vite-svg-loader": "^4.0.0",
|
||||||
|
|||||||
Generated
+4
-72
@@ -5,12 +5,6 @@ settings:
|
|||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@chenfengyuan/vue-barcode':
|
|
||||||
specifier: ^2.0.2
|
|
||||||
version: 2.0.2(jsbarcode@3.11.6)(vue@3.3.4)
|
|
||||||
'@github/paste-markdown':
|
|
||||||
specifier: ^1.5.3
|
|
||||||
version: 1.5.3
|
|
||||||
'@it-tools/bip39':
|
'@it-tools/bip39':
|
||||||
specifier: ^0.0.4
|
specifier: ^0.0.4
|
||||||
version: 0.0.4
|
version: 0.0.4
|
||||||
@@ -56,18 +50,12 @@ dependencies:
|
|||||||
'@vueuse/router':
|
'@vueuse/router':
|
||||||
specifier: ^10.0.0
|
specifier: ^10.0.0
|
||||||
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
version: 10.0.0(vue-router@4.1.6)(vue@3.3.4)
|
||||||
'@zxing/library':
|
|
||||||
specifier: ^0.21.0
|
|
||||||
version: 0.21.3
|
|
||||||
bcryptjs:
|
bcryptjs:
|
||||||
specifier: ^2.4.3
|
specifier: ^2.4.3
|
||||||
version: 2.4.3
|
version: 2.4.3
|
||||||
change-case:
|
change-case:
|
||||||
specifier: ^4.1.2
|
specifier: ^4.1.2
|
||||||
version: 4.1.2
|
version: 4.1.2
|
||||||
chatgpt-prompt-splitter:
|
|
||||||
specifier: ^1.0.5
|
|
||||||
version: 1.0.5
|
|
||||||
colord:
|
colord:
|
||||||
specifier: ^2.9.3
|
specifier: ^2.9.3
|
||||||
version: 2.9.3
|
version: 2.9.3
|
||||||
@@ -92,9 +80,6 @@ dependencies:
|
|||||||
dompurify:
|
dompurify:
|
||||||
specifier: ^3.0.6
|
specifier: ^3.0.6
|
||||||
version: 3.0.6
|
version: 3.0.6
|
||||||
email-bounce-parser-browser:
|
|
||||||
specifier: ^1.1
|
|
||||||
version: 1.1.0
|
|
||||||
email-normalizer:
|
email-normalizer:
|
||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
@@ -120,11 +105,8 @@ dependencies:
|
|||||||
specifier: ^4.3.3
|
specifier: ^4.3.3
|
||||||
version: 4.3.3
|
version: 4.3.3
|
||||||
js-base64:
|
js-base64:
|
||||||
specifier: ^3.7.7
|
specifier: ^3.7.6
|
||||||
version: 3.7.7
|
version: 3.7.7
|
||||||
jsbarcode:
|
|
||||||
specifier: ^3.11.6
|
|
||||||
version: 3.11.6
|
|
||||||
json5:
|
json5:
|
||||||
specifier: ^2.2.3
|
specifier: ^2.2.3
|
||||||
version: 2.2.3
|
version: 2.2.3
|
||||||
@@ -1943,16 +1925,6 @@ packages:
|
|||||||
'@babel/helper-validator-identifier': 7.22.20
|
'@babel/helper-validator-identifier': 7.22.20
|
||||||
to-fast-properties: 2.0.0
|
to-fast-properties: 2.0.0
|
||||||
|
|
||||||
/@chenfengyuan/vue-barcode@2.0.2(jsbarcode@3.11.6)(vue@3.3.4):
|
|
||||||
resolution: {integrity: sha512-lHQhYfcqWeeA/UYoe4O+O6c8WD+t9WO8SiWohKOVVIiwPhcvC58YxhvlFvJme0/CPL7+Sh1XCpMaC9Mo2Dt5jQ==}
|
|
||||||
peerDependencies:
|
|
||||||
jsbarcode: ^3.11.0
|
|
||||||
vue: ^3.0.0
|
|
||||||
dependencies:
|
|
||||||
jsbarcode: 3.11.6
|
|
||||||
vue: 3.3.4
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@css-render/plugin-bem@0.15.12(css-render@0.15.12):
|
/@css-render/plugin-bem@0.15.12(css-render@0.15.12):
|
||||||
resolution: {integrity: sha512-Lq2jSOZn+wYQtsyaFj6QRz2EzAnd3iW5fZeHO1WSXQdVYwvwGX0ZiH3X2JQgtgYLT1yeGtrwrqJdNdMEUD2xTw==}
|
resolution: {integrity: sha512-Lq2jSOZn+wYQtsyaFj6QRz2EzAnd3iW5fZeHO1WSXQdVYwvwGX0ZiH3X2JQgtgYLT1yeGtrwrqJdNdMEUD2xTw==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -2208,10 +2180,6 @@ packages:
|
|||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@github/paste-markdown@1.5.3:
|
|
||||||
resolution: {integrity: sha512-PzZ1b3PaqBzYqbT4fwKEhiORf38h2OcGp2+JdXNNM7inZ7egaSmfmhyNkQILpqWfS0AYtRS3CDq6z03eZ8yOMQ==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@humanwhocodes/config-array@0.11.10:
|
/@humanwhocodes/config-array@0.11.10:
|
||||||
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
|
resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==}
|
||||||
engines: {node: '>=10.10.0'}
|
engines: {node: '>=10.10.0'}
|
||||||
@@ -2698,11 +2666,9 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@tabler/icons': 3.20.0
|
'@tabler/icons': 3.20.0
|
||||||
vue: 3.3.4
|
vue: 3.3.4
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@tabler/icons@3.20.0:
|
/@tabler/icons@3.20.0:
|
||||||
resolution: {integrity: sha512-nXSeUzsCOxX/Of+kdUVQfxL9bG+ck8XCWNf9dGSpE+nhVexRwk/4HiDQDxFDysfT7vfgSut6GXnrZsU5M5dSlA==}
|
resolution: {integrity: sha512-nXSeUzsCOxX/Of+kdUVQfxL9bG+ck8XCWNf9dGSpE+nhVexRwk/4HiDQDxFDysfT7vfgSut6GXnrZsU5M5dSlA==}
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@tiptap/core@2.1.12(@tiptap/pm@2.1.6):
|
/@tiptap/core@2.1.12(@tiptap/pm@2.1.6):
|
||||||
resolution: {integrity: sha512-ZGc3xrBJA9KY8kln5AYTj8y+GDrKxi7u95xIl2eccrqTY5CQeRu6HRNM1yT4mAjuSaG9jmazyjGRlQuhyxCKxQ==}
|
resolution: {integrity: sha512-ZGc3xrBJA9KY8kln5AYTj8y+GDrKxi7u95xIl2eccrqTY5CQeRu6HRNM1yT4mAjuSaG9jmazyjGRlQuhyxCKxQ==}
|
||||||
@@ -3446,7 +3412,7 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@unhead/dom': 0.5.1
|
'@unhead/dom': 0.5.1
|
||||||
'@unhead/schema': 0.5.1
|
'@unhead/schema': 0.5.1
|
||||||
'@vueuse/shared': 11.2.0(vue@3.3.4)
|
'@vueuse/shared': 11.0.3(vue@3.3.4)
|
||||||
unhead: 0.5.1
|
unhead: 0.5.1
|
||||||
vue: 3.3.4
|
vue: 3.3.4
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -4088,8 +4054,8 @@ packages:
|
|||||||
- vue
|
- vue
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@vueuse/shared@11.2.0(vue@3.3.4):
|
/@vueuse/shared@11.0.3(vue@3.3.4):
|
||||||
resolution: {integrity: sha512-VxFjie0EanOudYSgMErxXfq6fo8vhr5ICI+BuE3I9FnX7ePllEsVrRQ7O6Q1TLgApeLuPKcHQxAXpP+KnlrJsg==}
|
resolution: {integrity: sha512-0rY2m6HS5t27n/Vp5cTDsKTlNnimCqsbh/fmT2LgE+aaU42EMfXo8+bNX91W9I7DDmxfuACXMmrd7d79JxkqWA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
vue-demi: 0.14.10(vue@3.3.4)
|
vue-demi: 0.14.10(vue@3.3.4)
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
@@ -4101,21 +4067,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-P1A1vRGFBhITco8Iw4/hvnDYoE/SoVrd71dW1pBFdXJb3vP+pBtoOuhbEKy0ROJGOyzQuqvFibcwzyLlWMqNiQ==}
|
resolution: {integrity: sha512-P1A1vRGFBhITco8Iw4/hvnDYoE/SoVrd71dW1pBFdXJb3vP+pBtoOuhbEKy0ROJGOyzQuqvFibcwzyLlWMqNiQ==}
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@zxing/library@0.21.3:
|
|
||||||
resolution: {integrity: sha512-hZHqFe2JyH/ZxviJZosZjV+2s6EDSY0O24R+FQmlWZBZXP9IqMo7S3nb3+2LBWxodJQkSurdQGnqE7KXqrYgow==}
|
|
||||||
engines: {node: '>= 10.4.0'}
|
|
||||||
dependencies:
|
|
||||||
ts-custom-error: 3.3.1
|
|
||||||
optionalDependencies:
|
|
||||||
'@zxing/text-encoding': 0.9.0
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/@zxing/text-encoding@0.9.0:
|
|
||||||
resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==}
|
|
||||||
requiresBuild: true
|
|
||||||
dev: false
|
|
||||||
optional: true
|
|
||||||
|
|
||||||
/abab@2.0.6:
|
/abab@2.0.6:
|
||||||
resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
|
resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -4550,10 +4501,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==}
|
resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/chatgpt-prompt-splitter@1.0.5:
|
|
||||||
resolution: {integrity: sha512-8buXXnxZ5Y5BloPTMEhGTVld9vrVB8WVrUFrjgOpIJ4/VsT+rTnLszbaS1L1KAB0SDSCqj8GU472S2gMyhH8EA==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/check-error@1.0.2:
|
/check-error@1.0.2:
|
||||||
resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==}
|
resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -5089,10 +5036,6 @@ packages:
|
|||||||
/electron-to-chromium@1.4.572:
|
/electron-to-chromium@1.4.572:
|
||||||
resolution: {integrity: sha512-RlFobl4D3ieetbnR+2EpxdzFl9h0RAJkPK3pfiwMug2nhBin2ZCsGIAJWdpNniLz43sgXam/CgipOmvTA+rUiA==}
|
resolution: {integrity: sha512-RlFobl4D3ieetbnR+2EpxdzFl9h0RAJkPK3pfiwMug2nhBin2ZCsGIAJWdpNniLz43sgXam/CgipOmvTA+rUiA==}
|
||||||
|
|
||||||
/email-bounce-parser-browser@1.1.0:
|
|
||||||
resolution: {integrity: sha512-aPMJKpvAPTFTqDI3/bMxcEHK3Wk2yy/tNK/nVWHl5zqyoxJFFgO5a2jvVno4V3e+kyLjZx2M5KJNgNmYf0ZkuQ==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/email-normalizer@1.0.0:
|
/email-normalizer@1.0.0:
|
||||||
resolution: {integrity: sha512-wZYuuMtL4kUOmg/TPtCrf9hAZjbFq+FcjWA85Z5nr2lGllRnWJPxCJw3gy4Cx+adMoyVw4VJfGGvt/OHgIW+qg==}
|
resolution: {integrity: sha512-wZYuuMtL4kUOmg/TPtCrf9hAZjbFq+FcjWA85Z5nr2lGllRnWJPxCJw3gy4Cx+adMoyVw4VJfGGvt/OHgIW+qg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -6636,10 +6579,6 @@ packages:
|
|||||||
argparse: 2.0.1
|
argparse: 2.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/jsbarcode@3.11.6:
|
|
||||||
resolution: {integrity: sha512-G5TKGyKY1zJo0ZQKFM1IIMfy0nF2rs92BLlCz+cU4/TazIc4ZH+X1GYeDRt7TKjrYqmPfTjwTBkU/QnQlsYiuA==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/jsbn@1.1.0:
|
/jsbn@1.1.0:
|
||||||
resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
|
resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -8297,7 +8236,6 @@ packages:
|
|||||||
|
|
||||||
/sortablejs@1.14.0:
|
/sortablejs@1.14.0:
|
||||||
resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==}
|
resolution: {integrity: sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==}
|
||||||
dev: false
|
|
||||||
|
|
||||||
/source-map-js@1.0.2:
|
/source-map-js@1.0.2:
|
||||||
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
|
resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==}
|
||||||
@@ -8672,11 +8610,6 @@ packages:
|
|||||||
typescript: 5.2.2
|
typescript: 5.2.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ts-custom-error@3.3.1:
|
|
||||||
resolution: {integrity: sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A==}
|
|
||||||
engines: {node: '>=14.0.0'}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/tslib@1.14.1:
|
/tslib@1.14.1:
|
||||||
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -9436,7 +9369,6 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
sortablejs: 1.14.0
|
sortablejs: 1.14.0
|
||||||
vue: 3.3.4
|
vue: 3.3.4
|
||||||
dev: false
|
|
||||||
|
|
||||||
/vueuc@0.4.51(vue@3.3.4):
|
/vueuc@0.4.51(vue@3.3.4):
|
||||||
resolution: {integrity: sha512-pLiMChM4f+W8czlIClGvGBYo656lc2Y0/mXFSCydcSmnCR1izlKPGMgiYBGjbY9FDkFG8a2HEVz7t0DNzBWbDw==}
|
resolution: {integrity: sha512-pLiMChM4f+W8czlIClGvGBYo656lc2Y0/mXFSCydcSmnCR1izlKPGMgiYBGjbY9FDkFG8a2HEVz7t0DNzBWbDw==}
|
||||||
|
|||||||
@@ -2,7 +2,12 @@
|
|||||||
import { useVModel } from '@vueuse/core';
|
import { useVModel } from '@vueuse/core';
|
||||||
import { useCopy } from '@/composable/copy';
|
import { useCopy } from '@/composable/copy';
|
||||||
|
|
||||||
const props = defineProps<{ value: string }>();
|
const props = defineProps<{
|
||||||
|
value: string
|
||||||
|
multiline?: boolean
|
||||||
|
rows?: number | string
|
||||||
|
autosize?: boolean
|
||||||
|
}>();
|
||||||
const emit = defineEmits(['update:value']);
|
const emit = defineEmits(['update:value']);
|
||||||
|
|
||||||
const value = useVModel(props, 'value', emit);
|
const value = useVModel(props, 'value', emit);
|
||||||
@@ -11,7 +16,12 @@ const tooltipText = computed(() => isJustCopied.value ? 'Copied!' : 'Copy to cli
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<c-input-text v-model:value="value">
|
<c-input-text
|
||||||
|
v-model:value="value"
|
||||||
|
:multiline="multiline"
|
||||||
|
:rows="rows"
|
||||||
|
:autosize="autosize"
|
||||||
|
>
|
||||||
<template #suffix>
|
<template #suffix>
|
||||||
<c-tooltip :tooltip="tooltipText">
|
<c-tooltip :tooltip="tooltipText">
|
||||||
<c-button circle variant="text" size="small" @click="copy()">
|
<c-button circle variant="text" size="small" @click="copy()">
|
||||||
|
|||||||
@@ -25,8 +25,11 @@ const props = withDefaults(
|
|||||||
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
copyPlacement?: 'top-right' | 'bottom-right' | 'outside' | 'none'
|
||||||
copyMessage?: string
|
copyMessage?: string
|
||||||
wordWrap?: boolean
|
wordWrap?: boolean
|
||||||
|
<<<<<<< HEAD
|
||||||
downloadFileName?: string
|
downloadFileName?: string
|
||||||
downloadButtonText?: string
|
downloadButtonText?: string
|
||||||
|
=======
|
||||||
|
>>>>>>> feat/cert-key-parser
|
||||||
}>(),
|
}>(),
|
||||||
{
|
{
|
||||||
followHeightOf: null,
|
followHeightOf: null,
|
||||||
|
|||||||
@@ -0,0 +1,333 @@
|
|||||||
|
import type {
|
||||||
|
Certificate,
|
||||||
|
Fingerprint,
|
||||||
|
Key,
|
||||||
|
PrivateKey, Signature,
|
||||||
|
} from 'sshpk';
|
||||||
|
import type * as openpgp from 'openpgp';
|
||||||
|
import * as forge from 'node-forge';
|
||||||
|
|
||||||
|
export interface LabelValue {
|
||||||
|
label: string
|
||||||
|
value: string
|
||||||
|
multiline?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
function onErrorReturnErrorMessage(func: () => any) {
|
||||||
|
try {
|
||||||
|
return func();
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return e.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function buf2Hex(buffer: ArrayBuffer) { // buffer is an ArrayBuffer
|
||||||
|
return [...new Uint8Array(buffer)]
|
||||||
|
.map(x => x.toString(16).padStart(2, '0'))
|
||||||
|
.join('');
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPublicKeyLabelValues(publicKey: Key) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Public Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Key Type:',
|
||||||
|
value: publicKey.type,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Size:',
|
||||||
|
value: publicKey.size,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Comment:',
|
||||||
|
value: publicKey.comment,
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Curve:',
|
||||||
|
value: publicKey.curve ?? 'none',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha256):',
|
||||||
|
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha256')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha512):',
|
||||||
|
value: onErrorReturnErrorMessage(() => publicKey.fingerprint('sha512')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPrivateKeyLabelValues(privateKey: PrivateKey) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Private Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Key Type:',
|
||||||
|
value: privateKey.type,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Size:',
|
||||||
|
value: privateKey.size,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Comment:',
|
||||||
|
value: privateKey.comment,
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Curve:',
|
||||||
|
value: privateKey.curve,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha256):',
|
||||||
|
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha256')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha512):',
|
||||||
|
value: onErrorReturnErrorMessage(() => privateKey.fingerprint('sha512')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCertificateLabelValues(cert: Certificate) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Certificate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subjects:',
|
||||||
|
value: cert.subjects?.map(s => s.toString()).join('\n'),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Issuer:',
|
||||||
|
value: cert.issuer.toString(),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject Key:',
|
||||||
|
value: onErrorReturnErrorMessage(() => cert.subjectKey?.toString('ssh')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject Key Type:',
|
||||||
|
value: cert.subjectKey?.type,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject Size:',
|
||||||
|
value: cert.subjectKey?.size,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject Comment:',
|
||||||
|
value: cert.subjectKey?.comment,
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject Curve:',
|
||||||
|
value: cert.subjectKey?.curve ?? 'none',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Issuer Key:',
|
||||||
|
value: onErrorReturnErrorMessage(() => cert.issuerKey?.toString('ssh')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Serial:',
|
||||||
|
value: buf2Hex(cert.serial),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Purposes:',
|
||||||
|
value: cert.purposes?.join(', '),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Extensions:',
|
||||||
|
value: JSON.stringify(cert.getExtensions(), null, 2),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha256):',
|
||||||
|
value: onErrorReturnErrorMessage(() => cert.fingerprint('sha256')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (sha512):',
|
||||||
|
value: onErrorReturnErrorMessage(() => cert.fingerprint('sha512')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Certificate (pem):',
|
||||||
|
value: onErrorReturnErrorMessage(() => cert.toString('pem')),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getPGPPublicKeyLabelValuesAsync(pgpPublicKey: openpgp.Key) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'PGP Public Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Creation Time:',
|
||||||
|
value: pgpPublicKey.getCreationTime().toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Expiration Time:',
|
||||||
|
value: (await pgpPublicKey.getExpirationTime())?.toString() || '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Algorithm Info:',
|
||||||
|
value: JSON.stringify(pgpPublicKey.getAlgorithmInfo()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint:',
|
||||||
|
value: pgpPublicKey.getFingerprint(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'User ID(s):',
|
||||||
|
value: pgpPublicKey.getUserIDs().join(', '),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Key ID(s):',
|
||||||
|
value: pgpPublicKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey: openpgp.Key) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'PGP Private Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Creation Time:',
|
||||||
|
value: pgpPrivateKey.getCreationTime().toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Expiration Time:',
|
||||||
|
value: (await pgpPrivateKey.getExpirationTime())?.toString() || '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Algorithm Info:',
|
||||||
|
value: JSON.stringify(pgpPrivateKey.getAlgorithmInfo()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint:',
|
||||||
|
value: pgpPrivateKey.getFingerprint(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'User ID(s):',
|
||||||
|
value: pgpPrivateKey.getUserIDs().join(', '),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Key ID(s):',
|
||||||
|
value: pgpPrivateKey.getKeyIDs().map(k => k.toHex()).join(' ; '),
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getCSRLabelValues(csr: forge.pki.Certificate) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Certificate Signing Request',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Subject:',
|
||||||
|
value: csr.subject?.attributes?.map(a => JSON.stringify(a, null, 2)).join('\n'),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Issuer:',
|
||||||
|
value: csr.issuer?.toString(),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Validity:',
|
||||||
|
value: JSON.stringify(csr.validity, null, 2),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Signature:',
|
||||||
|
value: csr.signature,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Signature Oid:',
|
||||||
|
value: csr.signatureOid?.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Signature parameters:',
|
||||||
|
value: JSON.stringify(csr.signatureParameters, null, 2),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Signing info:',
|
||||||
|
value: JSON.stringify(csr.siginfo, null, 2),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Serial:',
|
||||||
|
value: csr.serialNumber?.toString(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Extensions:',
|
||||||
|
value: JSON.stringify(csr.extensions, null, 2),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Public Key:',
|
||||||
|
value: onErrorReturnErrorMessage(() => forge.pki.publicKeyToPem(csr.publicKey)),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Public Key Fingerprint:',
|
||||||
|
value: onErrorReturnErrorMessage(() => forge.pki.getPublicKeyFingerprint(csr.publicKey)?.toHex()),
|
||||||
|
multiline: true,
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getFingerprintLabelValues(fingerprint: Fingerprint) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Fingerprint',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (hex):',
|
||||||
|
value: fingerprint.toString('hex'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (base64):',
|
||||||
|
value: fingerprint.toString('base64'),
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getSignatureLabelValues(signature: Signature) {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Signature',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (asn1):',
|
||||||
|
value: signature.toString('asn1'),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Fingerprint (ssh):',
|
||||||
|
value: signature.toString('ssh'),
|
||||||
|
},
|
||||||
|
] as LabelValue[];
|
||||||
|
}
|
||||||
@@ -0,0 +1,201 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { getKeyOrCertificateInfosAsync } from './certificate-key-parser.service';
|
||||||
|
|
||||||
|
const encryptedPrivateKey = /* NOSONAR */ `-----BEGIN ENCRYPTED PRIVATE KEY-----
|
||||||
|
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
|
||||||
|
oimmuNBEFKy1F1rSP3NQvwcZVw==
|
||||||
|
-----END ENCRYPTED PRIVATE KEY-----
|
||||||
|
`;
|
||||||
|
const openSSHPrivateKey = /* NOSONAR */ `-----BEGIN OPENSSH PRIVATE KEY-----
|
||||||
|
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABFwAAAAdzc2gtcn
|
||||||
|
NhAAAAAwEAAQAAAQEA4r66AJdnJBwsKDyTr4QizQYMVhaFtcBcMcVuJHbKW/DtG985oA2V
|
||||||
|
hJRfcBz8MKNS9iTLRkgq4yoTVCIi5FDVU4EnQbLMoLfN2og6PpgSSL59bPUvYoenp6RS1i
|
||||||
|
R606eVakH/J6IIiadHMWBrLjCiChf5U/bvuSkUQWi0YLH9hI6Nw+S9MdwzBofshZZdww9Y
|
||||||
|
4udrWEVdfGrxWv5gjlaquxYZAnfaYCI0Pgh9v1nEALFufOVi1onUZaxduyvsLoQnXiwP2c
|
||||||
|
fWXsBYmjfViTTADTvHTLCF9IH+6heGk2WJkosgiajmMlc+1U7Xs+r5ZJ0ikt0ioydPN8Hi
|
||||||
|
LnVih6lENwAAA7hrsy+Ha7MvhwAAAAdzc2gtcnNhAAABAQDivroAl2ckHCwoPJOvhCLNBg
|
||||||
|
xWFoW1wFwxxW4kdspb8O0b3zmgDZWElF9wHPwwo1L2JMtGSCrjKhNUIiLkUNVTgSdBssyg
|
||||||
|
t83aiDo+mBJIvn1s9S9ih6enpFLWJHrTp5VqQf8nogiJp0cxYGsuMKIKF/lT9u+5KRRBaL
|
||||||
|
Rgsf2Ejo3D5L0x3DMGh+yFll3DD1ji52tYRV18avFa/mCOVqq7FhkCd9pgIjQ+CH2/WcQA
|
||||||
|
sW585WLWidRlrF27K+wuhCdeLA/Zx9ZewFiaN9WJNMANO8dMsIX0gf7qF4aTZYmSiyCJqO
|
||||||
|
YyVz7VTtez6vlknSKS3SKjJ083weIudWKHqUQ3AAAAAwEAAQAAAQBmKTj0+0JlaqwalPCV
|
||||||
|
rBth9M+qGgu0kC753dJ6a2tRcYPjgvgbvQMY8SDvCqA16eB/NqS/zdRE9bgvuBGwfRsgvJ
|
||||||
|
hLaZv47de6FpbnjOzwCaPJa88lvak0Rz1rbpRIuMEBVyr3WHIwU0YoYSDpdtALbDHSOvhX
|
||||||
|
nMKblelvh8KJ7jelix2R3llvcYexKdS66zzP7nPj5x8d1FDo2cxqWsy2aQxMlbZGTd3ujQ
|
||||||
|
ABzZGvI3L0tJRf4sPph/eLS28/teAExp5Uo9DuehqgU33iAYOaO2vZGqQJxBbaVtiarVK1
|
||||||
|
kRQLBrhieMIUJ9XHSwDn74VHWtBNfocTSPe6vbVMjLpBAAAAgGBTluv8WHqG1JTauYNjBI
|
||||||
|
EhSKL96MrIZR+fytEg3gcxitPnpQiPTP6XHXpQ7fxVk25bYvCj4QNi00jW6kBR46Zh90NI
|
||||||
|
nKgYvxdYoA5A7L6JvvByy00SbLssiM7kf3ByT/4EA8S911Q4cks8lKrwEUw+UzqTBR6QdG
|
||||||
|
JyZQQcUJa+AAAAgQDyIYjECyG91/X+zFYcecW+wWyLBzyEvOxFlRd4tZnvWknQTdtFqTlN
|
||||||
|
orTT+un1ygKe0DkfwXSbbjE69+xxlMtPQ2X6wd2mUruvtyBv1R8Kfj+doY5lFUfCEKj88u
|
||||||
|
ck1+Ol1K+KDnvlYZVnb5eCvMxmEMqyD+eTQ2EcNAJtjNmuDQAAAIEA77uU45tseIe9E6OZ
|
||||||
|
Hum2bUxQmqkpjrNCECiTJR99NUx+22sBZwrMAt3QzBwgSogQhLKAw+keEUG6zAl7UA6Lsc
|
||||||
|
vJdDllY2vYMRW9LZ1XNCxvl0i6QUsT8l9hwA9GuMQN1m6NRU+cnEU87KIXVBb+DRyZwo21
|
||||||
|
4WRkAc1Ru/KtrlMAAAAAAQID
|
||||||
|
-----END OPENSSH PRIVATE KEY-----
|
||||||
|
`;
|
||||||
|
|
||||||
|
const formatsData = [
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
|
xjMEZkHgaRYJKwYBBAHaRw8BAQdAdCmEzdpkjMzOoNkzgDFk/CHd+6uYAWkZ
|
||||||
|
BPbjEzTJWtfNAMKMBBAWCgA+BYJmQeBpBAsJBwgJkEDKj7jnGr9wAxUICgQW
|
||||||
|
AAIBAhkBApsDAh4BFiEExfkkog7+aHz7TqepQMqPuOcav3AAAJaaAQCayvFQ
|
||||||
|
jxFbC7oOzX+8wOV8gmXVXXqI5dtLQYY3SeyqmwD/ftVwwe6Prl0vVFyLB/5y
|
||||||
|
lIpAti8AK1Lv8hIezzOx4QDOOARmQeBpEgorBgEEAZdVAQUBAQdA2jU3Rmt7
|
||||||
|
nMFvqyjgKdVjK5o2CQI2vJiSzn8cfV1piEgDAQgHwngEGBYKACoFgmZB4GkJ
|
||||||
|
kEDKj7jnGr9wApsMFiEExfkkog7+aHz7TqepQMqPuOcav3AAABI0AQCMW4Hg
|
||||||
|
FuIaZk9LVQsUmNknj4a70fzwDYWUYvq0C1iy/QD+KXvLKfcmky5OXJA7RsRV
|
||||||
|
SN2a4SE4c8FH22uyirzyUww=
|
||||||
|
=w51K
|
||||||
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'PGP Public Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// NOSONAR
|
||||||
|
input: `
|
||||||
|
-----BEGIN PGP PRIVATE KEY BLOCK-----
|
||||||
|
|
||||||
|
xVgEZkHgaRYJKwYBBAHaRw8BAQdAdCmEzdpkjMzOoNkzgDFk/CHd+6uYAWkZ
|
||||||
|
BPbjEzTJWtcAAQDXcDgEziqd9ZO/OpoyblRRxAOgPq2y8zTitwTz+ixX7RCe
|
||||||
|
zQDCjAQQFgoAPgWCZkHgaQQLCQcICZBAyo+45xq/cAMVCAoEFgACAQIZAQKb
|
||||||
|
AwIeARYhBMX5JKIO/mh8+06nqUDKj7jnGr9wAACWmgEAmsrxUI8RWwu6Ds1/
|
||||||
|
vMDlfIJl1V16iOXbS0GGN0nsqpsA/37VcMHuj65dL1Rciwf+cpSKQLYvACtS
|
||||||
|
7/ISHs8zseEAx10EZkHgaRIKKwYBBAGXVQEFAQEHQNo1N0Zre5zBb6so4CnV
|
||||||
|
YyuaNgkCNryYks5/HH1daYhIAwEIBwAA/2PxYHVWBmkLD9eiFDLJ0EtspWQ+
|
||||||
|
JKui86xylduxQWngEIrCeAQYFgoAKgWCZkHgaQmQQMqPuOcav3ACmwwWIQTF
|
||||||
|
+SSiDv5ofPtOp6lAyo+45xq/cAAAEjQBAIxbgeAW4hpmT0tVCxSY2SePhrvR
|
||||||
|
/PANhZRi+rQLWLL9AP4pe8sp9yaTLk5ckDtGxFVI3ZrhIThzwUfba7KKvPJT
|
||||||
|
DA==
|
||||||
|
=hSgY
|
||||||
|
-----END PGP PRIVATE KEY BLOCK-----
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'PGP Private Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
-----BEGIN CERTIFICATE REQUEST-----
|
||||||
|
MIIClTCCAX0CAQAwUDERMA8GA1UEAxMIdGVzdC5jb20xDzANBgNVBAYTBkZyYW5j
|
||||||
|
ZTELMAkGA1UECBMCRlIxDjAMBgNVBAcTBVBhcmlzMQ0wCwYDVQQKEwRUZXN0MIIB
|
||||||
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnIUCiMFffkHGuAhwTaW84uh7
|
||||||
|
/03KcfQAZB/bZKqLaxtcBGryTB1gHFSsl3uFlW+tIcjsboWnQ2JB0J1Z5Fp4a6IA
|
||||||
|
/62S6GTo6dAd9f73TR+P2vQghZOtiCoc7CN2KlosIx/EWMcMjq+CBzLRjjOOR8tX
|
||||||
|
Yn4ZAhPInO1ZGPMEpfEEfn44aJFRGaMy4KEU+RpTzFKFW6bialvKC3yGPegQ4wcz
|
||||||
|
AqvyUc9WUwG53HYLSJHldg8tZnpiJBNUh8mXiIiw51MFJ4Q9RVnz9vuoHgC6FmUv
|
||||||
|
qlg/R4gjGGfjDhAIUtz+Y98Dl+xfLmD+EzY7KQ1ur412BvQ8rXankNGLA2ea+wID
|
||||||
|
AQABoAAwDQYJKoZIhvcNAQEFBQADggEBABdtkhFSwgaXZWTcKrz6oarvuaQkrjvs
|
||||||
|
Nk9lUs1h/dfhJpnE3iZA0CuNp5PVQRdC2g+/37r21/udjNFdrX1Rm6/ldG0b2xDu
|
||||||
|
nQYZcLpIVB0fZ2TB+FHthmGw175I2niWIfNJQhIqnWJXi8unkGTMP2cD6j3axtMi
|
||||||
|
K8MUVPhWmL11ojEXItG35AU79G6GhFxel9wIByqsXreCUyOcrpYCHy2Fv85ivdE1
|
||||||
|
JyEQ2tE/f+cKwNg4yJNFoCoHSSFRn61F12J4m2nwpQ77VfD66oVkWtk/gYMrwx0d
|
||||||
|
4FlJNs+NtZDlcM7fJLNo7YsMdne7hl4aL6WG96kdWdxYEt/2dl3WXbY=
|
||||||
|
-----END CERTIFICATE REQUEST-----
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'Certificate Signing Request',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDivroAl2ckHCwoPJOvhCLNBgxWFoW1wFwxxW4kdspb8O0b3zmgDZWElF9wHPwwo1L2JMtGSCrjKhNUIiLkUNVTgSdBssygt83aiDo+mBJIvn1s9S9ih6enpFLWJHrTp5VqQf8nogiJp0cxYGsuMKIKF/lT9u+5KRRBaLRgsf2Ejo3D5L0x3DMGh+yFll3DD1ji52tYRV18avFa/mCOVqq7FhkCd9pgIjQ+CH2/WcQAsW585WLWidRlrF27K+wuhCdeLA/Zx9ZewFiaN9WJNMANO8dMsIX0gf7qF4aTZYmSiyCJqOYyVz7VTtez6vlknSKS3SKjJ083weIudWKHqUQ3
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'Public Key',
|
||||||
|
title: 'ssh-rsa Public Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: openSSHPrivateKey,
|
||||||
|
pass: '',
|
||||||
|
type: 'Private Key',
|
||||||
|
title: 'Unencrypted Private Key',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
SHA256:qflg623OemnYEHDwUafq+XuMoB0UdJ+Ks44kHcWxDyM
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'Fingerprint',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDQDCCAiigAwIBAgIJK59gK0GUbZO3MA0GCSqGSIb3DQEBBQUAMFAxETAPBgNV
|
||||||
|
BAMTCHRlc3QuY29tMQ8wDQYDVQQGEwZGcmFuY2UxCzAJBgNVBAgTAkZSMQ4wDAYD
|
||||||
|
VQQHEwVQYXJpczENMAsGA1UEChMEVGVzdDAeFw0yNDA1MTMwOTQ4MTVaFw0yNTA1
|
||||||
|
MTMwOTQ4MTVaMFAxETAPBgNVBAMTCHRlc3QuY29tMQ8wDQYDVQQGEwZGcmFuY2Ux
|
||||||
|
CzAJBgNVBAgTAkZSMQ4wDAYDVQQHEwVQYXJpczENMAsGA1UEChMEVGVzdDCCASIw
|
||||||
|
DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMKrE3C9tUtmvHZkIwEBf1h5N7KC
|
||||||
|
FoXowfNZxKK7SHWcnQjBdv0ziqsU+GmcUqUD1GymMcBweqw4TQVg0a/UwdYIUTuQ
|
||||||
|
GXGx4ULCXKHv/NfmVSWcMsOZHAR4m/yEzTB/ZjKMSrqnIWyOdusDMRn4VRoAtrKO
|
||||||
|
/FM+SDJ6wvnJ/jNoZJXktq9avYduEi+heNekIF6NYM9clzm9Ff3Evf89KuigBcsu
|
||||||
|
rgL+S8PjotCwxMgzOWV4/paeeQluqYeU94prWIASS/D3elH7qFTAUnafBICFN2zs
|
||||||
|
XWY6ZFCR8QrDI5F/8KELq/3BaLQBxpIi9SmADLWqnPOu+6H5rzr2YV8LaxMCAwEA
|
||||||
|
AaMdMBswDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAvQwDQYJKoZIhvcNAQEFBQAD
|
||||||
|
ggEBAKhrUNnWe0VmgefvfwsAqrbk0Z6PwaibIl/l5I9oh1qM01J9BFHpvomhcLxu
|
||||||
|
cmIpD6nAqtkNyvsXtFAnZG3WNaf45yyd153wSa0QnrNo2GRH9quktm4DaRIIP7qq
|
||||||
|
EdtApYCeT16LvAGYUH3ubCdom8w6DkukLg8qMrXMywSZlx85jlJfifPvMKsJmm/a
|
||||||
|
QAq1H3cYaaj0DocF1rCP+hLzvsuM7UwS2JOK8Mw49kYPBTbCVmRDOE1rhlDIO8Kw
|
||||||
|
V7CCFr4NXsyRlM0TpKdspOmxJiyxmk6DoVgp9PeqfoyDAC9TJU0VJ6A2x+AfjK4O
|
||||||
|
Wg6xDXMx6dk6Rhh8yqGrmx05QM8=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'Certificate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: `
|
||||||
|
c6:b9:73:b8:68:49:33:ad:27:51:bb:6c:16:e7:9c:da:dd:e3:92:15
|
||||||
|
`,
|
||||||
|
pass: '',
|
||||||
|
type: 'Fingerprint',
|
||||||
|
title: 'HEX Fingerprint',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
input: encryptedPrivateKey,
|
||||||
|
pass: 'test',
|
||||||
|
type: 'Private Key',
|
||||||
|
title: 'Encrypted Private Key',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
describe('certificate-key-parser', () => {
|
||||||
|
for (const format of formatsData) {
|
||||||
|
const { input, pass, type, title } = format;
|
||||||
|
it(`Parse '${title ?? type}' format with right type (${type})`, async () => {
|
||||||
|
const { values } = await getKeyOrCertificateInfosAsync(input, pass);
|
||||||
|
const result_type = values.find(v => v.label === 'Type:')?.value;
|
||||||
|
|
||||||
|
expect(result_type).toBe(type);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,129 @@
|
|||||||
|
import type { Buffer } from 'node:buffer';
|
||||||
|
import {
|
||||||
|
parseCertificate, parseFingerprint,
|
||||||
|
parseKey,
|
||||||
|
parsePrivateKey,
|
||||||
|
parseSignature,
|
||||||
|
} from 'sshpk';
|
||||||
|
import type {
|
||||||
|
AlgorithmType,
|
||||||
|
Certificate,
|
||||||
|
CertificateFormat,
|
||||||
|
Fingerprint,
|
||||||
|
Key,
|
||||||
|
PrivateKey, Signature, SignatureFormatType,
|
||||||
|
} from 'sshpk';
|
||||||
|
import { Base64 } from 'js-base64';
|
||||||
|
import * as openpgp from 'openpgp';
|
||||||
|
import * as forge from 'node-forge';
|
||||||
|
import { type LabelValue, getCSRLabelValues, getCertificateLabelValues, getFingerprintLabelValues, getPGPPrivateKeyLabelValuesAsync, getPGPPublicKeyLabelValuesAsync, getPrivateKeyLabelValues, getPublicKeyLabelValues, getSignatureLabelValues } from './certificate-key-parser.infos';
|
||||||
|
|
||||||
|
export async function getKeyOrCertificateInfosAsync(keyOrCertificateValue: string | Buffer, passphrase: string) {
|
||||||
|
try {
|
||||||
|
const canParse = (value: string | Buffer, parseFunction: (value: string | Buffer) => any) => {
|
||||||
|
try {
|
||||||
|
return parseFunction(value);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const canParseAsync = async (value: string | Buffer, parseFunction: (value: string | Buffer) => Promise<any>) => {
|
||||||
|
try {
|
||||||
|
return await parseFunction(value);
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const inputKeyOrCertificateValue = (typeof keyOrCertificateValue === 'string' ? keyOrCertificateValue?.trim() : keyOrCertificateValue);
|
||||||
|
|
||||||
|
const privateKey = canParse(inputKeyOrCertificateValue,
|
||||||
|
value => parsePrivateKey(value, 'auto', { passphrase })) as PrivateKey;
|
||||||
|
if (privateKey) {
|
||||||
|
return {
|
||||||
|
values: getPrivateKeyLabelValues(privateKey),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const publicKey = canParse(inputKeyOrCertificateValue, parseKey) as Key;
|
||||||
|
if (publicKey) {
|
||||||
|
return { values: getPublicKeyLabelValues(publicKey) };
|
||||||
|
}
|
||||||
|
|
||||||
|
const pgpPrivateKey = await canParseAsync(inputKeyOrCertificateValue, value => openpgp.readPrivateKey({ armoredKey: value.toString() })) as openpgp.Key;
|
||||||
|
if (pgpPrivateKey) {
|
||||||
|
return { values: await getPGPPrivateKeyLabelValuesAsync(pgpPrivateKey) };
|
||||||
|
}
|
||||||
|
|
||||||
|
const pgpPublicKey = await canParseAsync(inputKeyOrCertificateValue, value => openpgp.readKey({ armoredKey: value.toString() })) as openpgp.Key;
|
||||||
|
if (pgpPublicKey) {
|
||||||
|
return { values: await getPGPPublicKeyLabelValuesAsync(pgpPublicKey) };
|
||||||
|
}
|
||||||
|
|
||||||
|
const cert = canParse(inputKeyOrCertificateValue, (value) => {
|
||||||
|
for (const format of ['openssh', 'pem', 'x509']) {
|
||||||
|
try {
|
||||||
|
return parseCertificate(value, format as CertificateFormat);
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}) as Certificate;
|
||||||
|
if (cert) {
|
||||||
|
let certificateX509DER = '';
|
||||||
|
try {
|
||||||
|
certificateX509DER = Base64.fromUint8Array(cert.toBuffer('x509'));
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
|
||||||
|
return { values: getCertificateLabelValues(cert), certificateX509DER };
|
||||||
|
}
|
||||||
|
|
||||||
|
const csr = canParse(inputKeyOrCertificateValue, (value) => {
|
||||||
|
return forge.pki.certificationRequestFromPem(value.toString(), false, false);
|
||||||
|
}) as forge.pki.Certificate;
|
||||||
|
if (csr) {
|
||||||
|
return { values: getCSRLabelValues(csr) };
|
||||||
|
}
|
||||||
|
|
||||||
|
const fingerprint = canParse(inputKeyOrCertificateValue, value => parseFingerprint(value.toString())) as Fingerprint;
|
||||||
|
if (fingerprint) {
|
||||||
|
return { values: getFingerprintLabelValues(fingerprint) };
|
||||||
|
}
|
||||||
|
|
||||||
|
const signature = canParse(inputKeyOrCertificateValue, (value) => {
|
||||||
|
//
|
||||||
|
for (const algo of ['dsa', 'rsa', 'ecdsa', 'ed25519']) {
|
||||||
|
for (const format of ['asn1', 'ssh', 'raw']) {
|
||||||
|
try {
|
||||||
|
return parseSignature(value, algo as AlgorithmType, format as SignatureFormatType);
|
||||||
|
}
|
||||||
|
catch {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}) as Signature;
|
||||||
|
if (signature) {
|
||||||
|
return { values: getSignatureLabelValues(signature) };
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
values: [
|
||||||
|
{
|
||||||
|
label: 'Type:',
|
||||||
|
value: 'Unknown format or invalid passphrase',
|
||||||
|
}],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return {
|
||||||
|
values: [
|
||||||
|
{
|
||||||
|
label: 'Error:',
|
||||||
|
value: e.toString(),
|
||||||
|
}] as LabelValue[],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { Buffer } from 'node:buffer';
|
||||||
|
|
||||||
|
import { getKeyOrCertificateInfosAsync } from './certificate-key-parser.service';
|
||||||
|
import { type LabelValue } from './certificate-key-parser.infos';
|
||||||
|
import { useDownloadFileFromBase64 } from '@/composable/downloadBase64';
|
||||||
|
|
||||||
|
const inputKeyOrCertificate = ref('');
|
||||||
|
const passphrase = ref('');
|
||||||
|
const fileInput = ref() as Ref<Buffer>;
|
||||||
|
const inputType = ref<'file' | 'content'>('file');
|
||||||
|
|
||||||
|
async function onUpload(file: File) {
|
||||||
|
if (file) {
|
||||||
|
fileInput.value = Buffer.from(await file.arrayBuffer());
|
||||||
|
inputKeyOrCertificate.value = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const certificateX509DER = ref('');
|
||||||
|
const { download: downloadX509DER } = useDownloadFileFromBase64(
|
||||||
|
{
|
||||||
|
source: certificateX509DER,
|
||||||
|
extension: 'der',
|
||||||
|
});
|
||||||
|
|
||||||
|
function downloadX509DERFile() {
|
||||||
|
if (certificateX509DER.value === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
downloadX509DER();
|
||||||
|
}
|
||||||
|
catch (_) {
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsedSections = computedAsync<LabelValue[]>(async () => {
|
||||||
|
const inputContent = inputKeyOrCertificate.value;
|
||||||
|
const file = fileInput.value;
|
||||||
|
let inputKeyOrCertificateValue: string | Buffer = '';
|
||||||
|
if (inputType.value === 'file' && file) {
|
||||||
|
inputKeyOrCertificateValue = file;
|
||||||
|
}
|
||||||
|
else if (inputType.value === 'content' && inputContent) {
|
||||||
|
inputKeyOrCertificateValue = inputContent;
|
||||||
|
}
|
||||||
|
const { values, certificateX509DER: certPEM } = await getKeyOrCertificateInfosAsync(inputKeyOrCertificateValue, passphrase.value);
|
||||||
|
certificateX509DER.value = certPEM || '';
|
||||||
|
return values;
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<c-card>
|
||||||
|
<n-radio-group v-model:value="inputType" name="radiogroup" mb-2 flex justify-center>
|
||||||
|
<n-space>
|
||||||
|
<n-radio
|
||||||
|
value="file"
|
||||||
|
label="File"
|
||||||
|
/>
|
||||||
|
<n-radio
|
||||||
|
value="content"
|
||||||
|
label="Content"
|
||||||
|
/>
|
||||||
|
</n-space>
|
||||||
|
</n-radio-group>
|
||||||
|
|
||||||
|
<c-file-upload
|
||||||
|
v-if="inputType === 'file'"
|
||||||
|
title="Drag and drop a Certificate file here, or click to select a Certificate file"
|
||||||
|
@file-upload="onUpload"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<c-input-text
|
||||||
|
v-if="inputType === 'content'"
|
||||||
|
v-model:value="inputKeyOrCertificate"
|
||||||
|
label="Paste your Public Key / Private Key / Signature / Fingerprint / Certificate:"
|
||||||
|
placeholder="Your Public Key / Private Key / Signature / Fingerprint / Certificate..."
|
||||||
|
multiline
|
||||||
|
rows="8"
|
||||||
|
data-test-id="input"
|
||||||
|
/>
|
||||||
|
</c-card>
|
||||||
|
|
||||||
|
<c-input-text
|
||||||
|
v-model:value="passphrase"
|
||||||
|
label="Passphrase (for encrypted keys):"
|
||||||
|
placeholder="Passphrase (for encrypted keys)..."
|
||||||
|
type="password"
|
||||||
|
data-test-id="pass"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<n-divider />
|
||||||
|
|
||||||
|
<input-copyable
|
||||||
|
v-for="{ label, value, multiline } of parsedSections"
|
||||||
|
:key="label"
|
||||||
|
:label="label"
|
||||||
|
:data-test-id="label"
|
||||||
|
label-position="left"
|
||||||
|
label-width="100px"
|
||||||
|
label-align="right"
|
||||||
|
|
||||||
|
autosize mb-2
|
||||||
|
:multiline="multiline"
|
||||||
|
:value="value"
|
||||||
|
placeholder="Not Set"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<div v-if="certificateX509DER !== ''" flex justify-center>
|
||||||
|
<c-button @click="downloadX509DERFile()">
|
||||||
|
Download X509 DER certificate
|
||||||
|
</c-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { FileCertificate } from '@vicons/tabler';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'Certificate/Key parser',
|
||||||
|
path: '/certificate-key-parser',
|
||||||
|
description: 'Parse Key and Certificate',
|
||||||
|
keywords: ['certificate', 'key', 'parser'],
|
||||||
|
component: () => import('./certificate-key-parser.vue'),
|
||||||
|
icon: FileCertificate,
|
||||||
|
createdAt: new Date('2024-02-22'),
|
||||||
|
});
|
||||||
+15
-1
@@ -7,6 +7,7 @@ import { tool as bounceParser } from './bounce-parser';
|
|||||||
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
import { tool as asciiTextDrawer } from './ascii-text-drawer';
|
||||||
|
|
||||||
import { tool as textToUnicode } from './text-to-unicode';
|
import { tool as textToUnicode } from './text-to-unicode';
|
||||||
|
import { tool as certificateKeyParser } from './certificate-key-parser';
|
||||||
import { tool as safelinkDecoder } from './safelink-decoder';
|
import { tool as safelinkDecoder } from './safelink-decoder';
|
||||||
import { tool as xmlToJson } from './xml-to-json';
|
import { tool as xmlToJson } from './xml-to-json';
|
||||||
import { tool as jsonToXml } from './json-to-xml';
|
import { tool as jsonToXml } from './json-to-xml';
|
||||||
@@ -97,7 +98,20 @@ import { tool as barcodeGenerator } from './barcode-generator';
|
|||||||
export const toolsByCategory: ToolCategory[] = [
|
export const toolsByCategory: ToolCategory[] = [
|
||||||
{
|
{
|
||||||
name: 'Crypto',
|
name: 'Crypto',
|
||||||
components: [tokenGenerator, hashText, bcrypt, uuidGenerator, ulidGenerator, cypher, bip39, hmacGenerator, rsaKeyPairGenerator, passwordStrengthAnalyser, pdfSignatureChecker],
|
components: [
|
||||||
|
tokenGenerator,
|
||||||
|
hashText,
|
||||||
|
bcrypt,
|
||||||
|
uuidGenerator,
|
||||||
|
ulidGenerator,
|
||||||
|
cypher,
|
||||||
|
bip39,
|
||||||
|
hmacGenerator,
|
||||||
|
rsaKeyPairGenerator,
|
||||||
|
certificateKeyParser,
|
||||||
|
passwordStrengthAnalyser,
|
||||||
|
pdfSignatureChecker,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Converter',
|
name: 'Converter',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { resolve } from 'node:path';
|
import { resolve } from 'node:path';
|
||||||
import { URL, fileURLToPath } from 'node:url';
|
import { URL, fileURLToPath } from 'node:url';
|
||||||
|
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
||||||
|
|
||||||
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
import VueI18n from '@intlify/unplugin-vue-i18n/vite';
|
||||||
import vue from '@vitejs/plugin-vue';
|
import vue from '@vitejs/plugin-vue';
|
||||||
@@ -97,6 +98,7 @@ export default defineConfig({
|
|||||||
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: 'icon' })],
|
resolvers: [NaiveUiResolver(), IconsResolver({ prefix: 'icon' })],
|
||||||
}),
|
}),
|
||||||
Unocss(),
|
Unocss(),
|
||||||
|
nodePolyfills(),
|
||||||
],
|
],
|
||||||
base: baseUrl,
|
base: baseUrl,
|
||||||
resolve: {
|
resolve: {
|
||||||
|
|||||||
Reference in new issue
Block a user