-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerateKey.html
More file actions
23 lines (22 loc) · 927 Bytes
/
generateKey.html
File metadata and controls
23 lines (22 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<html>
<head>
<meta charset="utf-8">
<title>OpenPGPJS keygen</title>
<script src="openpgp.js"></script>
</head>
<body>
<script>
var options = {
userIds: [{ name:'Jack Man', email:'jack@example.com' }], // multiple user IDs
numBits: 512//, // RSA key size
//passphrase: 'Secretpass' // protects the private key
};
openpgp.generateKey(options).then(function(key) {
var privkey = key.privateKeyArmored; // '-----BEGIN PGP PRIVATE KEY BLOCK ... '
var pubkey = key.publicKeyArmored; // '-----BEGIN PGP PUBLIC KEY BLOCK ... '
console.log("My private key:\n\n" + privkey + "\n\n");
console.log("My public key:\n\n" + pubkey + "\n\n");
});
</script>
</body>
</html>