Release new version

This commit is contained in:
Bart Butler 2017-11-06 13:46:54 -08:00
parent 58031cfaca
commit bee9928e54
6 changed files with 37 additions and 20 deletions

View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "2.5.12",
"version": "2.5.13",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"authors": [

37
dist/openpgp.js vendored
View File

@ -4841,7 +4841,7 @@ exports.default = {
tolerant: true, // ignore unsupported/unrecognizable packets instead of throwing an error
show_version: true,
show_comment: true,
versionstring: "OpenPGP.js v2.5.12",
versionstring: "OpenPGP.js v2.5.13",
commentstring: "https://openpgpjs.org",
keyserver: "https://keyserver.ubuntu.com",
node_store: './openpgp.store'
@ -13143,6 +13143,7 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.Key = Key;
exports.read = read;
exports.readArmored = readArmored;
exports.generate = generate;
exports.reformat = reformat;
@ -14179,24 +14180,20 @@ SubKey.prototype.update = function (subKey, primaryKey) {
};
/**
* Reads an OpenPGP armored text and returns one or multiple key objects
* @param {String} armoredText text to be parsed
* Reads an unarmored OpenPGP key list and returns one or multiple key objects
* @param {Uint8Array} data to be parsed
* @return {{keys: Array<module:key~Key>, err: (Array<Error>|null)}} result object with key and error arrays
* @static
*/
function readArmored(armoredText) {
function read(data) {
var result = {};
result.keys = [];
try {
var input = _armor2.default.decode(armoredText);
if (!(input.type === _enums2.default.armor.public_key || input.type === _enums2.default.armor.private_key)) {
throw new Error('Armored text not of type key');
}
var packetlist = new _packet2.default.List();
packetlist.read(input.data);
packetlist.read(data);
var keyIndex = packetlist.indexOfTag(_enums2.default.packet.publicKey, _enums2.default.packet.secretKey);
if (keyIndex.length === 0) {
throw new Error('No key packet found in armored text');
throw new Error('No key packet found');
}
for (var i = 0; i < keyIndex.length; i++) {
var oneKeyList = packetlist.slice(keyIndex[i], keyIndex[i + 1]);
@ -14215,6 +14212,26 @@ function readArmored(armoredText) {
return result;
}
/**
* Reads an OpenPGP armored text and returns one or multiple key objects
* @param {String} armoredText text to be parsed
* @return {{keys: Array<module:key~Key>, err: (Array<Error>|null)}} result object with key and error arrays
* @static
*/
function readArmored(armoredText) {
try {
var input = _armor2.default.decode(armoredText);
if (!(input.type === _enums2.default.armor.public_key || input.type === _enums2.default.armor.private_key)) {
throw new Error('Armored text not of type key');
}
return read(input.data);
} catch (e) {
var result = { keys: [], err: [] };
result.err.push(e);
return result;
}
}
/**
* Generates a new OpenPGP key. Currently only supports RSA keys.
* Primary and subkey will be of same type.

12
dist/openpgp.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
/*! OpenPGP.js v2.5.12 - 2017-10-10 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a){for(var b in a)h.config[b]=a[b]}function e(a){a instanceof Uint8Array||(a=new Uint8Array(a)),h.crypto.random.randomBuffer.set(a)}function f(a,b,c){return"function"!=typeof h[b]?void g({id:a,event:"method-return",err:"Unknown Worker Event"}):(c=h.packet.clone.parseClonedPackets(c,b),void h[b](c).then(function(b){g({id:a,event:"method-return",data:h.packet.clone.clonePackets(b)})})["catch"](function(b){g({id:a,event:"method-return",err:b.message})}))}function g(a){h.crypto.random.randomBuffer.size<i&&self.postMessage({event:"request-seed"}),self.postMessage(a,h.util.getTransferables.call(h.util,a.data))}self.window={},importScripts("openpgp.min.js");var h=window.openpgp,i=4e4,j=6e4;h.crypto.random.randomBuffer.init(j),self.onmessage=function(a){var b=a.data||{};switch(b.event){case"configure":d(b.config);break;case"seed-random":e(b.buf);break;default:f(b.id,b.event,b.options||{})}}},{}]},{},[1]);
/*! OpenPGP.js v2.5.13 - 2017-11-06 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){function d(a){for(var b in a)h.config[b]=a[b]}function e(a){a instanceof Uint8Array||(a=new Uint8Array(a)),h.crypto.random.randomBuffer.set(a)}function f(a,b,c){return"function"!=typeof h[b]?void g({id:a,event:"method-return",err:"Unknown Worker Event"}):(c=h.packet.clone.parseClonedPackets(c,b),void h[b](c).then(function(b){g({id:a,event:"method-return",data:h.packet.clone.clonePackets(b)})})["catch"](function(b){g({id:a,event:"method-return",err:b.message})}))}function g(a){h.crypto.random.randomBuffer.size<i&&self.postMessage({event:"request-seed"}),self.postMessage(a,h.util.getTransferables.call(h.util,a.data))}self.window={},importScripts("openpgp.min.js");var h=window.openpgp,i=4e4,j=6e4;h.crypto.random.randomBuffer.init(j),self.onmessage=function(a){var b=a.data||{};switch(b.event){case"configure":d(b.config);break;case"seed-random":e(b.buf);break;default:f(b.id,b.event,b.options||{})}}},{}]},{},[1]);

2
npm-shrinkwrap.json generated
View File

@ -1,6 +1,6 @@
{
"name": "openpgp",
"version": "2.5.12",
"version": "2.5.13",
"dependencies": {
"asmcrypto-lite": {
"version": "1.1.0",

View File

@ -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.5.12",
"version": "2.5.13",
"license": "LGPL-3.0+",
"homepage": "http://openpgpjs.org/",
"engines": {