Hi, Have you seen this? http://juliusdavies.ca/commons-ssl/utilities.html
You can probably use the "KeyStoreBuilder" utility on the command-line to convert your OpenSSL RSA key into a java-friendly "jks" file (aka: java keystore file). Try this command: ------------------------- java -cp not-yet-commons-ssl-0.3.8.jar org.apache.commons.ssl.KeyStoreBuilder ------------------------- JSAFE might work better with a jks file. Good luck. yours, Julius On 10/9/07, Pierce Ward <[EMAIL PROTECTED]> wrote: > Hi guys, > > I'm currently writing a little test application using RSA's JSAFE > libraries (java version of BSAFE), and I'm generating my keys using > openssl, however I cannot get a signature to verify successfully. An > example program (with hard coded bytes for the private key) using an > rsa algorithm works correctly. > > I was comparing the differences of the supplied private key and the > private key i generated in openssl and there appear to be a few small > differences. > > In the rsa example program the modulus, private exponent, prime1, > prime2, exponent 1 are all one byte shorter in the example than what > openssl generates. The difference appears to be a beginning 0x00 byte. > So I removed the beginning byte and tried to verify the signature > again but it failed. The openssl command I used to create the my > private key was: > > `openssl genrsa -out private_key.pem -f4 768` > > Then I got the values, > `openssl rsa -in private_key.pem -text -noout` > > and converted them to a byte array. > > I have pasted the supplied hard coded private key (which is 512bit, > the one I have tested is 768bit but it shouldn't make a difference) > to a paste bin here: > http://pastebin.com/f2900d840 > > The program generates the public key from the modulus/public exponent > but for some reason only the hard coded private key verifys for me. I > assume both formats are the same standard RSA key? If anyone has any > ideas as to why its failing to verify I'd greatly appreciate it, > > Cheers, > ______________________________________________________________________ > OpenSSL Project http://www.openssl.org > User Support Mailing List openssl-users@openssl.org > Automated List Manager [EMAIL PROTECTED] > -- yours, Julius Davies 250-592-2284 http://juliusdavies.ca/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]