Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL::PKey::PKeyError when using PEM private key #17

Open
adicaff opened this issue Feb 1, 2022 · 0 comments
Open

OpenSSL::PKey::PKeyError when using PEM private key #17

adicaff opened this issue Feb 1, 2022 · 0 comments

Comments

@adicaff
Copy link

adicaff commented Feb 1, 2022

stack:
Ruby 2.7.0
rails 6.0.3.5
openssl 2.2.1
jose 1.1.3

While doing JOSE::JWK.from_pem_file(private_key) i got:
Could not parse PKey: no start line (OpenSSL::PKey::PKeyError)

error is in jose-1.1.3/lib/jose/jwk/pem.rb:6:

and trace:

3: from jose-1.1.3/lib/jose/jwk.rb:247:in `from_pem_file'
2: from jose-1.1.3/lib/jose/jwk.rb:237:in `from_pem'
1: from jose-1.1.3/lib/jose/jwk/pem.rb:6:in `from_binary'

The private key is OK, I have tested it using clients software and I can perfectly decrypt payloads. This error comes up only when using the gem on rails project.
Any sights on what can be happening? Any possible solution?
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant