Regards Phil
Yes we do support in memory decryption with no data written to the
disk (even temporary data).
An example can be found here:
http://www.didisoft.com/net-openpgp-library/decrypt-file/#DecryptStream
You can change the stream parameters to any other class that extends
System.IO.Stream.
The only thing that you have to be aware of is that the decrypted
content is written to a Stream
and for example if you want to read it lately you have to take an
extra step.
For your convenience I have included below a modified example that
decrypts to a MemoryStream, and afterwards a new MemoryStream instance
is created in order to have access to the decrypted data.
(I have used C#, please let me know if you prefer a VB.NET code
snippet)
using System;
using System.IO;
using DidiSoft.Pgp;
public class DecryptStreamDemo
{
public void Demo()
{
// initialize the library
PGPLib pgp = new PGPLib();
Stream privateKeyStream = null;
Stream inputFileStream = null;
Stream decryptedStream = null;
Stream decryptedStreamForReading = null;
try {
privateKeyStream = new FileStream(@"c:\private_key.asc",
FileMode.Open);
inputFileStream = new FileStream(@"c:\INPUT.pgp",
FileMode.Open);
string privateKeyPassword = "key password";
decryptedStream = new MemoryStream();
// decrypt and obtain the original file name
string originalFileName =
pgp.DecryptStream(inputFileStream,
privateKeyStream,
privateKeyPassword,
decryptedStream);
decryptedStreamForReading = new
MemoryStream(decryptedStream.ToArray());
// ... now you can read the decrypted data from
decryptedStreamForReading
} finally {
inputFileStream.Close();
privateKeyStream.Close();
decryptedStream.Close();
}
}
}
Please let me know if you need additional examples.
Kind Regards,
Peter Kalef
DidiSoft Ltd.