generate SSH key for PuTTY with NodeJS

node v10.24.1
version: 2.0.0
endpointsharetweet
const crypto = require('crypto'); const util = require('util'); const generateKeyPairAsync = util.promisify(crypto.generateKeyPair); const keys = await generateKeyPairAsync('rsa', { modulusLength: 2048, privateKeyEncoding: { cipher: 'aes256', format: 'pem', passphrase: 'Pa$w0rd', type: 'pkcs8', }, publicKeyEncoding: { format: 'pem', type: 'pkcs1', }, }); console.log(keys.privateKey);
Loading…

no comments

    sign in to comment