diff --git a/README.md b/README.md index d489c69f..34c5e6b6 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,18 @@ JWT::$leeway = 60; // $leeway in seconds $decoded = JWT::decode($jwt, new Key($key, '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 use Firebase\JWT\JWT; @@ -73,28 +85,43 @@ use Firebase\JWT\Key; $privateKey = <<