Skip to content

Could not parse valid public key #176

Closed
@Chilinot

Description

@Chilinot

Hello, im having issues with parsing public keys that I know are valid. The only error message i get says ArgumentError: Could not parse PKey.

Im using the jruby:9.2.0-jdk-alpine docker image to run my application.

Below is the output from pry that contains both the valid key, and the error message when I try to parse the key:

[3] pry(AuthVerifier)> File.read(path)
=> "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArTlm5TxJp3WHMNmWIfo/\nWvkyhJCXc1S78Y9B8lSXxXnkRqX8Twxu5EkdUP0TwgD5gp0TGy7UPm/SgWlQOcqX\nqtdOWq/Hk29Ve9z6k6wTmst7NTefmm/7OqkeYmBhfhoECLCKBADM8ctjoqD63R0e\n3bUW2knq6vCS5YMmD76/5UoU647BzB9CjgDzjuTKEbXL5AvcO5wWDgHSp7CA+2t4\nIFQvQMrPso5mvm2hNvD19vI0VjiY21rKgkJQAXSrLgkJg/fTL2wQiz10d2GnYsmx\nDeJCiBMwC+cmRW2eWePqaCPaWJwr92KsIiry+LgyGb3y01SUVV8kQgQXazutHqfu\ncQIDAQAB\n-----END PUBLIC KEY-----\n"
[4] pry(AuthVerifier)> OpenSSL::PKey.read(File.read(path))
ArgumentError: Could not parse PKey
from org/jruby/ext/openssl/PKey.java:176:in `read'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions