0

I'm working with ssl certificates and trying to convert myCA.cer to myCA.pem...

$ openssl x509 -in myCA.crt -inform der -outform pem -out myCA.cer.pem
unable to load certificate
65927:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:/SourceCache/OpenSSL098/OpenSSL098-52.40.1/src/crypto/asn1/tasn_dec.c:1341:
65927:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:/SourceCache/OpenSSL098/OpenSSL098-52.40.1/src/crypto/asn1/tasn_dec.c:385:Type=X509

Why? What's wrong?

4
  • 1
    Are you even sure that the input is DER and not already PEM? DER is just completely binary while PEM is base64 with some prefix and suffix which indicate the type of data. The extension itself does not affect the type of data inside the file. Dec 20, 2015 at 6:24
  • Thanx for reply! How can I check it for sure?
    – drew1kun
    Dec 20, 2015 at 19:22
  • open the file inside an editor, do a hexdump... . DER is binary while PEM is text. Dec 20, 2015 at 21:49
  • You are right! For some reason it was already a text(PEM)… weird. Thanx!
    – drew1kun
    Dec 21, 2015 at 0:34

1 Answer 1

0

Thanx to Steffen Ullrich, I've finally found the reason of that error... The myCA.crt was already in PEM format, as DER is binary file while PEM is base64 encrypted text.

You must log in to answer this question.

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