Hi Robert,
Please download an updated evaluation version from
http://didisoft.com/pgpnet.zip
Below is an example how to use the new method.
In fact there are two versions of the method, the second one has an
addition parameter for a file name string to be associated with the
encrypted data.
I will paste here only the first variation, pease refer to the CHM or
MSDN style documentation that ships with the library for the other
one, or just drop me a line.
// C#
using System.IO;
using DidiSoft.Pgp;
class EncryptStreamDemo {
public void Demo() {
PGPLib pgp = new PGPLib();
Stream inputStream = File.OpenRead(@"DataFiles
\INPUT.txt");
Stream publicKey = File.OpenRead(@"DataFiles\public.asc");
Stream encryptedStream = File.OpenWrite(@"DataFiles
\OUTPUT.pgp");
bool asciiArmor = true;
pgp.EncryptFile(inputStream, publicKey, encryptedStream,
asciiArmor);
}
}
'
VB.NET
Imports System.IO
Imports DidiSoft.Pgp
Class EncryptStreamDemo
Public Sub Demo()
Dim pgp As New PGPLib()
Dim inputStream As Stream = File.OpenRead("DataFiles
\INPUT.txt")
Dim publicKey As Stream = File.OpenRead("DataFiles
\public.asc")
Dim encryptedStream As Stream = File.OpenWrite("DataFiles
\OUTPUT.pgp")
Dim asciiArmor As Boolean = True
pgp.EncryptFile(inputStream, publicKey, encryptedStream,
asciiArmor)
End Sub
End Class
Best Regards,