I currently have an app written in C# that can take a file and encrypt it using gpg.exe
What I'm trying to do is, instead of 1. Creating a file (from database queries usually) 2. encrypting the file 3. deleting the non-encrypted file
I want to
- Gather info into memory (into a dictionary or a list or whatever)
- stream the text/data into gpg.exe to end up with the encrypted file outputted
I've looked into pipestream, redirecting standard input to the gpg process, etc, but I haven't figured out a way to trick gpg.exe into accepting streamed text/data instead of a file on the hard drive.
Initially figured if I could do it for gpg, I could also do it for Zip as well, but I'm wondering if it's even possible. Found some refs to popen which seems to be php related, but nothing for c#.
Essentially, I'm looking to do the below programatically with text.txt being stuff in memory streamed to the app instead of an actual file on the hard drive.
C:\Program Files\GNU\GnuPG>type C:\test.txt | zip > plubber.zip C:\Program Files\GNU\GnuPG>type C:\test.txt | gpg -er "mycomp_operations [email protected]" > Test.pgp
Thanks for any help you may be able to give :)
Tony!