Description
Hey there :)
We were having a bit of trouble generating RSA keys from JSON Web Keys (JWK, RFC 7517).
Linking the original issue: jwt/ruby-jwt#523
We had this working fine with earlier versions of OpenSSL, where we were able to use functions like set_key
on a new instance of OpenSSL::PKey::RSA
.
With OpenSSL 3 the API has changed though, so this is no longer an option.
We are looking for guidance on how to implement parsing an (especially private) RSA key from the parameters alone.
A temporary solution we had consisted of parsing the key into ASN.1, then have it exported as DER and read by this gem, but the problem we are facing with this solution is that a private RSA JWK may in some cases only include the modulus and both exponents, rather than all CRT values present in the RFC 3447 ASN.1 description of a private key.
I apologize in advance, should I have overlooked some obvious API functionality. If you have some pointers for us, please let us know :)