Commit c1e9bcea authored by Medicean's avatar Medicean

(Fix:RSA) fix #155

parent 834063ac
......@@ -65,8 +65,14 @@ class Base {
*/
rsaEncrypt() {
let key = new NodeRSA();
let priKey = fs.readFileSync(path.join(remote.process.env.AS_WORKDIR, `antData/key_rsa`));
key.importKey(priKey.toString(), 'private');
try{
let priKey = fs.readFileSync(path.join(remote.process.env.AS_WORKDIR, `antData/key_rsa`));
if(priKey.length > 0){
key.importKey(priKey.toString(), 'private');
}
}catch(e) {
}
return key;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment