Hey all,

Im tearing my hair out here with what is probably a stupid problem.
I'm new to openssl , rsa, etc... , so bear with me please:)

Ok, heres what im trying to do:

Im coding the server-side of a software authorization system.
So, i need to sign user-submited challenge files with a private key.
Im trying to do this with PHP (on apache, with openssl).
The private key was generated with 'cryptopp' . It is hex-encoded and in DER 
format.
Heres the bit of code that generates the key using cryptopp:

        RSAES_OAEP_SHA_Decryptor priv(randPool, keylen);
        HexEncoder privFile(new StringSink(privStr));
        priv.DEREncode(privFile);
        privFile.MessageEnd();

Ok then, i know the key needs to be in PEM format, for PHP  / openssl... but, i 
can't get it recognized at all by openssl.

When i try :
openssl rsa -in keyfile.key -inform DER -noout -text
i get:
14620:error:0D094068:asn1 encoding routines:d2i_ASN1_SET:bad tag:a_set.c:179:
14620:error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong 
tag:tasn_dec.c:947:
14620:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 
error:tasn_dec.c:304:Type=RSA
14620:error:0D09A00D:asn1 encoding routines:d2i_PrivateKey:ASN1 lib:d2i_pr.c:96:


Ok, so i guess i do somehow have to convert that hex data into binary, right?
i tried to do that with xxd , but failed. 
how can i do that? 
Sorry if this is a stupid question, but i seem unable to find infos on this 
with google, for whatever reason...

Thanks soooo much for any help or pointers!!! I'm pretty desperate a.t.m..:(
Im using OpenSSL/0.9.7l  on apache

Regards
-Alois

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to