private key problem

You are here

private key problem

3 posts / 0 new
Last post
tcosta
tcosta's picture
private key problem

Hello everybody,

I'm trying to include the private key attached to this message (I changed the file extension to .txt) in a keystore. The thing is that I can't figure out in what format the key is (I guess it is DER...) because, when check it with OpenSSL, I get this error:
C:\OpenSSL\bin>openssl rsa -inform DER -in novakey.der -check
unable to load Private Key
2952:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag:.\crypto\as
n1\tasn_dec.c:1293:
2952:error:0D06C03A:asn1 encoding routines:ASN1_D2I_EX_PRIMITIVE:nested asn1 err
or:.\crypto\asn1\tasn_dec.c:830:
2952:error:0D08303A:asn1 encoding routines:ASN1_TEMPLATE_NOEXP_D2I:nested asn1 e
rror:.\crypto\asn1\tasn_dec.c:749:Field=n, Type=RSA
2952:error:0D09A00D:asn1 encoding routines:d2i_PrivateKey:ASN1 lib:.\crypto\asn1
\d2i_pr.c:99:

Anything I try with OpenSSL I get this kind of error, but this key is currently being used so it should be ok...

Can you help me? Can anybody check the file himself and please help me with this?

Thank you,
Tiago

tcosta
tcosta's picture

I figured out that the file was in PKCS#8, DER and unencrypted format and I managed to convert it to PEM:

>openssl pkcs8 -inform DER -outform PEM -in novakey.der -out novakey.pem -nocrypt

In this format (PEM) I sucessfully created a PKCS#12 keystore with this key (and a certificate).

Regards,
Tiago

heller
heller's picture

Tiago,

I deleted the private key attachment to save your privacy.

Regards
Heller