
Add jsdoc @module definitions. Fix references to old class names. Make keyring a multiple instance module. Eliminate unit test dependency on running npm test.
1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v0.0.1 - 2013-12-21 */require=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);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.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}({fjvtDg:[function(a,b){b.exports=a("./keyring.js"),b.exports.localstore=a("./localstore.js")},{"./keyring.js":3,"./localstore.js":4}],keyring:[function(a,b){b.exports=a("fjvtDg")},{}],3:[function(a,b){var c=a("openpgp"),d=function(){function b(a,b){a=a.toLowerCase();for(var c,d=b.getUserIds();c<d.length;c++)if(keyEmail=d[c].split("<")[1].split(">")[0].trim().toLowerCase(),keyEmail==a)return!0;return!1}function d(a,b){for(var d=b.getKeyIds(),e=0;e<d.length;e++)if(c.util.hexstrdump(d[e].write())==a)return!0;return!1}function e(a,b,d,e){for(var f=[],g=0;g<a.length;g++){var h=a[g];switch(e){case c.enums.packet.public_key:h.isPublic()&&b(d,h)&&f.push(h);break;case c.enums.packet.private_key:h.isPrivate()&&b(d,h)&&f.push(h)}}return f}function f(a){return e(this.keys,b,a,c.enums.packet.secret_key)}function g(a){return this.checkForIdentityAndKeyTypeMatch(this.keys,d,a,c.enums.packet.public_key)}function h(a){return this.keys.push(c.key.readArmored(a)),!0}function i(a){return this.keys[a].armor()}function j(a){var b=this.keys.splice(a,1);return b}function k(a){return this.keys[a].toPublic().armor()}this.keys=[],this.init=function(b){if(!b){var c=a("./localstore.js");b=new c}this.storeHandler=b,this.keys=[],this.storeHandler.init(this.keys)},this.store=function(){this.storeHandler.store(this.keys)},this.checkForIdentityAndKeyTypeMatch=e,this.getPublicKeyForAddress=function(a){return e(this.keys,b,a,c.enums.packet.public_key)},this.getPrivateKeyForAddress=f,this.getKeysForKeyId=g,this.importKey=h,this.exportKey=i,this.removeKey=j,this.exportPublicKey=k};b.exports=d},{"./localstore.js":4}],4:[function(a,b){function c(){function a(a){var b=JSON.parse(window.localStorage.getItem("armoredKeys"));if(null!==b&&0===b.length)for(var c,e=0;e<b.length;e++)c=d.key.readArmored(b[e]),a.push(c);else this.keys=[]}function b(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].armor());window.localStorage.setItem("armoredKeys",JSON.stringify(b))}this.init=a,this.store=b}var d=a("openpgp");b.exports=c},{}]},{},[]); |