Remove keyring from openpgp namespace. Optimize keyid initialization.

This commit is contained in:
Thomas Oberndörfer 2013-10-24 12:19:46 +02:00
parent b544343c63
commit 1be6b8b858
6 changed files with 70 additions and 254 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,6 @@
module.exports = require('./openpgp.js');
module.exports.key = require('./key.js');
module.exports.keyring = require('./keyring.js');
module.exports.message = require('./message.js');
module.exports.util = require('./util');
module.exports.packet = require('./packet');

View File

@ -27,11 +27,15 @@ var util = require('../util');
*/
module.exports = function keyid() {
this.bytes = '';
// initialize keyid with 0x0000000000000000
var strArray = [];
var zero = String.fromCharCode(0);
for (var i = 0; i < 8; i++) {
this.bytes += String.fromCharCode(0);
strArray[i] = zero;
}
this.bytes = strArray.join('');
/**
* Parsing method for a key id
* @param {String} input Input to read the key id from

View File

@ -2,7 +2,7 @@ var unit = require('../unit.js');
unit.register("Testing of binary signature checking", function() {
var openpgp = require('../../');
var keyring = openpgp.keyring;
var keyring = require('../../src/keyring.js');
var result = [];
var priv_key = openpgp.key.readArmored([
'-----BEGIN PGP PRIVATE KEY BLOCK-----',

View File

@ -2,7 +2,6 @@ var unit = require('../unit.js');
unit.register("Key generation/encryption/decryption", function() {
var openpgp = require('../../');
var keyring = openpgp.keyring;
var result = [];
var testHelper = function(passphrase, userid, message) {
var key = openpgp.generateKeyPair(openpgp.enums.publicKey.rsa_encrypt_sign, 512,

File diff suppressed because one or more lines are too long