pyjwt
pyjwt copied to clipboard
Handle load_pem_public_key ValueError
This is a stab at addressing the issue discussed here: Consider cryptography 42.x.x new validation #948
All I did is raise a InvalidKeyError
when there is a ValueError and return cast(RSAPublicKey, load_pem_public_key(key_bytes))
fails.