lib0 0.2.90 → 0.2.91
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/bin/0ecdsa-generate-keypair.d.ts +2 -0
- package/bin/0ecdsa-generate-keypair.d.ts.map +1 -0
- package/bin/0ecdsa-generate-keypair.js +14 -0
- package/coverage/tmp/coverage-151987-1709590293199-0.json +1 -0
- package/crypto/jwt.d.ts.map +1 -1
- package/crypto/jwt.js +6 -1
- package/crypto.test.d.ts.map +1 -1
- package/dist/bin/0ecdsa-generate-keypair.d.ts +2 -0
- package/dist/bin/0ecdsa-generate-keypair.d.ts.map +1 -0
- package/dist/crypto/jwt.d.ts.map +1 -1
- package/dist/crypto.test.d.ts.map +1 -1
- package/dist/jwt.cjs +7 -1
- package/dist/jwt.cjs.map +1 -1
- package/package.json +3 -2
- package/coverage/tmp/coverage-32666-1709126826050-0.json +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0ecdsa-generate-keypair.d.ts","sourceRoot":"","sources":["0ecdsa-generate-keypair.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as ecdsa from 'lib0/crypto/ecdsa'
|
|
2
|
+
import * as json from 'lib0/json'
|
|
3
|
+
import * as env from 'lib0/environment'
|
|
4
|
+
|
|
5
|
+
const prefix = env.getConf('name')
|
|
6
|
+
|
|
7
|
+
const keypair = await ecdsa.generateKeyPair({ extractable: true })
|
|
8
|
+
const privateJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.privateKey))
|
|
9
|
+
const publicJwk = json.stringify(await ecdsa.exportKeyJwk(keypair.publicKey))
|
|
10
|
+
|
|
11
|
+
console.log(`
|
|
12
|
+
${prefix ? prefix.toUpperCase() + '_' : ''}PUBLIC="${publicJwk.replaceAll('"', '\\"')}"
|
|
13
|
+
${prefix ? prefix.toUpperCase() + '_' : ''}PRIVATE="${privateJwk.replaceAll('"', '\\"')}"
|
|
14
|
+
`)
|