Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have DER private key and certificate. I need to convert them to PEM format. Certificate converted normally, but when i try to convert key this error happens:

# openssl x509 -in client-key.der -inform DER -out private.pem -outform PEM
unable to load certificate
3077748360:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:tasn_dec.c:1319:
3077748360:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=X509_CINF
3077748360:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 error:tasn_dec.c:751:Field=cert_info, Type=X509

What am i doing wrong? client-key.der is in binary format and has been used in JAVA application, now i need to use it in my C aplication

share|improve this question
up vote 3 down vote accepted

Notice it says "unable to load certificate". The x509 command is for X509 structures, not private keys! Try the rsa command.

share|improve this answer
That worked! Thank you! – Timur Mar 3 '13 at 22:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.