You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenSSL::PKey::PKey subclass for EVP_PKEY_RSA_PSS #715
I had the same problem, see #562, to open a key and got the error OpenSSL::PKey::RSAError: incorrect pkey type: RSASSA-PSS.
So I used the mentioned method and called OpenSSL::PKey.read.
But now I have a problem to sign a JWT with the algorithm RSASSA-PSS:
JWT.encode({},key,"ps256")# This returns:# NoMethodError: undefined method `sign_pss' for #<OpenSSL::PKey::PKey oid=RSASSA-PSS>
Activity
rhenium commentedon Jan 17, 2024
You can currently use
OpenSSL::PKey::PKey#signto do RSA-PSS without needing theRSA#sign_pss. The test code may be useful for you today:openssl/test/openssl/test_pkey_rsa.rb
Lines 96 to 116 in 9569999
rhenium commentedon Jan 17, 2024
I wonder if we could add a PKey class for
EVP_PKEY_RSA_PSS. I think#sign_pssand#verify_pssshould just work on the pkey object decoded from PKCS#8.EVP_PKEY_RSA_PSSseems to be just a variant ofEVP_PKEY_RSAthat contains default parameters for RSA-PSS and is locked to RSA-PSS operations.[-]Problem to sign a JWT with RSASSA-PSS key[/-][+]OpenSSL::PKey::PKey subclass for EVP_PKEY_RSA_PSS[/+]trkoch commentedon Jan 19, 2024
I'm having the same issue. I'm trying to sign a JWT with a RSASSA-PSS1 private key (created with
openssl req -newkey rsa-pss).Not sure I follow the suggestion. Using
#signinstead of#sign_pssdoes not work.Throws:
@Anstuhrm Did you mange to work around this?
trkoch commentedon Jan 19, 2024
It does seem to work with:
I have no idea what I'm doing here, frankly. Can someone elaborate?