This commit is contained in:
unknown
2018-11-12 16:54:19 +00:00
parent c5b3c7f274
commit 0b538416e9
5 changed files with 59 additions and 45 deletions

View File

@@ -22,6 +22,7 @@
const encrypted = document.getElementById("pgpMsg").value
const privKeyObj = (await openpgp.key.readArmored(privkey)).keys[0]
if (passphrase) {
await privKeyObj.decrypt(passphrase)
}
@@ -32,14 +33,12 @@
}
openpgp.decrypt(options).then(plaintext => {
if (plaintext.data) {
document.getElementById("result").value = plaintext.data;
document.getElementById("progressbar").className = "progress-bar bg-success";
} else {
document.getElementById("result").value = 'Error decrypting message.';
document.getElementById("progressbar").className = "progress-bar bg-danger";
}
})
document.getElementById("result").value = plaintext.data;
document.getElementById("progressbar").className = "progress-bar bg-success";
}).catch(function(error){
document.getElementById("result").value = error.message;
document.getElementById("progressbar").className = "progress-bar bg-danger";
});
}
</script>
<style>