How do i get expiration date from private key on pem format that generated from certificate?

8k views Asked by At

Hi i generate 2 file from the certificate

  1. This one in .pem format, generated using openssl pkcs12 -in {{key_pair_file}} -out {{file_name}}.pem -nocerts -nodes -password pass:test

  2. This one in .cer format, generated using openssl pkcs12 -in {{key_pair_file}} -out {{file_name}}.cer -nokeys -nodes -password pass:test

So how to know the expiration date of the number 1? actually I already use openssl x509 -noout -enddate {{file}}.pem command but got an error.

...PEM routines:CRYPTO_internal:no start line:...:Expecting: TRUSTED CERTIFICATE
1

There are 1 answers

0
bartonjs On BEST ANSWER

Keys don't have any inherent notion of expiration. Only certificates do.