diff --git a/src/cleartext.js b/src/cleartext.js index 99450b5a..a43823f6 100644 --- a/src/cleartext.js +++ b/src/cleartext.js @@ -35,8 +35,8 @@ import { createVerificationObjects, createSignaturePackets } from './message'; * @class * @classdesc Class that represents an OpenPGP cleartext signed message. * See {@link https://tools.ietf.org/html/rfc4880#section-7} - * @param {String} text The cleartext of the signed message - * @param {module:signature} signature The detached signature or an empty signature if message not yet signed + * @param {String} text The cleartext of the signed message + * @param {module:signature.Signature} signature The detached signature or an empty signature for unsigned messages */ export function CleartextMessage(text, signature) { if (!(this instanceof CleartextMessage)) { @@ -65,10 +65,10 @@ CleartextMessage.prototype.getSigningKeyIds = function() { /** * Sign the cleartext message - * @param {Array} privateKeys private keys with decrypted secret key data for signing + * @param {Array} privateKeys private keys with decrypted secret key data for signing * @param {Signature} signature (optional) any existing detached signature * @param {Date} date (optional) The creation time of the signature that should be created - * @returns {Promise} new cleartext message with signed content + * @returns {Promise} new cleartext message with signed content * @async */ CleartextMessage.prototype.sign = async function(privateKeys, signature=null, date=new Date()) { @@ -77,10 +77,10 @@ CleartextMessage.prototype.sign = async function(privateKeys, signature=null, da /** * Sign the cleartext message - * @param {Array} privateKeys private keys with decrypted secret key data for signing + * @param {Array} privateKeys private keys with decrypted secret key data for signing * @param {Signature} signature (optional) any existing detached signature * @param {Date} date (optional) The creation time of the signature that should be created - * @returns {Promise} new detached signature of message content + * @returns {Promise} new detached signature of message content * @async */ CleartextMessage.prototype.signDetached = async function(privateKeys, signature=null, date=new Date()) { @@ -92,7 +92,7 @@ CleartextMessage.prototype.signDetached = async function(privateKeys, signature= /** * Verify signatures of cleartext signed message - * @param {Array} keys array of keys to verify signatures + * @param {Array} keys array of keys to verify signatures * @param {Date} date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns {Promise>} list of signer's keyid and validity of signature * @async @@ -103,7 +103,7 @@ CleartextMessage.prototype.verify = function(keys, date=new Date()) { /** * Verify signatures of cleartext signed message - * @param {Array} keys array of keys to verify signatures + * @param {Array} keys array of keys to verify signatures * @param {Date} date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns {Promise>} list of signer's keyid and validity of signature * @async @@ -146,7 +146,7 @@ CleartextMessage.prototype.armor = function() { /** * reads an OpenPGP cleartext signed message and returns a CleartextMessage object * @param {String} armoredText text to be parsed - * @returns {module:cleartext~CleartextMessage} new cleartext message object + * @returns {module:cleartext.CleartextMessage} new cleartext message object * @static */ export function readArmored(armoredText) { @@ -163,9 +163,9 @@ export function readArmored(armoredText) { /** * Compare hash algorithm specified in the armor header with signatures - * @private * @param {Array} headers Armor headers - * @param {module:packet/packetlist} packetlist The packetlist with signature packets + * @param {module:packet.List} packetlist The packetlist with signature packets + * @private */ function verifyHeaders(headers, packetlist) { const checkHashAlgos = function(hashAlgos) { diff --git a/src/crypto/pkcs1.js b/src/crypto/pkcs1.js index 78f8901a..2d1b7e16 100644 --- a/src/crypto/pkcs1.js +++ b/src/crypto/pkcs1.js @@ -19,7 +19,7 @@ * @fileoverview Provides EME-PKCS1-v1_5 encoding and decoding and EMSA-PKCS1-v1_5 encoding function * @see module:crypto/public_key/rsa * @see module:crypto/public_key/elliptic/ecdh - * @see module:packet/public_key_encrypted_session_key + * @see module:packet.PublicKeyEncryptedSessionKey * @requires crypto/random * @requires crypto/hash * @requires util diff --git a/src/crypto/pkcs5.js b/src/crypto/pkcs5.js index 3bb7a125..860e7d19 100644 --- a/src/crypto/pkcs5.js +++ b/src/crypto/pkcs5.js @@ -17,7 +17,7 @@ /** * @fileoverview Functions to add and remove PKCS5 padding - * @see module:packet/public_key_encrypted_session_key + * @see module:packet.PublicKeyEncryptedSessionKey * @module crypto/pkcs5 */ diff --git a/src/crypto/public_key/elliptic/ecdh.js b/src/crypto/public_key/elliptic/ecdh.js index 57c92590..8cdc3509 100644 --- a/src/crypto/public_key/elliptic/ecdh.js +++ b/src/crypto/public_key/elliptic/ecdh.js @@ -17,7 +17,7 @@ /** * @fileoverview Key encryption and decryption for RFC 6637 ECDH - * @requires crypto/public_key/elliptic/curves + * @requires crypto/public_key/elliptic/curve * @requires crypto/aes_kw * @requires crypto/cipher * @requires crypto/hash @@ -63,13 +63,13 @@ function kdf(hash_algo, X, length, param) { /** * Encrypt and wrap a session key * - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {Enums} cipher_algo Symmetric cipher to use - * @param {Enums} hash_algo Hash algorithm to use - * @param {module:type/mpi} m Value derived from session key (RFC 6637) - * @param {Uint8Array} Q Recipient public key - * @param {String} fingerprint Recipient fingerprint - * @returns {{V: BN, C: BN}} Returns ephemeral key and encoded session key + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.symmetric} cipher_algo Symmetric cipher to use + * @param {module:enums.hash} hash_algo Hash algorithm to use + * @param {module:type/mpi} m Value derived from session key (RFC 6637) + * @param {Uint8Array} Q Recipient public key + * @param {String} fingerprint Recipient fingerprint + * @returns {{V: BN, C: BN}} Returns ephemeral key and encoded session key * @async */ async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) { @@ -91,14 +91,14 @@ async function encrypt(oid, cipher_algo, hash_algo, m, Q, fingerprint) { /** * Decrypt and unwrap the value derived from session key * - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {Enums} cipher_algo Symmetric cipher to use - * @param {Enums} hash_algo Hash algorithm to use - * @param {BN} V Public part of ephemeral key - * @param {Uint8Array} C Encrypted and wrapped value derived from session key - * @param {Uint8Array} d Recipient private key - * @param {String} fingerprint Recipient fingerprint - * @returns {Uint8Array} Value derived from session + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.symmetric} cipher_algo Symmetric cipher to use + * @param {module:enums.hash} hash_algo Hash algorithm to use + * @param {BN} V Public part of ephemeral key + * @param {Uint8Array} C Encrypted and wrapped value derived from session key + * @param {Uint8Array} d Recipient private key + * @param {String} fingerprint Recipient fingerprint + * @returns {Uint8Array} Value derived from session * @async */ async function decrypt(oid, cipher_algo, hash_algo, V, C, d, fingerprint) { diff --git a/src/crypto/public_key/elliptic/ecdsa.js b/src/crypto/public_key/elliptic/ecdsa.js index 1bf020b8..a9c8ac89 100644 --- a/src/crypto/public_key/elliptic/ecdsa.js +++ b/src/crypto/public_key/elliptic/ecdsa.js @@ -18,7 +18,7 @@ /** * @fileoverview Implementation of ECDSA following RFC6637 for Openpgpjs * @requires crypto/hash - * @requires crypto/public_key/elliptic/curves + * @requires crypto/public_key/elliptic/curve * @module crypto/public_key/elliptic/ecdsa */ @@ -27,10 +27,10 @@ import Curve from './curves'; /** * Sign a message using the provided key - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {enums.hash} hash_algo Hash algorithm used to sign - * @param {Uint8Array} m Message to sign - * @param {Uint8Array} d Private key used to sign the message + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.hash} hash_algo Hash algorithm used to sign + * @param {Uint8Array} m Message to sign + * @param {Uint8Array} d Private key used to sign the message * @returns {{r: Uint8Array, * s: Uint8Array}} Signature of the message * @async @@ -45,12 +45,12 @@ async function sign(oid, hash_algo, m, d) { /** * Verifies if a signature is valid for a message - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {enums.hash} hash_algo Hash algorithm used in the signature + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.hash} hash_algo Hash algorithm used in the signature * @param {{r: Uint8Array, - s: Uint8Array}} signature Signature to verify - * @param {Uint8Array} m Message to verify - * @param {Uint8Array} Q Public key used to verify the message + s: Uint8Array}} signature Signature to verify + * @param {Uint8Array} m Message to verify + * @param {Uint8Array} Q Public key used to verify the message * @returns {Boolean} * @async */ diff --git a/src/crypto/public_key/elliptic/eddsa.js b/src/crypto/public_key/elliptic/eddsa.js index 02b1fcdc..97fe7de9 100644 --- a/src/crypto/public_key/elliptic/eddsa.js +++ b/src/crypto/public_key/elliptic/eddsa.js @@ -19,7 +19,7 @@ * @fileoverview Implementation of EdDSA following RFC4880bis-03 for OpenPGP * @requires bn.js * @requires crypto/hash - * @requires crypto/public_key/elliptic/curves + * @requires crypto/public_key/elliptic/curve * @module crypto/public_key/elliptic/eddsa */ @@ -29,10 +29,10 @@ import Curve from './curves'; /** * Sign a message using the provided key - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {enums.hash} hash_algo Hash algorithm used to sign - * @param {Uint8Array} m Message to sign - * @param {Uint8Array} d Private key used to sign + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.hash} hash_algo Hash algorithm used to sign + * @param {Uint8Array} m Message to sign + * @param {Uint8Array} d Private key used to sign * @returns {{R: Uint8Array, * S: Uint8Array}} Signature of the message * @async @@ -48,12 +48,12 @@ async function sign(oid, hash_algo, m, d) { /** * Verifies if a signature is valid for a message - * @param {module:type/oid} oid Elliptic curve object identifier - * @param {enums.hash} hash_algo Hash algorithm used in the signature + * @param {module:type/oid} oid Elliptic curve object identifier + * @param {module:enums.hash} hash_algo Hash algorithm used in the signature * @param {{R: Uint8Array, - S: Uint8Array}} signature Signature to verify the message - * @param {Uint8Array} m Message to verify - * @param {Uint8Array} Q Public key used to verify the message + S: Uint8Array}} signature Signature to verify the message + * @param {Uint8Array} m Message to verify + * @param {Uint8Array} Q Public key used to verify the message * @returns {Boolean} * @async */ diff --git a/src/crypto/public_key/elliptic/key.js b/src/crypto/public_key/elliptic/key.js index 07c4239d..5bffe80b 100644 --- a/src/crypto/public_key/elliptic/key.js +++ b/src/crypto/public_key/elliptic/key.js @@ -18,7 +18,7 @@ /** * @fileoverview Wrapper for a KeyPair of an Elliptic Curve * @requires bn.js - * @requires crypto/public_key/elliptic/curves + * @requires crypto/public_key/elliptic/curve * @requires crypto/hash * @requires util * @requires enums diff --git a/src/key.js b/src/key.js index 75fd19f6..f4b2b78e 100644 --- a/src/key.js +++ b/src/key.js @@ -36,9 +36,8 @@ import util from './util'; * @class * @classdesc Class that represents an OpenPGP key. Must contain a primary key. * Can contain additional subkeys, signatures, user ids, user attributes. - * @param {module:packet/packetlist} packetlist The packets that form this key + * @param {module:packet.List} packetlist The packets that form this key */ - export function Key(packetlist) { if (!(this instanceof Key)) { return new Key(packetlist); @@ -57,7 +56,7 @@ export function Key(packetlist) { /** * Transforms packetlist to structured key data - * @param {module:packet/packetlist} packetlist The packets that form a key + * @param {module:packet.List} packetlist The packets that form a key */ Key.prototype.packetlist2structure = function(packetlist) { let user; @@ -132,7 +131,7 @@ Key.prototype.packetlist2structure = function(packetlist) { /** * Transforms structured key data to packetlist - * @returns {module:packet/packetlist} The packets that form a key + * @returns {module:packet.List} The packets that form a key */ Key.prototype.toPacketlist = function() { const packetlist = new packet.List(); @@ -148,7 +147,7 @@ Key.prototype.toPacketlist = function() { * Returns packetlist containing all public or private subkey packets matching keyId; * If keyId is not present, returns all subkey packets. * @param {type/keyid} keyId - * @returns {module:packet/packetlist} + * @returns {module:packet.List} */ Key.prototype.getSubkeyPackets = function(keyId=null) { const packets = new packet.List(); @@ -164,7 +163,7 @@ Key.prototype.getSubkeyPackets = function(keyId=null) { * Returns a packetlist containing all public or private key packets matching keyId. * If keyId is not present, returns all key packets starting with the primary key. * @param {type/keyid} keyId - * @returns {module:packet/packetlist} + * @returns {module:packet.List} */ Key.prototype.getKeyPackets = function(keyId=null) { const packets = new packet.List(); @@ -211,7 +210,7 @@ Key.prototype.isPrivate = function() { /** * Returns key as public key (shallow copy) - * @returns {module:key~Key} new public Key + * @returns {module:key.Key} new public Key */ Key.prototype.toPublic = function() { const packetlist = new packet.List(); @@ -263,8 +262,8 @@ function isValidSigningKeyPacket(keyPacket, signature, date=new Date()) { * Returns first key packet or key packet by given keyId that is available for signing and verification * @param {module:type/keyid} keyId, optional * @param {Date} date use the given date for verification instead of the current time - * @returns {Promise} key packet or null if no signing key has been found + * @returns {Promise} key packet or null if no signing key has been found * @async */ Key.prototype.getSigningKeyPacket = async function (keyId=null, date=new Date()) { @@ -306,10 +305,10 @@ function isValidEncryptionKeyPacket(keyPacket, signature, date=new Date()) { * Returns first key packet or key packet by given keyId that is available for encryption or decryption * @param {module:type/keyid} keyId, optional * @param {Date} date, optional - * @returns {Promise} key packet or null if no encryption key has been found + * @returns {Promise} key packet or null if no encryption key has been found * @async */ Key.prototype.getEncryptionKeyPacket = async function(keyId, date=new Date()) { @@ -341,7 +340,7 @@ Key.prototype.getEncryptionKeyPacket = async function(keyId, date=new Date()) { * Encrypts all secret key and subkey packets matching keyId * @param {module:type/keyid} keyId * @param {String} passphrase - * @returns {Promise>} + * @returns {Promise>} * @async */ Key.prototype.encrypt = async function(passphrase, keyId=null) { @@ -376,12 +375,12 @@ Key.prototype.decrypt = async function(passphrase, keyId=null) { /** * Checks if a signature on a key is revoked - * @param {module:packet/secret_key| - * @param {module:packet/signature} signature The signature to verify - * @param {module:packet/public_subkey| - * module:packet/secret_subkey| - * module:packet/public_key| - * module:packet/secret_key} key, optional The key to verify the signature + * @param {module:packet.SecretKey| + * @param {module:packet.Signature} signature The signature to verify + * @param {module:packet.PublicSubkey| + * module:packet.SecretSubkey| + * module:packet.PublicKey| + * module:packet.SecretKey} key, optional The key to verify the signature * @param {Date} date Use the given date instead of the current time * @returns {Promise} True if the certificate is revoked * @async @@ -474,8 +473,8 @@ Key.prototype.getExpirationTime = async function() { * - if multiple primary users exist, returns the one with the latest self signature * - otherwise, returns the user with the latest self signature * @param {Date} date use the given date for verification instead of the current time - * @returns {Promise<{user: Array, - * selfCertification: Array}|undefined>} The primary user and the self signature + * @returns {Promise<{user: Array, + * selfCertification: Array}>} The primary user and the self signature * @async */ Key.prototype.getPrimaryUser = async function(date=new Date()) { @@ -530,7 +529,7 @@ Key.prototype.getPrimaryUser = async function(date=new Date()) { * * If the specified key is a private key and the destination key is public, * the destination key is transformed to a private key. - * @param {module:key~Key} key Source key to merge + * @param {module:key.Key} key Source key to merge */ Key.prototype.update = async function(key) { const that = this; @@ -623,8 +622,8 @@ Key.prototype.revoke = function() { /** * Signs primary user of key - * @param {Array} privateKey decrypted private keys for signing - * @returns {Promise} new public key with new certificate signature + * @param {Array} privateKey decrypted private keys for signing + * @returns {Promise} new public key with new certificate signature * @async */ Key.prototype.signPrimaryUser = async function(privateKeys) { @@ -640,8 +639,8 @@ Key.prototype.signPrimaryUser = async function(privateKeys) { /** * Signs all users of key - * @param {Array} privateKeys decrypted private keys for signing - * @returns {Promise} new public key with new certificate signature + * @param {Array} privateKeys decrypted private keys for signing + * @returns {Promise} new public key with new certificate signature * @async */ Key.prototype.signAllUsers = async function(privateKeys) { @@ -657,7 +656,7 @@ Key.prototype.signAllUsers = async function(privateKeys) { * Verifies primary user of key * - if no arguments are given, verifies the self certificates; * - otherwise, verifies all certificates signed with given keys. - * @param {Array} keys array of keys to verify certificate signatures + * @param {Array} keys array of keys to verify certificate signatures * @returns {Promise>} List of signer's keyid and validity of signature * @async @@ -677,7 +676,7 @@ Key.prototype.verifyPrimaryUser = async function(keys) { * Verifies all users of key * - if no arguments are given, verifies the self certificates; * - otherwise, verifies all certificates signed with given keys. - * @param {Array} keys array of keys to verify certificate signatures + * @param {Array} keys array of keys to verify certificate signatures * @returns {Promise>} list of userid, signer's keyid and validity of signature @@ -717,7 +716,7 @@ function User(userPacket) { /** * Transforms structured user data to packetlist - * @returns {module:packet/packetlist} + * @returns {module:packet.List} */ User.prototype.toPacketlist = function() { const packetlist = new packet.List(); @@ -730,10 +729,10 @@ User.prototype.toPacketlist = function() { /** * Signs user - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet - * @param {Array} privateKeys Decrypted private keys for signing - * @returns {Promise} New user with new certificate signatures + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet + * @param {Array} privateKeys Decrypted private keys for signing + * @returns {Promise} New user with new certificate signatures * @async */ User.prototype.sign = async function(primaryKey, privateKeys) { @@ -770,13 +769,13 @@ User.prototype.sign = async function(primaryKey, privateKeys) { /** * Checks if a given certificate of the user is revoked - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet - * @param {module:packet/signature} certificate The certificate to verify - * @param {module:packet/public_subkey| - * module:packet/secret_subkey| - * module:packet/public_key| - * module:packet/secret_key} key, optional The key to verify the signature + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet + * @param {module:packet.Signature} certificate The certificate to verify + * @param {module:packet.PublicSubkey| + * module:packet.SecretSubkey| + * module:packet.PublicKey| + * module:packet.SecretKey} key, optional The key to verify the signature * @param {Date} date Use the given date instead of the current time * @returns {Promise} True if the certificate is revoked * @async @@ -792,10 +791,10 @@ User.prototype.isRevoked = async function(primaryKey, certificate, key, date=new /** * Verifies the user certificate - * @param {module:packet/secret_key| - module:packet/public_key} primaryKey The primary key packet - * @param {module:packet/signature} certificate A certificate of this user - * @param {Array} keys Array of keys to verify certificate signatures + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet + * @param {module:packet.Signature} certificate A certificate of this user + * @param {Array} keys Array of keys to verify certificate signatures * @param {Date} date Use the given date instead of the current time * @returns {Promise} status of the certificate * @async @@ -823,9 +822,9 @@ User.prototype.verifyCertificate = async function(primaryKey, certificate, keys, /** * Verifies all user certificates - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet - * @param {Array} keys Array of keys to verify certificate signatures + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet + * @param {Array} keys Array of keys to verify certificate signatures * @returns {Promise>} List of signer's keyid and validity of signature * @async @@ -845,8 +844,8 @@ User.prototype.verifyAllCertifications = async function(primaryKey, keys) { /** * Verify User. Checks for existence of self signatures, revocation signatures * and validity of self signature - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet * @returns {Promise} Status of user * @async */ @@ -876,9 +875,9 @@ User.prototype.verify = async function(primaryKey) { /** * Update user with new components from specified user - * @param {module:key~User} user Source user to merge - * @param {module:packet/secret_key| - module:packet/secret_subkey} primaryKey primary key used for validation + * @param {module:key.User} user Source user to merge + * @param {module:packet.SecretKey| + * module:packet.SecretSubkey} primaryKey primary key used for validation */ User.prototype.update = async function(user, primaryKey) { const dataToVerify = { userid: this.userId || this.userAttribute, key: primaryKey }; @@ -909,7 +908,7 @@ function SubKey(subKeyPacket) { /** * Transforms structured subkey data to packetlist - * @returns {module:packet/packetlist} + * @returns {module:packet.List} */ SubKey.prototype.toPacketlist = function() { const packetlist = new packet.List(); @@ -921,13 +920,13 @@ SubKey.prototype.toPacketlist = function() { /** * Checks if a binding signature of a subkey is revoked - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet - * @param {module:packet/signature} signature The binding signature to verify - * @param {module:packet/public_subkey| - * module:packet/secret_subkey| - * module:packet/public_key| - * module:packet/secret_key} key, optional The key to verify the signature + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet + * @param {module:packet.Signature} signature The binding signature to verify + * @param {module:packet.PublicSubkey| + * module:packet.SecretSubkey| + * module:packet.PublicKey| + * module:packet.SecretKey} key, optional The key to verify the signature * @param {Date} date Use the given date instead of the current time * @returns {Promise} True if the binding signature is revoked * @async @@ -944,8 +943,8 @@ SubKey.prototype.isRevoked = async function(primaryKey, signature, key, date=new /** * Verify subkey. Checks for revocation signatures, expiration time * and valid binding signature - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet * @param {Date} date Use the given date instead of the current time * @returns {Promise} The status of the subkey * @async @@ -1000,9 +999,9 @@ SubKey.prototype.getExpirationTime = function() { /** * Update subkey with new components from specified subkey - * @param {module:key~SubKey} subKey Source subkey to merge - * @param {module:packet/secret_key| - module:packet/secret_subkey} primaryKey primary key used for validation + * @param {module:key.SubKey} subKey Source subkey to merge + * @param {module:packet.SecretKey| + module:packet.SecretSubkey} primaryKey primary key used for validation */ SubKey.prototype.update = async function(subKey, primaryKey) { if (await subKey.verify(primaryKey) === enums.keyStatus.invalid) { @@ -1042,7 +1041,7 @@ SubKey.prototype.update = async function(subKey, primaryKey) { /** * Reads an unarmored OpenPGP key list and returns one or multiple key objects * @param {Uint8Array} data to be parsed - * @returns {{keys: Array, + * @returns {{keys: Array, * err: (Array|null)}} result object with key and error arrays * @static */ @@ -1076,7 +1075,7 @@ export function read(data) { /** * Reads an OpenPGP armored text and returns one or multiple key objects * @param {String} armoredText text to be parsed - * @returns {{keys: Array, + * @returns {{keys: Array, * err: (Array|null)}} result object with key and error arrays * @static */ @@ -1097,15 +1096,18 @@ export function readArmored(armoredText) { /** * Generates a new OpenPGP key. Supports RSA and ECC keys. * Primary and subkey will be of same type. - * @param {module:enums.publicKey} [options.keyType=module:enums.publicKey.rsa_encrypt_sign] to indicate what type of key to make. + * @param {module:enums.publicKey} [options.keyType=module:enums.publicKey.rsa_encrypt_sign] + * To indicate what type of key to make. * RSA is 1. See {@link https://tools.ietf.org/html/rfc4880#section-9.1} * @param {Integer} options.numBits number of bits for the key creation. - * @param {String|Array} options.userIds assumes already in form of "User Name " - If array is used, the first userId is set as primary user Id + * @param {String|Array} options.userIds + * Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id * @param {String} options.passphrase The passphrase used to encrypt the resulting private key * @param {Boolean} [options.unlocked=false] The secret part of the generated key is unlocked - * @param {Number} [options.keyExpirationTime=0] The number of seconds after the key creation time that the key expires - * @returns {Promise} + * @param {Number} [options.keyExpirationTime=0] + * The number of seconds after the key creation time that the key expires + * @returns {Promise} * @async * @static */ @@ -1174,14 +1176,16 @@ export function generate(options) { /** * Reformats and signs an OpenPGP with a given User ID. Currently only supports RSA keys. - * @param {module:key~Key} options.privateKey The private key to reformat + * @param {module:key.Key} options.privateKey The private key to reformat * @param {module:enums.publicKey} [options.keyType=module:enums.publicKey.rsa_encrypt_sign] - * @param {String|Array} options.userIds assumes already in form of "User Name " - If array is used, the first userId is set as primary user Id + * @param {String|Array} options.userIds + * Assumes already in form of "User Name " + * If array is used, the first userId is set as primary user Id * @param {String} options.passphrase The passphrase used to encrypt the resulting private key * @param {Boolean} [options.unlocked=false] The secret part of the generated key is unlocked - * @param {Number} [options.keyExpirationTime=0] The number of seconds after the key creation time that the key expires - * @returns {Promise} + * @param {Number} [options.keyExpirationTime=0] + * The number of seconds after the key creation time that the key expires + * @returns {Promise} * @async * @static */ @@ -1317,15 +1321,15 @@ async function wrapKeyObject(secretKeyPacket, secretSubkeyPacket, options) { /** * Checks if a given certificate or binding signature is revoked - * @param {module:packet/secret_key| - * module:packet/public_key} primaryKey The primary key packet + * @param {module:packet.SecretKey| + * module:packet.PublicKey} primaryKey The primary key packet * @param {Object} dataToVerify The data to check - * @param {Array} revocations The revocation signatures to check - * @param {module:packet/signature} signature The certificate or signature to check - * @param {module:packet/public_subkey| - * module:packet/secret_subkey| - * module:packet/public_key| - * module:packet/secret_key} key, optional The key packet to check the signature + * @param {Array} revocations The revocation signatures to check + * @param {module:packet.Signature} signature The certificate or signature to check + * @param {module:packet.PublicSubkey| + * module:packet.SecretSubkey| + * module:packet.PublicKey| + * module:packet.SecretKey} key, optional The key packet to check the signature * @param {Date} date Use the given date instead of the current time * @returns {Promise} True if the signature revokes the data * @async @@ -1412,7 +1416,7 @@ export async function getPreferredHashAlgo(key) { /** * Returns the preferred symmetric algorithm for a set of keys - * @param {Array} keys Set of keys + * @param {Array} keys Set of keys * @returns {Promise} Preferred symmetric algorithm * @async */ diff --git a/src/keyring/keyring.js b/src/keyring/keyring.js index 3284dcfe..c8759ee1 100644 --- a/src/keyring/keyring.js +++ b/src/keyring/keyring.js @@ -58,7 +58,7 @@ Keyring.prototype.clear = function() { * @param {String} keyId provided as string of lowercase hex number * withouth 0x prefix (can be 16-character key ID or fingerprint) * @param {Boolean} deep if true search also in subkeys - * @returns {Array|null} keys found or null + * @returns {Array|null} keys found or null */ Keyring.prototype.getKeysForId = function (keyId, deep) { let result = []; @@ -71,7 +71,7 @@ Keyring.prototype.getKeysForId = function (keyId, deep) { * Removes keys having the specified key id from the keyring * @param {String} keyId provided as string of lowercase hex number * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @returns {Array|null} keys found or null + * @returns {Array|null} keys found or null */ Keyring.prototype.removeKeysForId = function (keyId) { let result = []; @@ -82,7 +82,7 @@ Keyring.prototype.removeKeysForId = function (keyId) { /** * Get all public and private keys - * @returns {Array} all keys + * @returns {Array} all keys */ Keyring.prototype.getAllKeys = function () { return this.publicKeys.keys.concat(this.privateKeys.keys); @@ -90,7 +90,7 @@ Keyring.prototype.getAllKeys = function () { /** * Array of keys - * @param {Array} keys The keys to store in this array + * @param {Array} keys The keys to store in this array */ function KeyArray(keys) { this.keys = keys; @@ -99,7 +99,7 @@ function KeyArray(keys) { /** * Searches all keys in the KeyArray matching the address or address part of the user ids * @param {String} email email address to search for - * @returns {Array} The public keys associated with provided email address. + * @returns {Array} The public keys associated with provided email address. */ KeyArray.prototype.getForAddress = function(email) { const results = []; @@ -115,7 +115,7 @@ KeyArray.prototype.getForAddress = function(email) { * Checks a key to see if it matches the specified email address * @private * @param {String} email email address to search for - * @param {module:key~Key} key The key to be checked. + * @param {module:key.Key} key The key to be checked. * @returns {Boolean} True if the email address is defined in the specified key */ function emailCheck(email, key) { @@ -138,7 +138,7 @@ function emailCheck(email, key) { * @private * @param {String} keyId provided as string of lowercase hex number * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @param {module:packet/secret_key|public_key|public_subkey|secret_subkey} keypacket The keypacket to be checked + * @param {module:packet.SecretKey|public_key|public_subkey|secret_subkey} keypacket The keypacket to be checked * @returns {Boolean} True if keypacket has the specified keyid */ function keyIdCheck(keyId, keypacket) { @@ -153,7 +153,7 @@ function keyIdCheck(keyId, keypacket) { * @param {String} keyId provided as string of lowercase hex number * withouth 0x prefix (can be 16-character key ID or fingerprint) * @param {Boolean} deep if true search also in subkeys - * @returns {module:key~Key|null} key found or null + * @returns {module:key.Key|null} key found or null */ KeyArray.prototype.getForId = function (keyId, deep) { for (let i = 0; i < this.keys.length; i++) { @@ -197,7 +197,7 @@ KeyArray.prototype.importKey = async function (armored) { /** * Add key to KeyArray - * @param {module:key~Key} key The key that will be added to the keyring + * @param {module:key.Key} key The key that will be added to the keyring * @returns {Number} The new length of the KeyArray */ KeyArray.prototype.push = function (key) { @@ -208,7 +208,7 @@ KeyArray.prototype.push = function (key) { * Removes a key with the specified keyid from the keyring * @param {String} keyId provided as string of lowercase hex number * withouth 0x prefix (can be 16-character key ID or fingerprint) - * @returns {module:key~Key|null} The key object which has been removed or null + * @returns {module:key.Key|null} The key object which has been removed or null */ KeyArray.prototype.removeForId = function (keyId) { for (let i = 0; i < this.keys.length; i++) { diff --git a/src/keyring/localstore.js b/src/keyring/localstore.js index fe8e075c..15212a33 100644 --- a/src/keyring/localstore.js +++ b/src/keyring/localstore.js @@ -52,7 +52,7 @@ LocalStore.prototype.privateKeysItem = 'private-keys'; /** * Load the public keys from HTML5 local storage. - * @returns {Array} array of keys retrieved from localstore + * @returns {Array} array of keys retrieved from localstore */ LocalStore.prototype.loadPublic = function () { return loadKeys(this.storage, this.publicKeysItem); @@ -60,7 +60,7 @@ LocalStore.prototype.loadPublic = function () { /** * Load the private keys from HTML5 local storage. - * @returns {Array} array of keys retrieved from localstore + * @returns {Array} array of keys retrieved from localstore */ LocalStore.prototype.loadPrivate = function () { return loadKeys(this.storage, this.privateKeysItem); @@ -86,7 +86,7 @@ function loadKeys(storage, itemname) { /** * Saves the current state of the public keys to HTML5 local storage. * The key array gets stringified using JSON - * @param {Array} keys array of keys to save in localstore + * @param {Array} keys array of keys to save in localstore */ LocalStore.prototype.storePublic = function (keys) { storeKeys(this.storage, this.publicKeysItem, keys); @@ -95,7 +95,7 @@ LocalStore.prototype.storePublic = function (keys) { /** * Saves the current state of the private keys to HTML5 local storage. * The key array gets stringified using JSON - * @param {Array} keys array of keys to save in localstore + * @param {Array} keys array of keys to save in localstore */ LocalStore.prototype.storePrivate = function (keys) { storeKeys(this.storage, this.privateKeysItem, keys); diff --git a/src/message.js b/src/message.js index 1fbe384e..f24a619b 100644 --- a/src/message.js +++ b/src/message.js @@ -16,9 +16,10 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** + * @requires encoding/armor + * @requires type/keyid * @requires config * @requires crypto - * @requires encoding/armor * @requires enums * @requires util * @requires packet @@ -27,13 +28,13 @@ * @module message */ +import armor from './encoding/armor'; +import type_keyid from './type/keyid'; import config from './config'; import crypto from './crypto'; -import armor from './encoding/armor'; import enums from './enums'; import util from './util'; import packet from './packet'; -import type_keyid from './type/keyid'; import { Signature } from './signature'; import { getPreferredHashAlgo, getPreferredSymAlgo } from './key'; @@ -42,7 +43,7 @@ import { getPreferredHashAlgo, getPreferredSymAlgo } from './key'; * @class * @classdesc Class that represents an OpenPGP message. * Can be an encrypted message, signed message, compressed message or literal message - * @param {module:packet/packetlist} packetlist The packets that form this message + * @param {module:packet.List} packetlist The packets that form this message * See {@link https://tools.ietf.org/html/rfc4880#section-11.3} */ @@ -361,7 +362,7 @@ export async function encryptSessionKey(sessionKey, symAlgo, publicKeys, passwor /** * Sign the message (the literal data packet of the message) - * @param {Array} privateKeys private keys with decrypted secret key data for signing + * @param {Array} privateKeys private keys with decrypted secret key data for signing * @param {Signature} signature (optional) any existing detached signature to add to the message * @param {Date} date} (optional) override the creation time of the signature * @returns {Promise} new message with signed content @@ -428,7 +429,7 @@ Message.prototype.sign = async function(privateKeys=[], signature=null, date=new /** * Compresses the message (the literal and -if signed- signature data packets of the message) * @param {module:enums.compression} compression compression algorithm to be used - * @returns {module:message~Message} new message with compressed content + * @returns {module:message.Message} new message with compressed content */ Message.prototype.compress = function(compression) { if (compression === enums.compression.uncompressed) { @@ -447,10 +448,10 @@ Message.prototype.compress = function(compression) { /** * Create a detached signature for the message (the literal data packet of the message) - * @param {Array} privateKeys private keys with decrypted secret key data for signing + * @param {Array} privateKeys private keys with decrypted secret key data for signing * @param {Signature} signature (optional) any existing detached signature * @param {Date} date (optional) override the creation time of the signature - * @returns {Promise} new detached signature of message content + * @returns {Promise} new detached signature of message content * @async */ Message.prototype.signDetached = async function(privateKeys=[], signature=null, date=new Date()) { @@ -463,11 +464,11 @@ Message.prototype.signDetached = async function(privateKeys=[], signature=null, /** * Create signature packets for the message - * @param {module:packet/literal} literalDataPacket the literal data packet to sign - * @param {Array} privateKeys private keys with decrypted secret key data for signing + * @param {module:packet.Literal} literalDataPacket the literal data packet to sign + * @param {Array} privateKeys private keys with decrypted secret key data for signing * @param {Signature} signature (optional) any existing detached signature to append * @param {Date} date (optional) override the creationtime of the signature - * @returns {Promise} list of signature packets + * @returns {Promise} list of signature packets * @async */ export async function createSignaturePackets(literalDataPacket, privateKeys, signature=null, date=new Date()) { @@ -508,7 +509,7 @@ export async function createSignaturePackets(literalDataPacket, privateKeys, sig /** * Verify message signatures - * @param {Array} keys array of keys to verify signatures + * @param {Array} keys array of keys to verify signatures * @param {Date} date (optional) Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns {Promise>} list of signer's keyid and validity of signature * @async @@ -525,7 +526,7 @@ Message.prototype.verify = function(keys, date=new Date()) { /** * Verify detached message signature - * @param {Array} keys array of keys to verify signatures + * @param {Array} keys array of keys to verify signatures * @param {Signature} signature * @param {Date} date Verify the signature against the given date, i.e. check signature creation time < date < expiration time * @returns {Promise>} list of signer's keyid and validity of signature @@ -543,9 +544,9 @@ Message.prototype.verifyDetached = function(signature, keys, date=new Date()) { /** * Create list of objects containing signer's keyid and validity of signature - * @param {Array} signatureList array of signature packets - * @param {Array} literalDataList array of literal data packets - * @param {Array} keys array of keys to verify signatures + * @param {Array} signatureList array of signature packets + * @param {Array} literalDataList array of literal data packets + * @param {Array} keys array of keys to verify signatures * @param {Date} date Verify the signature against the given date, * i.e. check signature creation time < date < expiration time * @returns {Promise} + */ this.params = []; - // time in days (V3 only) + /** + * Time until expiration in days (V3 only) + * @type {Integer} + */ this.expirationTimeV3 = 0; /** * Fingerprint in lowercase hex @@ -110,7 +126,7 @@ PublicKey.prototype.read = function (bytes) { /** * Alias of read() - * @see module:packet/public_key~PublicKey#read + * @see module:packet.PublicKey#read */ PublicKey.prototype.readPublicKey = PublicKey.prototype.read; @@ -140,7 +156,7 @@ PublicKey.prototype.write = function () { /** * Alias of write() - * @see module:packet/public_key~PublicKey#write + * @see module:packet.PublicKey#write */ PublicKey.prototype.writePublicKey = PublicKey.prototype.write; diff --git a/src/packet/public_key_encrypted_session_key.js b/src/packet/public_key_encrypted_session_key.js index 1c372c24..f926d0ca 100644 --- a/src/packet/public_key_encrypted_session_key.js +++ b/src/packet/public_key_encrypted_session_key.js @@ -67,7 +67,7 @@ function PublicKeyEncryptedSessionKey() { * @param {Integer} position Position to start reading from the input string * @param {Integer} len Length of the packet or the remaining length of * input at position - * @returns {module:packet/public_key_encrypted_session_key} Object representation + * @returns {module:packet.PublicKeyEncryptedSessionKey} Object representation */ PublicKeyEncryptedSessionKey.prototype.read = function (bytes) { this.version = bytes[0]; @@ -102,7 +102,7 @@ PublicKeyEncryptedSessionKey.prototype.write = function () { /** * Encrypt session key packet - * @param {module:packet/public_key} key Public key + * @param {module:packet.PublicKey} key Public key * @returns {Promise} * @async */ @@ -130,7 +130,7 @@ PublicKeyEncryptedSessionKey.prototype.encrypt = async function (key) { * Decrypts the session key (only for public key encrypted session key * packets (tag 1) * - * @param {module:packet/secret_key} key + * @param {module:packet.SecretKey} key * Private key with secret params unlocked * @returns {Promise} * @async diff --git a/src/packet/secret_key.js b/src/packet/secret_key.js index 5dceb7f5..4255e4a1 100644 --- a/src/packet/secret_key.js +++ b/src/packet/secret_key.js @@ -16,13 +16,6 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * FIXME - * Implementation of the Key Material Packet (Tag 5,6,7,14) - * - * {@link https://tools.ietf.org/html/rfc4880#section-5.5|RFC4480 5.5}: - * A key material packet contains all the information about a public or - * private key. There are four variants of this packet type, and two - * major versions. Consequently, this section is complex. * @requires packet/public_key * @requires type/keyid * @requires type/s2k @@ -48,10 +41,18 @@ import util from '../util'; */ function SecretKey() { publicKey.call(this); + /** + * Packet type + * @type {module:enums.packet} + */ this.tag = enums.packet.secretKey; - // encrypted secret-key data + /** + * Encrypted secret-key data + */ this.encrypted = null; - // indicator if secret-key data is available in decrypted form + /** + * Indicator if secret-key data is available in decrypted form + */ this.isDecrypted = false; } @@ -123,7 +124,8 @@ function write_cleartext_params(hash_algorithm, algorithm, params) { // 5.5.3. Secret-Key Packet Formats /** - * Internal parser for private keys as specified in {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3} + * Internal parser for private keys as specified in + * {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 section 5.5.3} * @param {String} bytes Input string to read the packet from */ SecretKey.prototype.read = function (bytes) { @@ -154,9 +156,10 @@ SecretKey.prototype.read = function (bytes) { } }; -/** Creates an OpenPGP key packet for the given key. - * @returns {String} A string of bytes containing the secret key OpenPGP packet - */ +/** + * Creates an OpenPGP key packet for the given key. + * @returns {String} A string of bytes containing the secret key OpenPGP packet + */ SecretKey.prototype.write = function () { const arr = [this.writePublicKey()]; @@ -171,7 +174,8 @@ SecretKey.prototype.write = function () { }; -/** Encrypt the payload. By default, we use aes256 and iterated, salted string +/** + * Encrypt the payload. By default, we use aes256 and iterated, salted string * to key specifier. If the key is in a decrypted state (isDecrypted === true) * and the passphrase is empty or undefined, the key will be set as not encrypted. * This can be used to remove passphrase protection after calling decrypt(). @@ -213,9 +217,8 @@ function produceEncryptionKey(s2k, passphrase, algorithm) { /** * Decrypts the private key params which are needed to use the key. - * @link module:packet/secret_key.isDecrypted should be - * false otherwise a call to this function is not needed - * + * {@link module:packet.SecretKey.isDecrypted} should be false, as + * otherwise calls to this function will throw an error. * @param {String} passphrase The passphrase for this private key as string * @returns {Promise} * @async diff --git a/src/packet/signature.js b/src/packet/signature.js index 515e0c2d..018fb752 100644 --- a/src/packet/signature.js +++ b/src/packet/signature.js @@ -94,7 +94,7 @@ function Signature(date=new Date()) { * @param {String} bytes payload of a tag 2 packet * @param {Integer} position position to start reading from the bytes string * @param {Integer} len length of the packet or the remaining length of bytes at position - * @returns {module:packet/signature} object representation + * @returns {module:packet.Signature} object representation */ Signature.prototype.read = function (bytes) { let i = 0; @@ -210,7 +210,7 @@ Signature.prototype.write = function () { /** * Signs provided data. This needs to be done prior to serialization. - * @param {module:packet/secret_key} key private key used to sign the message. + * @param {module:packet.SecretKey} key private key used to sign the message. * @param {Object} data Contains packets to be signed. * @returns {Promise} * @async @@ -619,8 +619,8 @@ Signature.prototype.calculateTrailer = function () { /** * verifys the signature packet. Note: not signature types are implemented * @param {String|Object} data data which on the signature applies - * @param {module:packet/public_subkey|module:packet/public_key| - * module:packet/secret_subkey|module:packet/secret_key} key the public key to verify the signature + * @param {module:packet.PublicSubkey|module:packet.PublicKey| + * module:packet.SecretSubkey|module:packet.SecretKey} key the public key to verify the signature * @returns {Promise} True if message is verified, else false. * @async */ diff --git a/src/packet/sym_encrypted_session_key.js b/src/packet/sym_encrypted_session_key.js index 4a4fda1a..cdd0a136 100644 --- a/src/packet/sym_encrypted_session_key.js +++ b/src/packet/sym_encrypted_session_key.js @@ -63,7 +63,7 @@ function SymEncryptedSessionKey() { * @param {Integer} len * Length of the packet or the remaining length of * input at position - * @returns {module:packet/sym_encrypted_session_key} Object representation + * @returns {module:packet.SymEncryptedSessionKey} Object representation */ SymEncryptedSessionKey.prototype.read = function(bytes) { // A one-octet version number. The only currently defined version is 4. diff --git a/src/packet/symmetrically_encrypted.js b/src/packet/symmetrically_encrypted.js index 0d30760d..12590e88 100644 --- a/src/packet/symmetrically_encrypted.js +++ b/src/packet/symmetrically_encrypted.js @@ -38,11 +38,24 @@ import enums from '../enums'; * @constructor */ function SymmetricallyEncrypted() { + /** + * Packet type + * @type {module:enums.packet} + */ this.tag = enums.packet.symmetricallyEncrypted; + /** + * Encrypted secret-key data + */ this.encrypted = null; - /** Decrypted packets contained within. - * @type {module:packet/packetlist} */ + /** + * Decrypted packets contained within. + * @type {module:packet.List} + */ this.packets = null; + /** + * When true, decrypt fails if message is not integrity protected + * @see module:config.ignore_mdc_error + */ this.ignore_mdc_error = config.ignore_mdc_error; } @@ -56,8 +69,8 @@ SymmetricallyEncrypted.prototype.write = function () { /** * Decrypt the symmetrically-encrypted packet data - * @param {module:enums.symmetric} sessionKeyAlgorithm - * Symmetric key algorithm to use // See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2} + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param {module:enums.symmetric} sessionKeyAlgorithm Symmetric key algorithm to use * @param {Uint8Array} key The key of cipher blocksize length to be used * @returns {Promise} * @async @@ -78,8 +91,8 @@ SymmetricallyEncrypted.prototype.decrypt = async function (sessionKeyAlgorithm, /** * Encrypt the symmetrically-encrypted packet data - * @param {module:enums.symmetric} sessionKeyAlgorithm - * Symmetric key algorithm to use // See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC4880 9.2} + * See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms. + * @param {module:enums.symmetric} sessionKeyAlgorithm Symmetric key algorithm to use * @param {Uint8Array} key The key of cipher blocksize length to be used * @returns {Promise} * @async diff --git a/src/packet/user_attribute.js b/src/packet/user_attribute.js index 6289b2d3..5485829a 100644 --- a/src/packet/user_attribute.js +++ b/src/packet/user_attribute.js @@ -79,7 +79,7 @@ UserAttribute.prototype.write = function() { /** * Compare for equality - * @param {module:user_attribute~UserAttribute} usrAttr + * @param {module:packet.UserAttribute} usrAttr * @returns {Boolean} true if equal */ UserAttribute.prototype.equals = function(usrAttr) { diff --git a/src/signature.js b/src/signature.js index 51016cff..cc72a5e4 100644 --- a/src/signature.js +++ b/src/signature.js @@ -16,22 +16,21 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA /** - * @requires enums - * @requires packet * @requires encoding/armor + * @requires packet + * @requires enums * @module signature */ +import armor from './encoding/armor'; import packet from './packet'; import enums from './enums'; -import armor from './encoding/armor'; /** * @class * @classdesc Class that represents an OpenPGP signature. - * @param {module:packet/packetlist} packetlist The signature packets + * @param {module:packet.List} packetlist The signature packets */ - export function Signature(packetlist) { if (!(this instanceof Signature)) { return new Signature(packetlist); diff --git a/src/worker/async_proxy.js b/src/worker/async_proxy.js index 2c08e242..0619d7dc 100644 --- a/src/worker/async_proxy.js +++ b/src/worker/async_proxy.js @@ -63,11 +63,11 @@ function handleMessage(workerId) { /** * Initializes a new proxy and loads the web worker - * @constructor * @param {String} path The path to the worker or 'openpgp.worker.js' by default * @param {Number} n number of workers to initialize if path given * @param {Object} config config The worker configuration * @param {Array} worker alternative to path parameter: web worker initialized with 'openpgp.worker.js' + * @constructor */ function AsyncProxy({ path='openpgp.worker.js', n = 1, workers = [], config } = {}) {