feat: update publickey.ts

This commit is contained in:
2025-01-19 01:12:37 +08:00
parent 52ffab9f2b
commit ab9edbb4fd
3 changed files with 8 additions and 7 deletions

View File

@@ -13,15 +13,15 @@
},
"print-env.ts": {
"script_name": "print-env.ts",
"script_length": 154,
"script_sha256": "60236017ab2b448bf830fbcca63de7017fcf9462d91af16649ed6b49f516d24e",
"script_length": 156,
"script_sha256": "b77d1b8c5ee91ef83e7b1bb72851f6a8f6ed4b0c4ab811fe62f24eebab72149a",
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/print-env.ts",
"single_script_file": true
},
"publickey.ts": {
"script_name": "publickey.ts",
"script_length": 1530,
"script_sha256": "ffd1181afb7bbc9cf0f45c2617dc956d4d363fd893456ad0ebc03fc63bab64ad",
"script_length": 1572,
"script_sha256": "7910b0d8c727a5d8cefa0174d19b0e6e7925dc3960dbe3625735f4a55f7180e2",
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/publickey.ts",
"single_script_file": true
},

View File

@@ -2,6 +2,6 @@
const envs = Deno.env.toObject();
for (let envKey in envs) {
for (const envKey in envs) {
console.log(`${envKey} --> ${envs[envKey]}`);
}

View File

@@ -21,7 +21,8 @@ if (Deno.args.length === 0) {
// console.log(x509.publicKey.export({format: "pem", type: "spki"}));
// }
function printPublicKey(publicKey) {
// deno-lint-ignore no-explicit-any
function printPublicKey(publicKey: any) {
console.log('JWK:');
const exportedJwk = publicKey.export({format: "jwk"});
console.log(JSON.stringify(exportedJwk, null, 4));
@@ -42,7 +43,7 @@ try {
const publicKey = createPublicKey({key, format: "jwk"});
printPublicKey(publicKey);
Deno.exit(0);
} catch (e) {
} catch (_e) {
// IGNORE
}