forked from Zimbra-Community/pgp-zimlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
encrypt-test1.html
82 lines (73 loc) · 5.64 KB
/
encrypt-test1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http:https://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OpenPGP.js - Encrypt test for Zimbra OpenPGP Zimlet</title>
<script src="scripts/openpgp.js"></script>
</head>
<body>
<h1>OpenPGP.js - Encrypt test for Zimbra OpenPGP Zimlet</h1>
<textarea id="message" rows="20" cols="100">Et non cursus praesent et placerat. Amet urna facilisis sed sed tempor. Molestie dui eros. Enim at tincidunt integer magna vitae sit elit ultrices. Sit diam eget amet posuere pellentesque.
Urna venenatis eu. Potenti arcu nullam. Lacus ullamcorper adipiscing ac et nullam a vitae pede eleifend exercitation nec at et dignissim id saepe ante elit ligula dolor. Neque amet vivamus proin officia maecenas ad sit magna. A pulvinar dapibus ipsum orci tempor. Conubia nec in vivamus rhoncus sed. Vel sed posuere. Nulla phasellus vulputate posuere tincidunt interdum. Fusce vulputate dolor. Amet nibh suspendisse rutrum lacus rhoncus. Nulla ante risus nam nunc ornare. Diam tempor aliquam ipsum etiam a. Vel bibendum mauris erat nullam sollicitudin. Eget diam penatibus. Phasellus pellentesque pede orci wisi auctor. Eu in dolor nunc quis euismod massa congue et. Cras ipsum morbi nisl sed volutpat. Justo egestas suspendisse. Dolor id nec. Faucibus cursus suspendisse et a ante. Id adipiscing maecenas. Eros laoreet nascetur in fusce vel morbi non donec cras et eros ullamcorper id vel. Sed amet tincidunt. Sit etiam nulla in justo a. Dignissim lacinia morbi. Porttitor tristique facilisis volutpat mus magna in massa lacus. Lectus ac aliquet. Quam id porttitor consectetuer donec a quis urna vestibulum. Rutrum imperdiet et vel taciti fringilla. Integer tortor mauris.
Congue imperdiet arcu. Et scelerisque consequat. Ac metus pellentesque placerat orci aliquam. Congue suspendisse duis integer pellentesque lectus. Pellentesque at pellentesque. Varius ut faucibus. Dui magnis nullam ante tincidunt tellus. Vehicula massa vel nullam ac sagittis quis ullamcorper eu eros quisque etiam ut elit porttitor. Pede praesent venenatis. Ultricies nisl laoreet a dis integer. Non vestibulum neque. Posuere nibh aenean quae et nec egestas nulla diam praesent suspendisse tellus habitant justo risus nibh semper scelerisque pharetra aptent aliquet. Per nulla sit. Tellus nec ut dictum eleifend eu. Accumsan venenatis arcu.</textarea>
<textarea id="output" rows="20" cols="100"></textarea>
<script type="text/javascript">
var openpgp = window.openpgp;
var key = '-----BEGIN PGP PUBLIC KEY BLOCK-----\n' +
'Version: GnuPG v1\n' +
'\n' +
'mQENBFNaGZsBCACor4dD3KIG5Ndj4Lj/AJahrFYagYvLvQbFjU+IUNyHsxmEAqJs\n' +
'yZJKNQNU41F21VWrvJsiUlyztcuAXmCaJIwKawXFUhyojgTKbMz1o3SBMpUP2S8+\n' +
'F9iUMN/Z5+2+OA941fD2dfeHVC+8cKBDrajMjPzELQN4WzFWLkzxjtb8lAbnO90b\n' +
'zkXtGfghKDHViMxbDBBx1xHqLirVUk1SZVM4/jpaiK4XteT/O3SLjy4INOf8QQeA\n' +
'DHKkRbJNRUwIGligkCu337ufMBbxKlLpgWDyKL4cOqSaQ5xMjN40eZcAmt4gIvg7\n' +
'WwaSbldjVoTkpjmPcXayJo/FXHH/aQHKuEr9ABEBAAG0dlppbWJyYSBPcGVuUEdQ\n' +
'IFppbWxldCBURVNUIEtFWSAob25seSB1c2UgZm9yIHRlc3RpbmcgcHVycG9zZSBO\n' +
'T1QgU0VDVVJFISEpIDxwbGVhc2UtdXNlLWZvci10ZXN0aW5nLW9ubHlAb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/HzlUR3SARUON7xhKjKoqJCtdmkSGR0kSa13VdFpbF0i26FVWIurTm3YVg\n' +
'I2bJ8sl48d7fRR6GakGmTC9bw1EaFgovWFq6z3GKbxF7JvICt9svfqktf4EDGEfS\n' +
'y4H4yZ0xkCM+LsseQGOtcloPpgoyTVvN7Qd41cCXUKV2P3ZN1j0d4YPwckz2n3xy\n' +
'8p6Oio6x2QfjcWJQ4/HA44RXPni3\n' +
'=ldYW\n' +
'-----END PGP PUBLIC KEY BLOCK-----';
options = {
data: document.getElementById('message').value, // input as string
publicKeys: openpgp.key.readArmored(key).keys, // for encryption
armor: true // ASCII armor
};
openpgp.encrypt(options).then(function (message) {
console.log(message.data);
document.getElementById('output').value = message.data;
});
</script>
<pre>
This file is part of the Zimbra OpenPGP Zimlet project.
Copyright (C) 2014-2016 Barry de Graaff
Bugs and feedback: https://github.com/Zimbra-Community/pgp-zimlet/issues
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http:https://www.gnu.org/licenses/.
</pre>
</body>
</html>