I want to sign the contents of a file using a HMAC and also base64
encode the contents of the file. When I do the following for it,

---CODE
//in and out are ifstream and ofstream respectively.

FileSource(in, true, new HashFilter(hmac, new Base64Encoder(new
StringSink(signature))));
in.seekg(0, ios::beg);
FileSource(in, true, new Base64Encoder(new FileSink(out)));
---CODE

The signature is obtained, but I do not get any base64encoded file
contents. The 'in' stream does not seek correctly to the beginning of
the file again. I checked the value using teelg and it returns -1.

A more general question is how should I do two or more transformations
on the same input stream; after every transformation seeking to the
beginning of the stream?

-- 
Best regards,
 Jayesh                          mailto:[EMAIL PROTECTED]

Reply via email to