From dfe1fba8dabaa83957da98690bb70fe8458c020f Mon Sep 17 00:00:00 2001 From: Tekin Tian Date: Sun, 16 Dec 2018 13:21:19 +0800 Subject: [PATCH 1/2] Update README.md add the openssl key make method. ~~~shell # get the private and public key with openssl openssl genrsa -out private.key 2048 openssl rsa -in private.key -pubout > pubkey.key # get private and pub key with ssh-keygen ssh-keygen -t rsa -b 2048 -C "yourname@gmail.com" openssl rsa -in id_rsa -pubout > id_rsa_pub.key ~~~ --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index b1a7a3a2..4aeda38a 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,18 @@ $decoded = JWT::decode($jwt, $key, array('HS256')); ?> ``` Example with RS256 (openssl) + +~~~shell +# get the private and public key with openssl +openssl genrsa -out private.key 2048 +openssl rsa -in private.key -pubout > pubkey.key + +# get private and pub key with ssh-keygen +ssh-keygen -t rsa -b 2048 -C "yourname@gmail.com" +openssl rsa -in id_rsa -pubout > id_rsa_pub.key + +~~~ + ---------------------------- ```php Date: Sun, 16 Dec 2018 13:26:27 +0800 Subject: [PATCH 2/2] Update README.md change the demo openssl key with 2048 encrypt --- README.md | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4aeda38a..830f1b19 100644 --- a/README.md +++ b/README.md @@ -80,28 +80,43 @@ use \Firebase\JWT\JWT; $privateKey = <<