1

I need to view a .pem file content. After researching little in the web, I find 2 ways to view the content,

A. I executed the command provided below,

   sudo keytool -printcert -file cak.artt.pem

The output is,

keytool error: java.lang.Exception: Failed to parse input

B. I executed the command,

sudo openssl x509 -in cak.artt.pem -text

The output is,

unable to load certificate
139976958314128:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting: TRUSTED CERTIFICATE

I read that this can happen in the case of APNS certificates, which combines private key & certificate into one .pem. The instruction is to Separate them into 2 files using a text editor and the above commands will work.

How to do that and view the content of the certificate? I have Debian 8 environment. Btw, I have JDK 9 installed on the machine

1 Answer 1

5

This error message sometimes happens when you try to read a DER encoded certificate.

You can use this command to view DER encoded certificate details:

openssl x509 -in YOUR_FILENAME -inform der -text -noout

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .