From c4029f6af22b373bf22383453cb4e2159f3b5b72 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Thu, 9 Nov 2023 09:56:59 -0800 Subject: fix(node): implement createPrivateKey (#20981) Towards #18455 --- ext/node/polyfills/internal/crypto/cipher.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ext/node/polyfills/internal/crypto/cipher.ts') diff --git a/ext/node/polyfills/internal/crypto/cipher.ts b/ext/node/polyfills/internal/crypto/cipher.ts index cf1641326..5fec98ff0 100644 --- a/ext/node/polyfills/internal/crypto/cipher.ts +++ b/ext/node/polyfills/internal/crypto/cipher.ts @@ -28,7 +28,7 @@ import { isArrayBufferView, } from "ext:deno_node/internal/util/types.ts"; -function isStringOrBuffer(val) { +export function isStringOrBuffer(val) { return typeof val === "string" || isArrayBufferView(val) || isAnyArrayBuffer(val); @@ -456,7 +456,7 @@ export function publicEncrypt( return ops.op_node_public_encrypt(data, buffer, padding); } -function prepareKey(key) { +export function prepareKey(key) { // TODO(@littledivy): handle these cases // - node KeyObject // - web CryptoKey @@ -485,5 +485,6 @@ export default { publicEncrypt, Cipheriv, Decipheriv, + prepareKey, getCipherInfo, }; -- cgit v1.2.3