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?