0

I'm generating an Eliptic Curve / ECDSA PEM from a JWT:

{
    "kty":"EC",
    "crv":"P-256",
    "x":"xxxxx...",
    "y":"xxxxx..."
}
-----BEGIN PUBLIC KEY-----
xxxxxxxxxx....
xxxxxxxx==
-----END PUBLIC KEY-----

If I use openssl_pkey_get_public it gives me an OpenAALAsymmetricKey object but it produces an error from openssl_error_string(): error:0909006C:PEM routines:get_name:no start line

So it's generating a key, but saying there's an error. This doesn't make sense for a cryptographic function... surely it should fail if there's even the slightest problem with the PEM data.

Furthermore, I can use this OpenAALAsymmetricKey object to verify a claim. (in my case a CBOR encoded claim.

My question is: can I safely ignore the error that occurs during the creation of my PEM?

Henry
  • 7,411
  • 2
  • 35
  • 37
  • 1
    Most likely the issue described in [this answer](https://stackoverflow.com/a/61041760/9014097) (without the _update_ section): – Topaco Nov 23 '21 at 21:59

0 Answers0