Decrypts a PGP encrypted file that was encrypted with a password (PBE, symmetric key encrypted).

Namespace:  DidiSoft
Assembly:  PGPLib (in PGPLib.dll) Version: 1.6.3.19546

Syntax

C#
public string DecryptFilePBE(
	string encryptedFileName,
	string password,
	string outputFileName
)
Visual Basic (Declaration)
Public Function DecryptFilePBE ( _
	encryptedFileName As String, _
	password As String, _
	outputFileName As String _
) As String
Visual C++
public:
String^ DecryptFilePBE(
	String^ encryptedFileName, 
	String^ password, 
	String^ outputFileName
)

Parameters

encryptedFileName
Type: System..::.String
File name to be decrypted (absolute or relative path)
password
Type: System..::.String
Password used for symmetric encryption of the input file
outputFileName
Type: System..::.String
File name of the Output decrypted file (absolute or relative path)

Return Value

Original file name of the decrypted file as stored in the PGP file.

Examples

CopyC#
using System;
using DidiSoft;

public class DecryptPBEDemo
{
 public void Demo()
 {
    // initialize the library
    PGPLib pgp = new PGPLib();

    string inputFileLocation = @"c:\INPUT.pgp";
    string password = "password";
    string decryptedOutput = @"c:\OUTPUT.txt";

    // decrypt and obtain the original file name
    string originalFileName = 
      pgp.DecryptFile(inputFileLocation,
                      password,
                      decryptedOutput);        
 }
}
CopyVB.NET
Imports System
Imports DidiSoft

Public Class DecryptPBEDemo
Public Sub Demo()
    ' create an instance of the library
    Dim pgp As New PGPLib()

    ' decrypt and obtain the original file name
    Dim originalFileName As String
    originalFileName = _
      pgp.DecryptFilePBE("c:\INPUT.pgp", _
                    "password", _
                    "c:\OUTPUT.txt")
 End Sub
End Class

Exceptions

ExceptionCondition
PgpExceptionif an error has occured
System.IO..::.IOExceptionif a problem has reading input file or private key file

See Also