const crypto = require('crypto')
const fs = require('fs')
const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
modulusLength: 2048,
})
fs.writeFileSync('private_test_n1.pem', privateKey.export({
type: 'pkcs1',
format: 'pem',
}))
fs.writeFileSync('public_test_n1.pem', publicKey.export({
type: 'pkcs1',
format: 'pem',
}))
Created
November 16, 2021 10:58
-
-
Save nkhil/68b0aa8477624382540e6c3ea7650451 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment