From 27a7f1d4f35b662426ff0270526d48658da4c8b7 Mon Sep 17 00:00:00 2001 From: Eduardo Diaz Date: Tue, 23 May 2017 11:35:20 +0200 Subject: [PATCH] readme: Using private key with passpharase (#353) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 608660f..68f0e7d 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,8 @@ $ npm install jsonwebtoken `payload` could be an object literal, buffer or string. *Please note that* `exp` is only set if the payload is an object literal. -`secretOrPrivateKey` is a string or buffer containing either the secret for HMAC algorithms, or the PEM -encoded private key for RSA and ECDSA. +`secretOrPrivateKey` is a string, buffer, or object containing either the secret for HMAC algorithms or the PEM +encoded private key for RSA and ECDSA. In case of a private key with passphrase an object `{ key, passphrase }` can be used (based on [crypto documentation](https://nodejs.org/api/crypto.html#crypto_sign_sign_private_key_output_format)), in this case be sure you pass the `algorithm` option. `options`: