feat: update publickey.ts
This commit is contained in:
@@ -13,15 +13,15 @@
|
|||||||
},
|
},
|
||||||
"print-env.ts": {
|
"print-env.ts": {
|
||||||
"script_name": "print-env.ts",
|
"script_name": "print-env.ts",
|
||||||
"script_length": 154,
|
"script_length": 156,
|
||||||
"script_sha256": "60236017ab2b448bf830fbcca63de7017fcf9462d91af16649ed6b49f516d24e",
|
"script_sha256": "b77d1b8c5ee91ef83e7b1bb72851f6a8f6ed4b0c4ab811fe62f24eebab72149a",
|
||||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/print-env.ts",
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/print-env.ts",
|
||||||
"single_script_file": true
|
"single_script_file": true
|
||||||
},
|
},
|
||||||
"publickey.ts": {
|
"publickey.ts": {
|
||||||
"script_name": "publickey.ts",
|
"script_name": "publickey.ts",
|
||||||
"script_length": 1530,
|
"script_length": 1572,
|
||||||
"script_sha256": "ffd1181afb7bbc9cf0f45c2617dc956d4d363fd893456ad0ebc03fc63bab64ad",
|
"script_sha256": "7910b0d8c727a5d8cefa0174d19b0e6e7925dc3960dbe3625735f4a55f7180e2",
|
||||||
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/publickey.ts",
|
"script_full_url": "https://git.hatter.ink/hatter/ts-scripts/raw/branch/main/single-scripts/publickey.ts",
|
||||||
"single_script_file": true
|
"single_script_file": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
|
|
||||||
const envs = Deno.env.toObject();
|
const envs = Deno.env.toObject();
|
||||||
|
|
||||||
for (let envKey in envs) {
|
for (const envKey in envs) {
|
||||||
console.log(`${envKey} --> ${envs[envKey]}`);
|
console.log(`${envKey} --> ${envs[envKey]}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ if (Deno.args.length === 0) {
|
|||||||
// console.log(x509.publicKey.export({format: "pem", type: "spki"}));
|
// 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:');
|
console.log('JWK:');
|
||||||
const exportedJwk = publicKey.export({format: "jwk"});
|
const exportedJwk = publicKey.export({format: "jwk"});
|
||||||
console.log(JSON.stringify(exportedJwk, null, 4));
|
console.log(JSON.stringify(exportedJwk, null, 4));
|
||||||
@@ -42,7 +43,7 @@ try {
|
|||||||
const publicKey = createPublicKey({key, format: "jwk"});
|
const publicKey = createPublicKey({key, format: "jwk"});
|
||||||
printPublicKey(publicKey);
|
printPublicKey(publicKey);
|
||||||
Deno.exit(0);
|
Deno.exit(0);
|
||||||
} catch (e) {
|
} catch (_e) {
|
||||||
// IGNORE
|
// IGNORE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user