in src/crypto.ts [21:41]
export async function generateKeys(): Promise<RSAKeys> {
const crypto = await cryptoModule();
const keygen = promisify(crypto.generateKeyPair);
const {privateKey, publicKey} = await keygen('rsa', {
modulusLength: 2048,
privateKeyEncoding: {
type: 'pkcs1',
format: 'pem',
},
publicKeyEncoding: {
type: 'spki',
format: 'pem',
},
});
return {
privateKey,
publicKey,
};
}