From 8a8e5c775b8955849ea18a512ad2edc519fd755f Mon Sep 17 00:00:00 2001 From: Jeremy Huang Date: Mon, 16 Oct 2017 16:16:58 +0800 Subject: [PATCH] doc: add return values in crypto documentation Clarify return values for crypto.publicEncrypt and similar functions PR-URL: https://github.com/nodejs/node/pull/16229 Fixes: https://github.com/nodejs/node/issues/12946 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Gireesh Punathil --- doc/api/crypto.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 001b16584621fc..fb4a667fff0035 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1633,6 +1633,7 @@ 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} A new `Buffer` with the decrypted content. Decrypts `buffer` with `privateKey`. @@ -1650,6 +1651,7 @@ added: v1.1.0 `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `RSA_PKCS1_PADDING`. - `buffer` {Buffer | TypedArray | DataView} +- Returns: {Buffer} A new `Buffer` with the encrypted content. Encrypts `buffer` with `privateKey`. @@ -1667,6 +1669,7 @@ added: v1.1.0 `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `RSA_PKCS1_PADDING`. - `buffer` {Buffer | TypedArray | DataView} +- Returns: {Buffer} A new `Buffer` with the decrypted content. Decrypts `buffer` with `publicKey`. @@ -1687,6 +1690,7 @@ 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} A new `Buffer` with the encrypted content. Encrypts the content of `buffer` with `publicKey` and returns a new [`Buffer`][] with encrypted content.