Commit 7d1cda51 authored by Kamron Aroonrua's avatar Kamron Aroonrua 💬

pgp

parent e720b6ac
...@@ -60,7 +60,7 @@ function perform_function(context,request,response){ ...@@ -60,7 +60,7 @@ function perform_function(context,request,response){
if (['decrypt','dec'].indexOf(req_function) >= 0){ if (['decrypt','dec'].indexOf(req_function) >= 0){
pgplib.decrypt({ pgplib.decrypt({
privatekey : req_privatekey, private_key : req_privatekey,
passphrase : req_passphrase, passphrase : req_passphrase,
armor_in : (typeof data == 'string'), armor_in : (typeof data == 'string'),
data : data data : data
...@@ -72,14 +72,12 @@ function perform_function(context,request,response){ ...@@ -72,14 +72,12 @@ function perform_function(context,request,response){
dout = d.toString('base64'); dout = d.toString('base64');
} }
ok_out(d); ok_out(d);
}) }).catch(e =>{
/*
.catch(e =>{
error_out('decrypt error'); error_out('decrypt error');
})*/ })
} else if (['encrypt','enc'].indexOf(req_function) >= 0){ } else if (['encrypt','enc'].indexOf(req_function) >= 0){
pgplib.encrypt({ pgplib.encrypt({
publickey : req_publickey, public_key : req_publickey,
armor_out : (['armor','text'].indexOf(req_output) >= 0), armor_out : (['armor','text'].indexOf(req_output) >= 0),
data : data data : data
}).then(d => { }).then(d => {
......
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