Skip to content

Commit

Permalink
address nits
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 2, 2021
1 parent 5ca795c commit 44d49e0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion doc/api/crypto.md
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ added: v11.6.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/37081
description: Added support for `'jwk' format`.
description: Added support for `'jwk'` format.
-->

* `options`: {Object}
Expand Down
9 changes: 5 additions & 4 deletions test/parallel/test-crypto-key-objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,10 +659,10 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
// SecretKeyObject export buffer format (default)
const buffer = Buffer.from('Hello World');
const keyObject = createSecretKey(buffer);
assert(buffer.equals(keyObject.export()));
assert(buffer.equals(keyObject.export({})));
assert(buffer.equals(keyObject.export({ format: 'buffer' })));
assert(buffer.equals(keyObject.export({ format: undefined })));
assert.deepStrictEqual(keyObject.export(), buffer);
assert.deepStrictEqual(keyObject.export({}), buffer);
assert.deepStrictEqual(keyObject.export({ format: 'buffer' }), buffer);
assert.deepStrictEqual(keyObject.export({ format: undefined }), buffer);
}

{
Expand All @@ -681,6 +681,7 @@ const privateDsa = fixtures.readKey('dsa_private_encrypted_1025.pem',
// Find an unsupported curve regardless of whether a FIPS compliant crypto
// provider is currently in use.
const namedCurve = getCurves().find((curve) => !supported.includes(curve));
assert(namedCurve);
const keyPair = generateKeyPairSync('ec', { namedCurve });
const { publicKey, privateKey } = keyPair;
assert.throws(
Expand Down

0 comments on commit 44d49e0

Please sign in to comment.