diff --git a/src/core/operations/GeneratePGPKeyPair.mjs b/src/core/operations/GeneratePGPKeyPair.mjs index 7176d526..bb366b6f 100644 --- a/src/core/operations/GeneratePGPKeyPair.mjs +++ b/src/core/operations/GeneratePGPKeyPair.mjs @@ -33,7 +33,7 @@ class GeneratePGPKeyPair extends Operation { { "name": "Key type", "type": "option", - "value": ["RSA-1024", "RSA-2048", "RSA-4096", "ECC-256", "ECC-384"] + "value": ["RSA-1024", "RSA-2048", "RSA-4096", "ECC-256", "ECC-384", "ECC-521"] }, { "name": "Password (optional)", @@ -59,12 +59,15 @@ class GeneratePGPKeyPair extends Operation { * @returns {string} */ async run(input, args) { - const [keyType, keySize] = args[0].split("-"), - password = args[1], + let [keyType, keySize] = args[0].split("-"); + const password = args[1], name = args[2], email = args[3]; let userIdentifier = ""; + keyType = keyType.toLowerCase(); + keySize = parseInt(keySize, 10); + if (name) userIdentifier += name; if (email) userIdentifier += ` <${email}>`; diff --git a/tests/node/tests/operations.mjs b/tests/node/tests/operations.mjs index 0a9d74e4..bc4ccb56 100644 --- a/tests/node/tests/operations.mjs +++ b/tests/node/tests/operations.mjs @@ -588,7 +588,7 @@ Password: 034148`; const result = await chef.generatePGPKeyPair("Back To the Drawing Board", { keyType: "ECC-256", }); - assert.strictEqual(result.toString().length, 2007); + assert.strictEqual(result.toString().length, 2560); }), it("Generate UUID", () => {