summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit_node')
-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);