mirror of
https://github.com/openpgpjs/openpgpjs.git
synced 2025-03-30 15:08:32 +00:00
Merge pull request #149 from Robert-Nelson/example
Update example to work with current code
This commit is contained in:
commit
c8ced71f5f
@ -1,9 +1,8 @@
|
|||||||
function encrypt() {
|
function encrypt() {
|
||||||
if (window.crypto.getRandomValues) {
|
if (window.crypto.getRandomValues) {
|
||||||
require("./openpgp.min.js");
|
require("./openpgp.min.js");
|
||||||
openpgp.init();
|
var pub_key = openpgp.key.readArmored($('#pubkey').text());
|
||||||
var pub_key = openpgp.read_publicKey($('#pubkey').text());
|
$('#message').val(openpgp.encryptMessage(pub_key.keys,$('#message').val()));
|
||||||
$('#message').val(openpgp.write_encrypted_message(pub_key,$('#message').val()));
|
|
||||||
window.alert("This message is going to be sent:\n" + $('#message').val());
|
window.alert("This message is going to be sent:\n" + $('#message').val());
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
18
example/jquery.min.js
vendored
Normal file
18
example/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user