Decrypts a PGP encrypted file 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 DecryptFileInFolder ( _
encryptedFileName As String, _
keyStore As KeyStore, _
privateKeyPassword As String, _
outputFolderName As String _
) As String() |
Return Value
Array of one or more file names (full path) of the decrypted file(s)
Examples
CopyC#
using System;
using DidiSoft.Pgp;
public class DecryptDemo
{
public void Demo()
{
PGPLib pgp = new PGPLib();
KeyStore keyStore = new KeyStore("c:\pgp.keystore");
string inputFileLocation = @"c:\INPUT.pgp";
string privateKeyPassword = "key password";
string outputFolder = @"c:\Output";
string[] decryptedFileNames =
pgp.DecryptFileTo(inputFileLocation,
keyStore,
privateKeyPassword,
outputFolder);
foreach (string filename in decryptedFileNames)
{
System.Console.WriteLine(filename);
}
}
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp
Public Class DecryptDemo
Public Sub Demo()
Dim pgp As New PGPLib()
Dim keysStore As New KeyStore("c:\pgp.keystore")
Dim inputFileLocation As String = "c:\INPUT.pgp"
Dim outputFolder As String = "c:\Output"
Dim decryptedFileNames As String() = _
pgp.DecryptFileTo(inputFileLocation, _
keysStore, _
"private key password", _
outputFolder)
For Each filename As String In decryptedFileNames
System.Console.WriteLine(filename)
Next
End Sub
End Class
Exceptions
See Also