> I have read some of the documents about JCE. I found out that in the Mac
> class if you want to use HmacSHA1 as the algorithm, you will have to
> provide a secret key. According to RFC2104, the secret key can be of any
> length. But from the existing key generating class in JCE1.2 Beta, you can
> only generate certain length of key associated with an encrypting
> algorithm. Could you explain me how it works if one wants to generate any
> length of secret key which is not associated with any algorithm which still
> can be used in the HMAC class?
I am not sure I understand your question.
The javax.crypto.KeyGenerator class has an "init" method that
takes a "int keysize" parameter.
This allows you to specify the size of the key to be generated.
Jan