What's Changed
Added
- Support for the RFC 9864 fully-specified EdDSA algorithms
Ed25519andEd448(#69)Ed25519uses the same libsodium keys and signatures as the existingEdDSAsupport — only the token'salgheader differs, so it needs thesodiumextension too.Ed448is EdDSA over Curve448 and runs on OpenSSL instead of Sodium. It requires PHP 8.4 or later; on older versions, constructingEd448PrivateKey/Ed448PublicKeythrows.
Changed
- The EdDSA signer and verifier now throw
SigningException/InvalidSignatureExceptioninstead ofRuntimeExceptionwhen the Sodium functions are unavailable, so every failure stays inside theJwtExceptionhierarchy (#68) - RSA-PSS verification raises one shared "The signature is not valid." message on every inconsistency, so the outcome reveals nothing about which check failed (#68)
- Internal maintainability cleanups surfaced by SonarQube (#68)
Documentation
- README sections and runnable examples for both new algorithms —
examples/ed25519.phpandexamples/ed448.php(#69) docs/ARCHITECTURE.md,docs/ADDING_AN_ALGORITHM.md, anddocs/TESTING.mdupdated for the Curve448 path (#69)
Tests
- Unit, example, and cross-library interop coverage for
Ed25519andEd448(#69) - RSA-PSS encode vectors now pin
emBitsand the MGF1 masking behaviour, killing the last surviving mutants (#70)
CI & Tooling
- Scrutinizer replaced with SonarQube Cloud automatic analysis, plus stricter phpcs and PHPStan (level 10) configuration (#67)
- GitHub Actions pinned to full commit SHAs (#67)
Upgrading
Existing EdDSA tokens remain valid and keep verifying — adopt Ed25519 only if you want the RFC 9864 alg name.
One nuance: on the "Sodium functions unavailable" path the EdDSA signer and verifier no longer throw RuntimeException. If you catch that type there, catch JwtException instead.
Full Changelog: v3.3.1...v3.4.0