KemalIdentity::JWT::RSAPublicKey
An RSA public key, held as a live EVP_PKEY.
Why the key is built as DER
A JWKS gives a modulus and an exponent as two base64url integers, and OpenSSL has no
"assemble a key from these two numbers" call that survives 3.x: the RSA_new /
RSA_set0_key route is deprecated there, and EVP_PKEY_fromdata is 3.0-only, which would
make this shard refuse to build against 1.1.1. What is stable in both is d2i_PUBKEY, so
the two integers are encoded into a DER SubjectPublicKeyInfo — about forty lines of ASN.1 —
and parsed back by OpenSSL itself. OpenSSL validates the structure; this code only writes it.
Constants
Smallest modulus accepted, in bytes.
2048 bits. Anything smaller is not a key an issuer should still be signing with, and accepting one means the weakest key in a rotating JWKS sets the security of the whole thing.
DER for AlgorithmIdentifier { rsaEncryption, NULL }, which is the same bytes for every
RSA key: SEQUENCE { OID 1.2.840.113549.1.1.1, NULL }.
Constructors
Instance methods
Whether signature is a PKCS#1 v1.5 signature over data under this key.
Returns false for anything that does not verify, including a malformed signature:
everything reaching here is attacker-supplied, so nothing about it may raise.