SAML-Toolkits / ruby-saml

SAML SSO for Ruby
MIT License
921 stars 567 forks source link

Using ECDSA private key causes OpenSSL::PKey::RSAError #661

Open bojan-drljaca-lu opened 1 year ago

bojan-drljaca-lu commented 1 year ago

Looks like only RSA private key type can be used since ECDSA private key is not supported and exception OpenSSL::PKey::RSAError is raised with error message Neither PUB key nor PRIV key: nested asn1 error. I'm trying to do SAML request signing and there is no option to change this and line of code that breaks in a gem is OpenSSL::PKey::RSA.new(formatted_private_key) in lib/onelogin/ruby-saml/settings.rb and method is get_sp_key. Is there a possibility to change this since OpenSSL library does support reading different key reference https://docs.ruby-lang.org/en/2.4.0/OpenSSL/PKey.html The PKey module offers support for three popular public/private key algorithms:

johnnyshields commented 4 months ago

@bojan-drljaca-lu This is now supported experimentally in https://github.com/SAML-Toolkits/ruby-saml/pull/705. I'm still working on the test cases.

johnnyshields commented 4 months ago

@bojan-drljaca-lu please try my #705 branch its ready for testing.

pitbulk commented 4 months ago

@bojan-drljaca-lu let us know how your test goes