Merge branch 'master' of https://github.com/BrowserPGP/BrowserPGP.github.io
This commit is contained in:
17
encrypt.html
17
encrypt.html
@@ -1,7 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>browserPGP | Encrypt</title>
|
||||
<meta name="description" content="Encrypt PGP in browser, simple and secure.">
|
||||
<meta name="description" content="Encrypt PGP in browser, simple and secure." />
|
||||
<meta name="keywords" content="browserPGP,PGP,OpenPGP,online,browser,javascript,github,live,secure,key generator,key gen,encrypt,decrypt,sign,verify,signature">
|
||||
<meta name="author" content="ar0n#1462">
|
||||
|
||||
@@ -20,15 +20,9 @@
|
||||
// put keys in backtick (``) to avoid errors caused by spaces or tabs
|
||||
const pubkey = document.getElementById("pubKey").value
|
||||
|
||||
let options;
|
||||
try {
|
||||
options = {
|
||||
message: openpgp.message.fromText(document.getElementById("text").value), // input as Message object
|
||||
publicKeys: (await openpgp.key.readArmored(pubkey)).keys, // for encryption
|
||||
}
|
||||
} catch (err) {
|
||||
document.getElementById("result").value = err.message;
|
||||
document.getElementById("progressbar").className = "progress-bar bg-danger";
|
||||
const options = {
|
||||
message: openpgp.message.fromText(document.getElementById("text").value), // input as Message object
|
||||
publicKeys: (await openpgp.key.readArmored(pubkey).catch((err) => {document.getElementById("result").value = err.message;document.getElementById("progressbar").className = "progress-bar bg-danger";})).keys, // for encryption
|
||||
}
|
||||
|
||||
openpgp.encrypt(options).then(ciphertext => {
|
||||
@@ -62,6 +56,9 @@
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/gen.html">Key Generator</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user