-
-
Notifications
You must be signed in to change notification settings - Fork 694
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
"Could not deserialize key data" #257
Comments
That's correct. RFC 7468 says that a key in PEM format should be in the following format:
What this says is that the first line of the key is expected to contain "preeb", possibly some whitespace, and a newline. "preeb" is the In other words, you are correct. The newlines are important and the key is not valid without them. |
I had the same error. I copy pasted pem file from my mac to ec2 ubuntu using nano editor. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html |
Hi. I'm receiving a "Could not deserialize key data" error in the following code. What am I doing wrong? I have investigated high/low trying to figure out if this public_key is in PEM format and it appears as if it is but I'm not sure (how can I verify this?). The decoding (and encoding also) works in the jwt.io debugger. Also, I traced through the pyjwt code and it's bombing during the verification of the signature. If I specify "verify=False" then the payload is returned just fine. I'm using the latest version of all packages. Thanks for the help.
UPDATE: I got this to work by adding line separators in the public key as follows:
I figured this out after I dove into the openssl library a little. The following command failed with an "Error: offset too large" after I simply copied and pasted the entire string into my public.key file:
openssl asn1parse -inform PEM -i -in public.key
After adding the line separators into the file then it worked.
The text was updated successfully, but these errors were encountered: