Hi Eugene, I meant saving a copy without the hash.
Okay, if I understand correctly, passing a FileSink etc. to HashVerificationFilter with the PUT_MESSAGE flag set, the resulting output will be just the original file/message without the hash? If so, that's exactly what I was talking about. Sorry. I didn't realize that from looking at the docs. I did find it odd that it would have been left out though. Thanks, Gerry On Apr 22, 2:02 pm, Eugene Zolenko <[email protected]> wrote: > > When using a FileSource/Sink with a HashFilter, there is an option to > > append the hash code to the output file when encoding. It would be > > cool if there were a complementary option to strip the hash out of the > > file when verifying. Perhaps through the use of a tag to mark where > > the hash code starts. > > Do you mean verifying file once and saving a copy without a hash? That > would mean you can only verify once. > > If you mean "writing file, appending hash" and then "reading file, > verifying hash and passing the file itself further up the filter > chain" then that is there already. Look at HashVerificationFilter and > PUT_MESSAGE flag. > > SHA1 sha; > > // Creating "signed" file with digest at the end > FileSource("original_file", true, new HashFilter(sha, new FileSink > ("file_with_digest"), true)); > > // Verifying file and passing stripped out version up the chain, > FileSink in this case > FileSource("file_with_digest", true, new HashVerificationFilter(sha, > new FileSink("file_without_digest"), > HashVerificationFilter::THROW_EXCEPTION | > HashVerificationFilter::PUT_MESSAGE)); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the "Crypto++ Users" Google Group. To unsubscribe, send an email to [email protected]. More information about Crypto++ and this group is available at http://www.cryptopp.com. -~----------~----~----~----~------~----~------~--~---
