This commit is contained in:
13
test/keys.ts
Normal file
13
test/keys.ts
Normal file
@ -0,0 +1,13 @@
|
||||
import { exportJWK, exportPKCS8, generateKeyPair } from "jose";
|
||||
|
||||
export async function createTestKey() {
|
||||
const { publicKey, privateKey } = await generateKeyPair("RS256", {
|
||||
extractable: true
|
||||
});
|
||||
const jwk = await exportJWK(publicKey);
|
||||
jwk.kid = "test-key";
|
||||
jwk.alg = "RS256";
|
||||
|
||||
const pem = await exportPKCS8(privateKey);
|
||||
return { jwk, pem };
|
||||
}
|
||||
Reference in New Issue
Block a user