diff --git a/lib/key/check.ts b/lib/key/check.ts index 9a5d135a..5b34d15f 100644 --- a/lib/key/check.ts +++ b/lib/key/check.ts @@ -69,7 +69,8 @@ export function checkKeyCompatibility(publicKey: PublicKey) { enums.curve.p521, enums.curve.brainpoolP256r1, enums.curve.brainpoolP384r1, - enums.curve.brainpoolP512r1 + enums.curve.brainpoolP512r1, + enums.curve.secp256k1 ]); if (publicKey.keyPacket.version > 5) { @@ -82,7 +83,7 @@ export function checkKeyCompatibility(publicKey: PublicKey) { const keyAlgo = enums.write(enums.publicKey, keyInfo.algorithm); if (!supportedPublicKeyAlgorithms.has(keyAlgo)) { - throw new Error('The key algorithm is currently not supported.'); + throw new Error(`The key algorithm ${keyInfo.algorithm} is currently not supported.`); } if (keyInfo.curve && !supportedCurves.has(keyInfo.curve)) { diff --git a/test/key/check.spec.ts b/test/key/check.spec.ts index 6ef0d0ae..26331dc8 100644 --- a/test/key/check.spec.ts +++ b/test/key/check.spec.ts @@ -93,7 +93,7 @@ Gw0vQaiZn6HGITQw5nBGvXQPF9VpFpsXV9x/08dIdfZLAQVdQowgeBsxCw== -----END PGP PUBLIC KEY BLOCK-----` }); expect( () => checkKeyCompatibility(key) - ).to.throw(/key algorithm is currently not supported/); + ).to.throw(/key algorithm ed25519 is currently not supported/); }); it('compatibility - it rejects a v6 key', async () => {