Decrypts a PGP encrypted stream that may contain multiple files to a specified directory.
Namespace: DidiSoft.PgpAssembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
| Visual Basic |
|---|
Public Function DecryptStreamInFolder ( _
encryptedPGPStream As Stream, _
privateKeyStream As Stream, _
privateKeyPassword As String, _
outputFolderName As String _
) As String() |
| Visual C++ |
|---|
public:
array<String^>^ DecryptStreamInFolder(
Stream^ encryptedPGPStream,
Stream^ privateKeyStream,
String^ privateKeyPassword,
String^ outputFolderName
) |
Return Value
Array of file names of the decrypted file(s)
Examples
CopyC#
using System;
using System.IO;
using DidiSoft.Pgp;
public class DecryptDemo
{
public void Demo()
{
PGPLib pgp = new PGPLib();
FileInfo inputFile = new FileInfo(@"c:\INPUT.pgp");
FileInfo privateKey = new FileInfo(@"c:\private_key.asc");
string privateKeyPassword = "key password";
string outputFolder = @"c:\Output";
string[] decryptedFileNames =
pgp.DecryptStreamTo(inputFile.OpenRead(),
privateKey.OpenRead(),
privateKeyPassword,
outputFolder);
foreach (string filename in decryptedFileNames)
{
System.Console.WriteLine(filename);
}
}
}
CopyVB.NET
Imports System
Imports System.IO
Imports DidiSoft.Pgp
Public Class DecryptDemo
Public Sub Demo()
Dim pgp As New PGPLib()
Dim inputFile As New FileInfo("c:\INPUT.pgp")
Dim privateKey As New FileInfo("c:\private_key.asc")
Dim outputFolder As String = "c:\Output"
Dim decryptedFileNames As String() = _
pgp.DecryptStreamTo(inputFile.OpenRead(), _
privateKey.OpenRead(), _
"key password", _
outputFolder)
For Each filename As String In decryptedFileNames
System.Console.WriteLine(filename)
Next
End Sub
End Class
Exceptions
See Also