views:

66

answers:

1

I am trying to sign a token object using SHA1. I am using bouncycastle as the security provider. Whenever the program tries to sign something it gives me this error.

java.security.SignatureException: java.lang.IllegalArgumentException: input data too large.

What is the maximum size for signing something? Do you have any suggestions about how I can sign this object?

A: 

The input size is limited to the size of the key. If you use a 1024 bit key, you are limited to 128 bytes.

Typically, you are signing the digest (hash value), not the actual data.

Marcus Adams