Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion types/node/crypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ declare module "node:crypto" {
* and it will be impossible to extract the private key from the returned object.
* @since v11.6.0
*/
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | BinaryLike): KeyObject;
function createPublicKey(key: PublicKeyInput | RawPublicKeyInput | JsonWebKeyInput | KeyLike): KeyObject;
/**
* Creates and returns a new key object containing a secret key for symmetric
* encryption or `Hmac`.
Expand Down
5 changes: 5 additions & 0 deletions types/node/node-tests/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,11 @@ import { promisify } from "node:util";
});
}

{
let privateKey!: crypto.KeyObject;
crypto.createPublicKey(privateKey);
}

{
crypto.createSecretKey(Buffer.from("asdf"));
crypto.createSecretKey(new Uint8Array(128));
Expand Down