From 29dbf824638d72d814244598c07d6e34aadf0644 Mon Sep 17 00:00:00 2001 From: Jeremy Huang Date: Mon, 16 Oct 2017 16:16:58 +0800 Subject: [PATCH 1/2] doc: clarify documentation in crypto Clarify on the return values for crypto.publicEncrypt and similar functions Fixes: https://github.com/nodejs/node/issues/12946 --- doc/api/crypto.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index fd2213f8b5527e..8655fd9c93629f 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1687,12 +1687,15 @@ added: v0.11.14 `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. - `buffer` {Buffer | TypedArray | DataView} +- Returns: {Buffer} Decrypts `buffer` with `privateKey`. `privateKey` can be an object or a string. If `privateKey` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`. +Returns a new `Buffer` with the decrypted content. + ### crypto.privateEncrypt(privateKey, buffer)