fedipage/generateKeys.mts
Jeffrey Phillips Freeman 1420bd21f5
Added soem debugging output
2023-10-11 11:35:52 -04:00

20 lines
422 B
TypeScript

import { promisify } from 'util';
import { generateKeyPair } from 'crypto';
const generateKeyPairAsync = promisify(generateKeyPair);
const pair = await generateKeyPairAsync('rsa', {
modulusLength: 4096,
publicKeyEncoding: {
type: 'spki',
format: 'pem'
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem'
}
})
console.log(pair.publicKey.toString());
console.log(pair.privateKey.toString());