first commit
This commit is contained in:
15
scripts/prepare-private-key.js
Normal file
15
scripts/prepare-private-key.js
Normal file
@ -0,0 +1,15 @@
|
||||
/* eslint-env node */
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const RSA = require('node-rsa');
|
||||
|
||||
const key = new RSA({ b: 1024 });
|
||||
const privateKey = key.exportKey('pkcs1-private');
|
||||
const privateKeyFile = './private.ppk';
|
||||
|
||||
if (!fs.existsSync(privateKeyFile)) {
|
||||
fs.writeFile(privateKeyFile, privateKey, (err) => {
|
||||
err && console.error(err);
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user