1

I have a certificate and private key in pem format, I want to convert into .crt file for that I have run below commands.

cat csr.pem privatekey.pem >combined.pem

openssl-0.9.8k_X64\bin\openssl x509 -outform der -in combined.pem -out certificate.crt

But, getting below error: unable to load certificate 91172:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:650:Expecting: TRUSTED CERTIFICATE

Vivek
  • 405
  • 1
  • 4
  • 14
  • This complains about the input file not being in the expected format. Unfortunately you don't show the input file so one cannot say what exactly is wrong here. Also, this command is for converting a single certificate only, not the key - while your title is about certificate and key. And, OpenSSL 0.9.8 is shockingly old. – Steffen Ullrich Jun 18 '20 at 05:36
  • @SteffenUllrich as you can see from first command i am combining certificate and private files and then passing to open ssl – Vivek Jun 18 '20 at 05:56
  • *" ... as you can see from first command ..."* - oh, I need to guess from the filename alone what is in there? Still, the command you use is for converting a certificate only and as I said the **still unknown** content of the file is not what is expected as input for this command. – Steffen Ullrich Jun 18 '20 at 06:12
  • FYI this is the same problem as in the comments of https://stackoverflow.com/a/14484363. They don't seem to answer the question, tho. – dfrankow Nov 04 '21 at 21:06

1 Answers1

0

A crt file usually contains a single certificate, alone and without any wrapping (no private key, no password protection, just the certificate).

If you require the private to be in a file along with the public key then the output file should be a pfx file.

Ritesh Jha
  • 21
  • 1