From 96b51d233944f35f582b9671844764f743dce84e Mon Sep 17 00:00:00 2001 From: Faiz Halde Date: Wed, 10 May 2017 12:41:54 +0530 Subject: [PATCH] doc: update doc of publicEncrypt method As per https://github.com/nodejs/node/issues/12946 the crypto doc for publicEncrypt doesn't tell you whether the encryption happens in place or not. Fixes: https://github.com/nodejs/node/issues/12946 PR-URL: https://github.com/nodejs/node/pull/12947 Reviewed-By: Brian White Reviewed-By: Daniel Bevenius Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Gibson Fahnestock --- doc/api/crypto.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 68a905ae1d8fab..d4af17c9988ff8 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1637,7 +1637,7 @@ treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`. -- `private_key` {Object | string} +- `public_key` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1657,7 +1657,7 @@ be passed instead of a public key. -- `private_key` {Object | string} +- `public_key` {Object | string} - `key` {string} A PEM encoded private key. - `passphrase` {string} An optional passphrase for the private key. - `padding` {crypto.constants} An optional padding value defined in @@ -1665,7 +1665,8 @@ added: v0.11.14 `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. - `buffer` {Buffer | TypedArray | DataView} -Encrypts `buffer` with `public_key`. +Encrypts the content of `buffer` with `public_key` and returns a new +[`Buffer`][] with encrypted content. `public_key` can be an object or a string. If `public_key` is a string, it is treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.