Skip to content

Commit

Permalink
Release new version
Browse files Browse the repository at this point in the history
  • Loading branch information
tanx committed May 3, 2016
1 parent 9c76df7 commit ceee85e
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "2.2.2",
"version": "2.3.0",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"authors": [
Expand Down
20 changes: 19 additions & 1 deletion dist/openpgp.js
Original file line number Diff line number Diff line change
Expand Up @@ -4773,7 +4773,7 @@ exports.default = {
debug: false,
show_version: true,
show_comment: true,
versionstring: "OpenPGP.js v2.2.2",
versionstring: "OpenPGP.js v2.3.0",
commentstring: "http://openpgpjs.org",
keyserver: "https://keyserver.ubuntu.com",
node_store: './openpgp.store'
Expand Down Expand Up @@ -13422,6 +13422,22 @@ Key.prototype.getEncryptionKeyPacket = function () {
return null;
};

/**
* Encrypts all secret key and subkey packets
* @param {String} passphrase
*/
Key.prototype.encrypt = function (passphrase) {
if (!this.isPrivate()) {
throw new Error("Nothing to encrypt in a public key");
}

var keys = this.getAllKeyPackets();
for (var i = 0; i < keys.length; i++) {
keys[i].encrypt(passphrase);
keys[i].clearPrivateMPIs();
}
};

/**
* Decrypts all secret key and subkey packets
* @param {String} passphrase
Expand Down Expand Up @@ -14013,12 +14029,14 @@ function generate(options) {
signaturePacket.hashAlgorithm = _config2.default.prefer_hash_algorithm;
signaturePacket.keyFlags = [_enums2.default.keyFlags.certify_keys | _enums2.default.keyFlags.sign_data];
signaturePacket.preferredSymmetricAlgorithms = [];
// prefer aes256, aes128, then aes192 (no WebCrypto support: https://www.chromium.org/blink/webcrypto#TOC-AES-support)
signaturePacket.preferredSymmetricAlgorithms.push(_enums2.default.symmetric.aes256);
signaturePacket.preferredSymmetricAlgorithms.push(_enums2.default.symmetric.aes128);
signaturePacket.preferredSymmetricAlgorithms.push(_enums2.default.symmetric.aes192);
signaturePacket.preferredSymmetricAlgorithms.push(_enums2.default.symmetric.cast5);
signaturePacket.preferredSymmetricAlgorithms.push(_enums2.default.symmetric.tripledes);
signaturePacket.preferredHashAlgorithms = [];
// prefer fast asm.js implementations (SHA-256, SHA-1)
signaturePacket.preferredHashAlgorithms.push(_enums2.default.hash.sha256);
signaturePacket.preferredHashAlgorithms.push(_enums2.default.hash.sha1);
signaturePacket.preferredHashAlgorithms.push(_enums2.default.hash.sha512);
Expand Down
10 changes: 5 additions & 5 deletions dist/openpgp.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/openpgp.worker.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "openpgp",
"description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.",
"version": "2.2.2",
"version": "2.3.0",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"engines": {
Expand Down

0 comments on commit ceee85e

Please sign in to comment.