Case
OpenSSLError.invalidKey(_:)
Thrown when PEM key material fails ingestion.
case invalidKey(String)
Discussion
Produced by init(pemRepresentation:) and init(pemRepresentation:) when the input is not valid UTF-8 or does not contain the expected -----BEGIN ... KEY----- frame. The associated String describes which check failed.
Typical remediation: confirm the string was read from disk with the correct encoding (UTF-8, not UTF-16 with BOM) and that the file has not been truncated or line-ending-mangled by a text editor.