codercat/jwk-to-pem
Convert RSA JSON Web Keys (JWK) to PEM public keys in PHP. Simple API via JWKConverter->toPEM() for turning JWK arrays into PEM strings, useful for verifying JWT signatures. Note: currently supports RSA keys only.
Adopt if:
phpseclib) is acceptable.Look elsewhere if:
web-token/jwt-framework (more comprehensive) or custom implementations using openssl functions.multipleToPEM method was removed; implement a loop if required)."This package lets us standardize cryptographic key formats across our Laravel services without building custom logic. By converting JWKs (used by modern identity providers) to PEM (required by legacy systems/OpenSSL), we reduce integration friction for authentication flows, API security, and compliance. It’s a lightweight, MIT-licensed solution that cuts dev time by ~2–3 days for a critical but repetitive task. The trade-off is limited to RSA keys (which covers 90% of our use cases), and we can mitigate risks by wrapping it in our crypto service layer."
*"Pros:
phpseclib (already in many Laravel stacks).$converter->toPEM($jwk) handles the heavy lifting.Cons/Risks:
web-token/jwt-framework).composer.json with allow-plugins or a private fork.openssl_pkey_get_public() or similar.Recommendation: Use this for JWK-to-PEM conversion in auth flows (e.g., OAuth token validation) and plan to monitor for forks or alternatives if multi-key support becomes a need."*
How can I help you explore Laravel packages today?