registry-signer Package
Installation
npm install @openbotauth/registry-signerQuick Start
import {
generateEd25519KeyPair,
publicKeyToJwk,
privateKeyToJwk,
createJwks
} from '@openbotauth/registry-signer';
// Generate a new Ed25519 key pair
const keyPair = await generateEd25519KeyPair();
// Export public key as JWK (for registration)
const publicJwk = await publicKeyToJwk(keyPair.publicKey, 'my-key-id');
// Export private key as JWK (for signing - keep secure!)
const privateJwk = await privateKeyToJwk(keyPair.privateKey, 'my-key-id');
// Create a JWKS containing your public key
const jwks = await createJwks([publicJwk]);
console.log(JSON.stringify(jwks, null, 2));API Reference
Key Generation
generateEd25519KeyPair()
generateEd25519KeyPair()JWK Conversion
publicKeyToJwk(publicKey, keyId?)
publicKeyToJwk(publicKey, keyId?)privateKeyToJwk(privateKey, keyId?)
privateKeyToJwk(privateKey, keyId?)JWKS Creation
createJwks(keys)
createJwks(keys)Base64 Utilities
base64UrlEncode(data)
base64UrlEncode(data)base64UrlDecode(str)
base64UrlDecode(str)Hosting Your JWKS
Option 1: Static File
Option 2: Dynamic Endpoint
Security Considerations
TypeScript Support
Browser Compatibility
Source Code
Last updated