I think the problem may be a little deeper then this.
RSASSA_PKCS1v15_MD5_Signer is not an encryptor, but a signer. This means it
takes a private key and encrypts the MD5 of the data being signed. The
PKCS1 defines how the resulting data is formed so it is secure (or atleast
more so then some simpler methods of using RSA) and readable by the
verifier.
To encrypt with RSA you will use a public key, and some symmetric
cipher. Once you get to that point use debugging methods to look into the
values to make sure that you have loaded all of the correct numbers for the
algorithm chosen.
73,
Shawn
-----Original Message-----
From: Guillaume JOLIVET [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 6:37 AM
To: [EMAIL PROTECTED]
Subject: RSA private key file problems
Hi all,
�
I would like to�crypt�data with�a RSA with MD5�algorithm but I've got some
problems.
My�private key file is a variable-size hexadecimal format file.
�
Here�are my code lines :
�
��� FileSource privFile(<myKeyFilePath>, true, new HexDecoder());
��� RSASSA_PKCS1v15_MD5_Signer priv(privFile);
�
�
When I try to crypt, the program fails�on the�creation of �the
RSASSA_PKCS1v15_MD5_Signer object.
I�think that the FileSource object is not correct because of the key file
format, but I don't know what kind of object�to use�instead the HexDecoder
object.
�
�
Does�somebody got any idea,
�
Thanks,
Guillaume.