From 2c25e6ce0715de88b1398e9f9b49462d897eb005 Mon Sep 17 00:00:00 2001 From: Milad Rahimi Date: Thu, 23 Nov 2023 14:57:35 +0100 Subject: [PATCH] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 18a723e..a89d0c3 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ use MiladRahimi\Jwt\Generator; use MiladRahimi\Jwt\Parser; // Generate a token -$privateKey = base64_decode(file_get_contents('/path/to/ed25519.sec')); +$privateKey = new EdDsaPrivateKey(base64_decode(file_get_contents('/path/to/ed25519.sec'))); $signer = new EdDsaSigner($privateKey); $generator = new Generator($signer); $jwt = $generator->generate(['id' => 13, 'is-admin' => true]); @@ -144,7 +144,7 @@ $jwt = $generator->generate(['id' => 13, 'is-admin' => true]); print_r($jwt); // "abc.123.xyz" // Parse the token -$publicKey = base64_decode(file_get_contents('/path/to/ed25519.pub')); +$publicKey = new EdDsaPublicKey(base64_decode(file_get_contents('/path/to/ed25519.pub'))); $verifier = new EdDsaVerifier($publicKey); $parser = new Parser($verifier); $claims = $parser->parse($jwt);