How the tools word it
| OpenSSL 3.6 asn1parse | error:0480006C:PEM routines:get_name:no start line:crypto/pem/pem_lib.c:794: |
|---|---|
| Node 26 X509Certificate | error:0480006C:PEM routines::no start line (ERR_OSSL_PEM_NO_START_LINE) |
| Python 3.14 ssl | ValueError: Invalid PEM encoding; must start with -----BEGIN CERTIFICATE----- |
Common causes
The BEGIN line is missing
Only the Base64 lines were copied. Without the BEGIN line there is nothing that says what the data is.
Input
MC4CAQAwBQYDK2VwBCIEIAvXQSzkUXiBUvR8YJRi5koamd18fdoiwoI7BD04DB1Z
Key Inspector says
No key found. Paste a PEM block (-----BEGIN …), a JWK or JWKS, or an OpenSSH key
The header and the data are on one line
A key pasted into a form or a config file can lose the line break after the BEGIN line. The BEGIN line must be on a line of its own, and OpenSSL finds no start line when the data follows it directly.
Input
-----BEGIN PRIVATE KEY-----MC4CAQAwBQYDK2VwBCIEIAvXQSzkUXiBUvR8YJRi5koamd18fdoiwoI7BD04DB1Z -----END PRIVATE KEY-----
Key Inspector says
No key found. Paste a PEM block (-----BEGIN …), a JWK or JWKS, or an OpenSSH key
A web page instead of the file
A download that was redirected, or a link to a login page, saves HTML under the name of the file.
Input
<!DOCTYPE html> <title>Sign in</title>
Key Inspector says
No key found. Paste a PEM block (-----BEGIN …), a JWK or JWKS, or an OpenSSH key
A binary DER file
A file with the extension .der, .cer or .key can hold the raw bytes instead of PEM text. A PEM reader finds no BEGIN line in it. Tell the tool to read DER, for example openssl pkey -inform DER -in key.der. Opened in a text editor it looks like noise.
Text before the key is not the problem
Notes above the BEGIN line and Windows line endings are accepted. If the BEGIN line is there, this error is about something else.
Input
Here is my key: -----BEGIN PRIVATE KEY----- MC4CAQAwBQYDK2VwBCIEIAvXQSzkUXiBUvR8YJRi5koamd18fdoiwoI7BD04DB1Z -----END PRIVATE KEY-----
Key Inspector says
Ed25519 private key · PKCS#8 PEM
How to fix it
- Make sure the first line is -----BEGIN followed by a label such as PRIVATE KEY, with five dashes at both ends, and that the END line matches it.
- Put the BEGIN line, the Base64 lines and the END line on separate lines.
- Open the file in a text editor. If it is HTML, download it again and follow redirects (curl -L).
- If the file is binary, add the DER input format to the command (for example -inform DER), or convert it to PEM first.
- Paste the text into the Key Inspector. It tells you at once whether a key is found.