RSA keys

Hello im trying to create an RSA keys with a key strength of 256 bits using bouncy castle for j2me. The keys are generated fine but when i try to sign my messages using the generated private key i get a encoding error. (DataLength NUll pointer Exception)

If i use a 1024 bit key strength i do not get this error.

Can somebody please help me.

[360 byte] By [princa] at [2007-10-3 7:23:58]
# 1
I suspect that a 256 bit key will allow you to encrypt/sign a maximum of 16 bytes so if you are trying to sign a sha-1 hash (20 bytes) then you may have a problem. Even an MD5 hash which is 16 bytes may be unacceptable.
sabre150a at 2007-7-15 2:22:15 > top of Java-index,Security,Cryptography...
# 2
You are right im trying to sign a SHA-1 digest. I thought a 256 bit RSA key could encrypt a maximum of 32 bytes. If i change the PSSsigner salt value to less than 16 bytes it works.
princa at 2007-7-15 2:22:15 > top of Java-index,Security,Cryptography...