diff --git a/lang/js/DemoExtension/maindemo.js b/lang/js/DemoExtension/maindemo.js index 97a27f60..b472bcc8 100644 --- a/lang/js/DemoExtension/maindemo.js +++ b/lang/js/DemoExtension/maindemo.js @@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function () { function (){ let data = document.getElementById('inputtext').value; let keyId = document.getElementById('pubkey').value; - gpgmejs.encrypt({ data: data, privateKeys: keyId }).then( + gpgmejs.encrypt({ data: data, publicKeys: keyId, armor:false }).then( function (answer){ if (answer.data){ document.getElementById( diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js index 08f80fc2..295cc043 100644 --- a/lang/js/src/gpgmejs.js +++ b/lang/js/src/gpgmejs.js @@ -154,8 +154,12 @@ export class GpgME { if (msg instanceof Error){ return Promise.reject(msg); } - msg.setParameter('armor', armor); - + if (armor === false){ + msg.setParameter('armor', false); + msg.expected = 'base64'; + } else if (armor === true) { + msg.setParameter('armor', true); + } if (base64 === true) { msg.setParameter('base64', true); }