Add notes about RSA in README

This commit is contained in:
Vincent Prouillet 2017-04-14 18:15:06 +09:00
parent d144227256
commit 7ebceb1b4a
1 changed files with 14 additions and 0 deletions

View File

@ -88,3 +88,17 @@ This library currently supports the following:
- RS256
- RS384
- RS512
### RSA
`jsonwebtoken` can only read DER encoded keys currently. If you have openssl installed,
you can run the following commands to obtain the DER keys from .pem:
```bash
// private key
$ openssl rsa -in private_rsa_key.pem -outform DER -out private_rsa_key.der
// public key
$ openssl rsa -in private_rsa_key.der -inform DER -RSAPublicKey_out -outform DER -out public_key.der
```
If you are getting an error with your public key, make sure you get it by using the command above to ensure
it is in the right format.