You need to use HashFilter to generate a hash or MAC. HashVerificationFilter, as the name indicates, is used to verify a hash or MAC. The output you're getting from HashVerificationFilter is "\0" base64-encoded, indicating the MAC verification failed.
On Fri, Dec 27, 2002 at 07:23:54AM -0800, Jayesh Samant wrote: > I want to sign the contents of a file and I am using HMAC for the > same. However I get the same value of the digest (AA=) when i give > different keys. Am I doing anything wrong? Here is the code > > (I wanted to use HMAC with a filter queue. Am I using the > HashVerificationFilter correctly?) > > ---Code > HMAC <SHA> mac(key); > > FileSource(infile, true, new HashVerificationFilter(mac, new Base64Encoder(new > FileSink(cout)))); > ---Code > > -- > Best regards, > Jayesh mailto:[EMAIL PROTECTED]
