Files
opencode-krates-connector/client/node_modules/lib0/bin/0ecdsa-generate-keypair.js
Hermes Agent 6bc05a76b0 fix: Resolve TypeScript errors
Signed-off-by: Hermes Agent <hermes@nosuchhost>
2026-06-16 09:01:21 -04:00

16 lines
553 B
JavaScript
Executable File

#!/usr/bin/env node
import * as ecdsa from 'lib0/crypto/ecdsa'
import * as json from 'lib0/json'
import * as env from 'lib0/environment'
const prefix = env.getConf('name')
const keypair = await ecdsa.generateKeyPair({ extractable: true })
const privateJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.privateKey))
const publicJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.publicKey))
console.log(`
${prefix ? prefix.toUpperCase() + '_' : ''}PUBLIC_KEY=${publicJwk}
${prefix ? prefix.toUpperCase() + '_' : ''}PRIVATE_KEY=${privateJwk}
`)