The JWS object, signature algorithms and token serializers are part of the signature component (web-token/jwt-signature
). Claim and header checkers are decoupled and can be found in the checker component (web-token/jwt-checker
).
Why are signature and checker components not together? The main reason is that when you issue signed tokens, you do not need any checker. Those components are decoupled to avoid the installation of unnecessary files.
The signature and loading processes have been completely reviewed.
In the examples below, we suppose we already have a JWK object ($key
).
Before
After
Before
After
Please note that it is important to check the token header before the verification of the signature. It will help you to reject tokens signed with unsupported algorithms.