summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/crypto/crypto_cipher_test.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-08-11 13:04:23 +0530
committerGitHub <noreply@github.com>2023-08-11 07:34:23 +0000
commit65db8814c31464f2bc2a04dd5ffbaa71361c9f80 (patch)
tree1a8230d06a85dc03e84ad8ecda6646d2382f52b5 /cli/tests/unit_node/crypto/crypto_cipher_test.ts
parent634f5ccd49d3b998a9b96af2ad8c4d0ed2235700 (diff)
fix(node): object keys in publicEncrypt (#20128)
Fixes https://github.com/denoland/deno/issues/19935
Diffstat (limited to 'cli/tests/unit_node/crypto/crypto_cipher_test.ts')
-rw-r--r--cli/tests/unit_node/crypto/crypto_cipher_test.ts15
1 files changed, 15 insertions, 0 deletions
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
@@ -34,6 +34,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() {
const encrypted = crypto.privateEncrypt(rsaPrivateKey, input);