From 65db8814c31464f2bc2a04dd5ffbaa71361c9f80 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 11 Aug 2023 13:04:23 +0530 Subject: fix(node): object keys in publicEncrypt (#20128) Fixes https://github.com/denoland/deno/issues/19935 --- cli/tests/unit_node/crypto/crypto_cipher_test.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cli/tests/unit_node/crypto/crypto_cipher_test.ts') diff --git a/cli/tests/unit_node/crypto/crypto_cipher_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_test.ts index a8a5130cf..417f5035c 100644 --- a/cli/tests/unit_node/crypto/crypto_cipher_test.ts +++ b/cli/tests/unit_node/crypto/crypto_cipher_test.ts @@ -33,6 +33,21 @@ Deno.test({ }, }); +Deno.test({ + name: "rsa public encrypt (options) and private decrypt", + fn() { + const encrypted = crypto.publicEncrypt( + { key: Buffer.from(rsaPublicKey) }, + input, + ); + const decrypted = crypto.privateDecrypt( + Buffer.from(rsaPrivateKey), + Buffer.from(encrypted), + ); + assertEquals(decrypted, input); + }, +}); + Deno.test({ name: "rsa private encrypt and private decrypt", fn() { -- cgit v1.2.3