feat: add tests
Some checks failed
TrafficCue Server CI / check (push) Has been cancelled

This commit is contained in:
2025-08-30 10:12:20 +02:00
parent 03e602c814
commit 390594bb39
8 changed files with 541 additions and 59 deletions

13
test/keys.ts Normal file
View 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 };
}