Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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.