Hello All,

I'm using FileSource to make a signature of a file.  But I need to
read the file twice, since is a small file, thats OK, but what if was
a bigger file? Is there a way to use the filter to feed two (or maybe
possibly more) attachments? If there is such a way I can feed both the
SignerFilter and the FileSink simultaneously.

Here is my code (that is based on the examples located on the wiki):

    FileSource privFile( PrivateKeyFile.c_str(), true, new
Base64Decoder );

    RSASSA_PKCS1v15_SHA_Signer Signer( privFile );

    string signature;

    FileSource inFile( inFileName.c_str(), true,
        new SignerFilter( GlobalRNG(), Signer,
            new StringSink( signature )
        )
    );

    FileSink fsink( "signed.txt" );
    FileSource inFile2( inFileName.c_str(), true, new Redirector
(fsink ) );
    string endoffile = "\n\x1b\n"; //newline,ESC,newline. Just to
separate the signature from the file
    fsink.Put( (const byte*)endoffile.c_str(), endoffile.size(),
true );
    StringSource inSign( signature.c_str(), true, new Redirector
(fsink) );

Thanks in advance,
--~--~---------~--~----~------------~-------~--~----~
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.
-~----------~----~----~----~------~----~------~--~---

Reply via email to