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