On Fri, 24 Aug 2012 15:54:50 -0400 Dave Thompson wrote: > Note OpenSSL's RSA privatekey *includes* publickey. > RSA publickey is n,e and naive privatekey is n,d, > but OpenSSL privatekey is CRT form with n,d,e,p,q + more. > There is no need to transmit the publickey separately, > > [..] > > > Tiny aside: BIO_new_mem_buf will do the strlen() for you > if you pass -1 for length. Just a convenience. > > [..] > > If PEM_read_* returns null (or nearly any other OpenSSL > routine returns a failure indication), look at the error queue. > http://www.openssl.org/support/faq.html#PROG6 > and #PROG7 also if you don't get readable error. > > If they didn't, look very carefully at your PEM data. > Commandline can do this: openssl asn1parse -in myprivkey.pem > and/or: openssal rsa -in myprivkey.pem -text
Thanks for your hints. After a lot of testing I figured out that my functions pem2key() and key2pem() works fine. The problem is that I lose some characters (e.g. '+' gets replaced by spaces) while sending the key over the network. But I think this problem don't belong to the mailing list. ;-) Thanks a lot! Björn -- Björn Schießle <bjo...@schiessle.org> www: http://schiessle.org gnupg key: 0x0x2378A753E2BF04F6 fingerprint: 244F CEB0 CB09 9524 B21F B896 2378 A753 E2BF 04F6 ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org