Fix minor JSDoc and style issues (#1156)
This commit is contained in:
parent
a620fc0276
commit
400ae63c5e
|
@ -55,12 +55,12 @@ export function constructParams(types, data) {
|
|||
/**
|
||||
* Encrypts data using specified algorithm and public key parameters.
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-9.1|RFC 4880 9.1} for public key algorithms.
|
||||
* @param {module:enums.publicKey} algo Public key algorithm
|
||||
* @param {Object} pubParams Algorithm-specific public key parameters
|
||||
* @param {Uint8Array} data Data to be encrypted
|
||||
* @param {Uint8Array} fingerprint Recipient fingerprint
|
||||
* @param {module:enums.publicKey} algo Public key algorithm
|
||||
* @param {Object} publicParams Algorithm-specific public key parameters
|
||||
* @param {Uint8Array} data Data to be encrypted
|
||||
* @param {Uint8Array} fingerprint Recipient fingerprint
|
||||
* @returns {Array<module:type/mpi|
|
||||
* module:type/ecdh_symkey>} encrypted session key parameters
|
||||
* module:type/ecdh_symkey>} Encrypted session key parameters
|
||||
* @async
|
||||
*/
|
||||
export async function publicKeyEncrypt(algo, publicParams, data, fingerprint) {
|
||||
|
@ -91,14 +91,13 @@ export async function publicKeyEncrypt(algo, publicParams, data, fingerprint) {
|
|||
/**
|
||||
* Decrypts data using specified algorithm and private key parameters.
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-5.5.3|RFC 4880 5.5.3}
|
||||
* @param {module:enums.publicKey} algo Public key algorithm
|
||||
* @param {module:enums.publicKey} algo Public key algorithm
|
||||
* @param {Object} publicKeyParams Algorithm-specific public key parameters
|
||||
* @param {Object} privateKeyParams Algorithm-specific private key parameters
|
||||
* @param {Array<module:type/mpi|
|
||||
module:type/ecdh_symkey>}
|
||||
data_params encrypted session key parameters
|
||||
* @param {Uint8Array} fingerprint Recipient fingerprint
|
||||
* @returns {Uint8Array} decrypted data
|
||||
module:type/ecdh_symkey>} data_params Encrypted session key parameters
|
||||
* @param {Uint8Array} fingerprint Recipient fingerprint
|
||||
* @returns {Uint8Array} Decrypted data
|
||||
* @async
|
||||
*/
|
||||
export async function publicKeyDecrypt(algo, publicKeyParams, privateKeyParams, data_params, fingerprint) {
|
||||
|
@ -132,10 +131,9 @@ export async function publicKeyDecrypt(algo, publicKeyParams, privateKeyParams,
|
|||
|
||||
/**
|
||||
* Parse public key material in binary form to get the key parameters
|
||||
* @param {module:enums.publicKey} algo The key algorithm
|
||||
* @param {Uint8Array} bytes The key material to parse
|
||||
* @returns {Object} key parameters referenced by name
|
||||
* @returns { read: Number, publicParams: Object } number of read bytes plus key parameters referenced by name
|
||||
* @param {module:enums.publicKey} algo The key algorithm
|
||||
* @param {Uint8Array} bytes The key material to parse
|
||||
* @returns {{ read: Number, publicParams: Object }} Number of read bytes plus key parameters referenced by name
|
||||
*/
|
||||
export function parsePublicKeyParams(algo, bytes) {
|
||||
let read = 0;
|
||||
|
@ -143,7 +141,6 @@ export function parsePublicKeyParams(algo, bytes) {
|
|||
case enums.publicKey.rsaEncrypt:
|
||||
case enums.publicKey.rsaEncryptSign:
|
||||
case enums.publicKey.rsaSign: {
|
||||
let read = 0;
|
||||
const n = util.readMPI(bytes.subarray(read)); read += n.length + 2;
|
||||
const e = util.readMPI(bytes.subarray(read)); read += e.length + 2;
|
||||
return { read, publicParams: { n, e } };
|
||||
|
@ -185,10 +182,10 @@ export function parsePublicKeyParams(algo, bytes) {
|
|||
|
||||
/**
|
||||
* Parse private key material in binary form to get the key parameters
|
||||
* @param {module:enums.publicKey} algo The key algorithm
|
||||
* @param {Uint8Array} bytes The key material to parse
|
||||
* @param {Object} publicParams (ECC only) public params, needed to format some private params
|
||||
* @returns { read: Number, privateParams: Object } number of read bytes plus the key parameters referenced by name
|
||||
* @param {module:enums.publicKey} algo The key algorithm
|
||||
* @param {Uint8Array} bytes The key material to parse
|
||||
* @param {Object} publicParams (ECC only) public params, needed to format some private params
|
||||
* @returns {{ read: Number, privateParams: Object }} Number of read bytes plus the key parameters referenced by name
|
||||
*/
|
||||
export function parsePrivateKeyParams(algo, bytes, publicParams) {
|
||||
let read = 0;
|
||||
|
@ -225,8 +222,8 @@ export function parsePrivateKeyParams(algo, bytes, publicParams) {
|
|||
}
|
||||
|
||||
/** Returns the types comprising the encrypted session key of an algorithm
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @returns {Array<Object>} The array of types
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @returns {Array<Object>} The array of types
|
||||
*/
|
||||
export function getEncSessionKeyParamTypes(algo) {
|
||||
switch (algo) {
|
||||
|
@ -253,9 +250,9 @@ export function getEncSessionKeyParamTypes(algo) {
|
|||
|
||||
/**
|
||||
* Convert params to MPI and serializes them in the proper order
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Object} params The key parameters indexed by name
|
||||
* @returns {Uint8Array} The array containing the MPIs
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Object} params The key parameters indexed by name
|
||||
* @returns {Uint8Array} The array containing the MPIs
|
||||
*/
|
||||
export function serializeKeyParams(algo, params) {
|
||||
const orderedParams = Object.keys(params).map(name => {
|
||||
|
@ -267,10 +264,10 @@ export function serializeKeyParams(algo, params) {
|
|||
|
||||
/**
|
||||
* Generate algorithm-specific key parameters
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Integer} bits Bit length for RSA keys
|
||||
* @param {module:type/oid} oid Object identifier for ECC keys
|
||||
* @returns { publicParams, privateParams: {Object} } The parameters referenced by name
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Integer} bits Bit length for RSA keys
|
||||
* @param {module:type/oid} oid Object identifier for ECC keys
|
||||
* @returns {{ publicParams: {Object}, privateParams: {Object} }} The parameters referenced by name
|
||||
* @async
|
||||
*/
|
||||
export function generateParams(algo, bits, oid) {
|
||||
|
@ -312,10 +309,10 @@ export function generateParams(algo, bits, oid) {
|
|||
|
||||
/**
|
||||
* Validate algorithm-specific key parameters
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Object} publicParams Algorithm-specific public key parameters
|
||||
* @param {module:enums.publicKey} algo The public key algorithm
|
||||
* @param {Object} publicParams Algorithm-specific public key parameters
|
||||
* @param {Object} privateParams Algorithm-specific private key parameters
|
||||
* @returns {Promise<Boolean>} whether the parameters are valid
|
||||
* @returns {Promise<Boolean>} Whether the parameters are valid
|
||||
* @async
|
||||
*/
|
||||
export async function validateParams(algo, publicParams, privateParams) {
|
||||
|
@ -360,8 +357,8 @@ export async function validateParams(algo, publicParams, privateParams) {
|
|||
/**
|
||||
* Generates a random byte prefix for the specified algorithm
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.
|
||||
* @param {module:enums.symmetric} algo Symmetric encryption algorithm
|
||||
* @returns {Uint8Array} Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.
|
||||
* @param {module:enums.symmetric} algo Symmetric encryption algorithm
|
||||
* @returns {Uint8Array} Random bytes with length equal to the block size of the cipher, plus the last two bytes repeated.
|
||||
* @async
|
||||
*/
|
||||
export async function getPrefixRandom(algo) {
|
||||
|
@ -373,8 +370,8 @@ export async function getPrefixRandom(algo) {
|
|||
/**
|
||||
* Generating a session key for the specified symmetric algorithm
|
||||
* See {@link https://tools.ietf.org/html/rfc4880#section-9.2|RFC 4880 9.2} for algorithms.
|
||||
* @param {module:enums.symmetric} algo Symmetric encryption algorithm
|
||||
* @returns {Uint8Array} Random bytes as a string to be used as a key
|
||||
* @param {module:enums.symmetric} algo Symmetric encryption algorithm
|
||||
* @returns {Uint8Array} Random bytes as a string to be used as a key
|
||||
* @async
|
||||
*/
|
||||
export function generateSessionKey(algo) {
|
||||
|
|
|
@ -2017,7 +2017,7 @@ zUdJ3Sg6Eu+OC2ae5II63iB5fG+lCwZtfuepWnePDv8RDKNHCVP/LoBNpGOZ
|
|||
U9I6AUkZWdcsueib9ghKDDy+HbUbf2kCJWUnuyeOCKqQifDb8bsLmdQY4Wb6
|
||||
EBeLgD8oZHVsH3NLjPakPw==
|
||||
=STqy
|
||||
-----END PGP MESSAGE-----`
|
||||
-----END PGP MESSAGE-----`;
|
||||
|
||||
function versionSpecificTests() {
|
||||
it('Preferences of generated key', function() {
|
||||
|
@ -2584,7 +2584,6 @@ function versionSpecificTests() {
|
|||
}
|
||||
|
||||
module.exports = () => describe('Key', function() {
|
||||
let rsaGenStub;
|
||||
let v5KeysVal;
|
||||
let aeadProtectVal;
|
||||
|
||||
|
@ -2614,7 +2613,6 @@ module.exports = () => describe('Key', function() {
|
|||
});
|
||||
|
||||
it('Parsing armored text with RSA key and ECC subkey', async function() {
|
||||
openpgp.config.tolerant = true;
|
||||
const pubKeys = await openpgp.readArmoredKeys(rsa_ecc_pub);
|
||||
expect(pubKeys).to.exist;
|
||||
expect(pubKeys).to.have.length(1);
|
||||
|
|
|
@ -45,66 +45,66 @@ module.exports = () => describe("Keyring", async function() {
|
|||
const subkeyFingerP2 = '2a20c371141e000833848d85f47c5210a8cc2740';
|
||||
const pubkey2 =
|
||||
['-----BEGIN PGP PUBLIC KEY BLOCK-----',
|
||||
'Version: GnuPG v2.0.22 (GNU/Linux)',
|
||||
'',
|
||||
'mQMuBFLVgdQRCACOlpq0cd1IazNjOEpWPZvx/O3JMbdDs3B3iCG0Mo5OUZ8lpKU5',
|
||||
'EslVgTd8IcUU14ZMOO7y91dw0KP4q61b4OIy7oVxzfFfKCC1s0Dc7GTay+qo5afJ',
|
||||
'wbWcgTyCIahTRmi5UepU7xdRHRMlqAclOwY2no8fw0JRQfFwRFCjbMdmvzC/k+Wo',
|
||||
'A42nn8YaSAG2v7OqF3rkYjkv/7iak48PO/l0Q13USAJLIWdHvRTir78mQUsEY0qR',
|
||||
'VoNqz5sMqakzhTvTav07EVy/1xC6GKoWXA9sdB/4r7+blVuu9M4yD40GkE69oAXO',
|
||||
'mz6tG3lRq41S0OSzNyDWtUQgMVF6wYqVxUGrAQDJM5A1rF1RKzFiHdkyy57E8LC1',
|
||||
'SIJyIXWJ0c5b8/olWQf9G5a17fMjkRTC3FO+Z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L5M+nXd7sx4s+M4KZ/MZfI6ZX4lhcoUdAbB9FWiV7',
|
||||
'uNntyeFo8qgGM5at/Q0EsyzMSqbeBxk4bpd5MfYGThn0Ae2xaw3X94KaZ3LjtHo2',
|
||||
'V27FD+jvmmoAj9b1+zcO/pJ8SuojQmcnS4VDVV+Ba5WPTav0LzDdQXyGMZI9PDxC',
|
||||
'jAI2f1HjTuxIt8X8rAQSQdoMIcQRYEjolsXS6iob1eVigyL86hLJjI3VPn6kBCv3',
|
||||
'Tb+WXX+9LgSAt9yvv4HMwBLK33k6IH7M72SqQulZywADBQgAt2xVTMjdVyMniMLj',
|
||||
'Ed4HbUgwyCPkVkcA4zTXqfKu+dAe4dK5tre0clkXZVtR1V8RDAD0zaVyM030e2zb',
|
||||
'zn4cGKDL2dmwk2ZBeXWZDgGKoKvGKYf8PRpTAYweFzol3OUdfXH5SngOylCD4OCL',
|
||||
's4RSVkSsllIWqLpnS5IJFgt6PDVcQgGXo2ZhVYkoLNhWTIEBuJWIyc4Vj20YpTms',
|
||||
'lgHnjeq5rP6781MwAJQnViyJ2SziGK4/+3CoDiQLO1zId42otXBvsbUuLSL5peX4',
|
||||
'v2XNVMLJMY5iSfzbBWczecyapiQ3fbVtWgucgrqlrqM3546v+GdATBhGOu8ppf5j',
|
||||
'7d1A7ohhBBgRCAAJBQJS1YHUAhsMAAoJELqZP8Ku4Yo6SgoBAIVcZstwz4lyA2et',
|
||||
'y61IhKbJCOlQxyem+kepjNapkhKDAQDIDL38bZWU4Rm0nq82Xb4yaI0BCWDcFkHV',
|
||||
'og2umGfGng==',
|
||||
'=v3+L',
|
||||
'-----END PGP PUBLIC KEY BLOCK-----'].join('\n');
|
||||
'Version: GnuPG v2.0.22 (GNU/Linux)',
|
||||
'',
|
||||
'mQMuBFLVgdQRCACOlpq0cd1IazNjOEpWPZvx/O3JMbdDs3B3iCG0Mo5OUZ8lpKU5',
|
||||
'EslVgTd8IcUU14ZMOO7y91dw0KP4q61b4OIy7oVxzfFf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YHUAhsMAAoJELqZP8Ku4Yo6SgoBAIVcZstwz4lyA2et',
|
||||
'y61IhKbJCOlQxyem+kepjNapkhKDAQDIDL38bZWU4Rm0nq82Xb4yaI0BCWDcFkHV',
|
||||
'og2umGfGng==',
|
||||
'=v3+L',
|
||||
'-----END PGP PUBLIC KEY BLOCK-----'].join('\n');
|
||||
const user3 = 'plain@email.org';
|
||||
const keyFingerP3 = 'f9972bf320a86a93c6614711ed241e1de755d53c';
|
||||
const pubkey3 =
|
||||
['-----BEGIN PGP PUBLIC KEY BLOCK-----',
|
||||
'',
|
||||
'xo0EVe6wawEEAKG4LDE9946jdvvbfVTF9qWtOyxHYjb40z7hgcZsPEGd6QfN',
|
||||
'XbfNJBeQ5S9j/2jRu8NwBgdXIpMp4QwB2Q/cEp1rbw5kUVuRbhfsb2BzuiBr',
|
||||
'Q5jHa5oZSGbbLWRoOXTvJH8VE2gbKSj/km1VaXzq2Qmv+YIHxav1it7vNmg5',
|
||||
'E2kBABEBAAHND3BsYWluQGVtYWlsLm9yZ8K1BBABCAApBQJV7rBrBgsJCAcD',
|
||||
'AgkQ7SQeHedV1TwEFQgCCgMWAgECGQECGwMCHgEAAGJmBACVJPoFtW96UkIW',
|
||||
'GX1bgW99c4K87Me+5ZCHqPOdXFpRinAPBdJT9vkBWLb/aOQQCDWJvdVXKFLD',
|
||||
'FCbSBjcohR71n6145F5im8b0XzXnKh+MRRv/0UHiHGtB/Pkg38jbLeXbVfCM',
|
||||
'9JJm+s+PFef+8wN84sEtD/MX2cj61teuPf2VEs6NBFXusGsBBACoJW/0y5Ea',
|
||||
'FH0nJOuoenrEBZkFtGbdwo8A4ufCCrm9ppFHVVnw4uTPH9dOjw8IAnNy7wA8',
|
||||
'8yZCkreQ491em09knR7k2YdJccWwW8mGRILHQDDEPetZO1dSVW+MA9X7Pcle',
|
||||
'wbFEHCIkWEgymn3zenie1LXIljPzizHje5vWBrSlFwARAQABwp8EGAEIABMF',
|
||||
'AlXusGsJEO0kHh3nVdU8AhsMAACB2AP/eRJFAVTyiP5MnMjsSBuNMNBp1X0Y',
|
||||
'+RrWDpO9H929+fm9oFTedohf/Ja5w9hsRk2VzjLOXe/uHdrcgaBmAdFunbvv',
|
||||
'IWneczohBvLOarevZj1J+H3Ej/DVF2W7kJZLpvPfh7eo0biClS/GQUVw1rlE',
|
||||
'ph10hhUaSJ326LsFJccT3jk=',
|
||||
'=4jat',
|
||||
'-----END PGP PUBLIC KEY BLOCK-----'].join('\n');
|
||||
'',
|
||||
'xo0EVe6wawEEAKG4LDE9946jdvvbfVTF9qWtOyxHYjb40z7hgcZsPEGd6QfN',
|
||||
'XbfNJBeQ5S9j/2jRu8NwBgdXIpMp4QwB2Q/cEp1rbw5kUVuRbhfsb2BzuiBr',
|
||||
'Q5jHa5oZSGbbLWRoOXTvJH8VE2gbKSj/km1VaXzq2Qmv+YIHxav1it7vNmg5',
|
||||
'E2kBABEBAAHND3BsYWluQGVtYWlsLm9yZ8K1BBABCAApBQJV7rBrBgsJCAcD',
|
||||
'AgkQ7SQeHedV1TwEFQgCCgMWAgECGQECGwMCHgEAAGJmBACVJPoFtW96UkIW',
|
||||
'GX1bgW99c4K87Me+5ZCHqPOdXFpRinAPBdJT9vkBWLb/aOQQCDWJvdVXKFLD',
|
||||
'FCbSBjcohR71n6145F5im8b0XzXnKh+MRRv/0UHiHGtB/Pkg38jbLeXbVfCM',
|
||||
'9JJm+s+PFef+8wN84sEtD/MX2cj61teuPf2VEs6NBFXusGsBBACoJW/0y5Ea',
|
||||
'FH0nJOuoenrEBZkFtGbdwo8A4ufCCrm9ppFHVVnw4uTPH9dOjw8IAnNy7wA8',
|
||||
'8yZCkreQ491em09knR7k2YdJccWwW8mGRILHQDDEPetZO1dSVW+MA9X7Pcle',
|
||||
'wbFEHCIkWEgymn3zenie1LXIljPzizHje5vWBrSlFwARAQABwp8EGAEIABMF',
|
||||
'AlXusGsJEO0kHh3nVdU8AhsMAACB2AP/eRJFAVTyiP5MnMjsSBuNMNBp1X0Y',
|
||||
'+RrWDpO9H929+fm9oFTedohf/Ja5w9hsRk2VzjLOXe/uHdrcgaBmAdFunbvv',
|
||||
'IWneczohBvLOarevZj1J+H3Ej/DVF2W7kJZLpvPfh7eo0biClS/GQUVw1rlE',
|
||||
'ph10hhUaSJ326LsFJccT3jk=',
|
||||
'=4jat',
|
||||
'-----END PGP PUBLIC KEY BLOCK-----'].join('\n');
|
||||
|
||||
it('Import key pair', async function() {
|
||||
await keyring.load();
|
||||
|
|
|
@ -173,7 +173,7 @@ module.exports = () => (openpgp.config.ci ? describe.skip : describe)('X25519 Cr
|
|||
const signed = await openpgp.sign({ privateKeys: [priv], message: openpgp.CleartextMessage.fromText(randomData)});
|
||||
const pub = await load_pub_key(name);
|
||||
const msg = await openpgp.readArmoredCleartextMessage(signed);
|
||||
const result = await openpgp.verify({ publicKeys: [pub], message: msg});
|
||||
const result = await openpgp.verify({ publicKeys: [pub], message: msg });
|
||||
|
||||
expect(result).to.exist;
|
||||
expect(result.data).to.equal(randomData.replace(/[ \t]+$/mg, ''));
|
||||
|
@ -392,7 +392,6 @@ module.exports = () => (openpgp.config.ci ? describe.skip : describe)('X25519 Cr
|
|||
].join('\n');
|
||||
const hi = await openpgp.readArmoredKey(pubKey);
|
||||
const results = await hi.getPrimaryUser();
|
||||
// console.log(results);
|
||||
expect(results).to.exist;
|
||||
expect(results.user).to.exist;
|
||||
const user = results.user;
|
||||
|
|
Loading…
Reference in New Issue
Block a user