a
This commit is contained in:
@@ -32,8 +32,13 @@
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
11
encrypt.html
11
encrypt.html
@@ -24,12 +24,15 @@
|
||||
publicKeys: (await openpgp.key.readArmored(pubkey)).keys, // for encryption
|
||||
}
|
||||
|
||||
console.log(options);
|
||||
|
||||
openpgp.encrypt(options).then(ciphertext => {
|
||||
encrypted = ciphertext.data // '-----BEGIN PGP MESSAGE ... END PGP MESSAGE-----'
|
||||
document.getElementById("result").value = encrypted;
|
||||
document.getElementById("progressbar").className = "progress-bar bg-success";
|
||||
if (encrypted) {
|
||||
document.getElementById("result").value = encrypted;
|
||||
document.getElementById("progressbar").className = "progress-bar bg-success";
|
||||
} else {
|
||||
document.getElementById("result").value = 'Encryption failed.';
|
||||
document.getElementById("progressbar").className = "progress-bar bg-danger";
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user