Skip to content

Commit

Permalink
Merge pull request #632 from lots0logs/patch-1
Browse files Browse the repository at this point in the history
Use the correct class name for in-memory keys in documentation
  • Loading branch information
lcobucci committed Jan 28, 2021
2 parents d4bfa6b + 137a65d commit b80c487
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/configuration.md
Expand Up @@ -19,7 +19,7 @@ In order to use it, you must:

### Configuration initialisation

The `Lcobucci\JWT\Signer\Key` object is used for symmetric/asymmetric signature.
The `Lcobucci\JWT\Signer\Key\InMemory` object is used for symmetric/asymmetric signature.

To initialise it, you can pass the key content as a plain text:

Expand Down Expand Up @@ -83,13 +83,17 @@ use Lcobucci\JWT\Signer\Key\InMemory;

$configuration = Configuration::forAsymmetricSigner(
// You may use RSA or ECDSA and all their variations (256, 384, and 512)
new Signer\RSA\Sha256(),
new Signer\Rsa\Sha256(),
LocalFileReference::file(__DIR__ . '/my-private-key.pem'),
InMemory::base64Encoded('mBC5v1sOKVvbdEitdSBenu59nfNfhwkedkJVNabosTw=')
// You may also override the JOSE encoder/decoder if needed by providing extra arguments here
);
```

!!! Important
The implementation of ECDSA algorithms have a constructor dependency.
Use the `create()` named constructor to avoid having to handle it (e.g.: `Lcobucci\JWT\Signer\Ecdsa\Sha256::create()`).

#### For no algorithm

!!! Warning
Expand Down

0 comments on commit b80c487

Please sign in to comment.