openssl_verify(): supplied key param cannot be coerced into a public key for a .pem file

Upon opening this .pem file, it was all in one line. It appears each line requires the length of 64 characters, so I made sure each line was 64 lines, and it successfully parsed. Had nothing to do with .cer.


In addition, the -----BEGIN PUBLIC KEY----- and -----END PUBLIC KEY----- lines should contain exactly five dashes on each side. No more, no less. Six is right out.

There may or may not be a newline at the end of the final line.

Windows line endings (CR/LF) are allowed, even on *nix-hosted PHP.

Tags:

Php

Openssl