Decrypts and verifies the signature of a PGP encrypted and signed file
Namespace: DidiSoft.PgpAssembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547
Syntax
| Visual Basic |
|---|
Public Function DecryptAndVerifyFilePBE ( _
encryptedFileName As String, _
keyStore As KeyStore, _
decryptionPassword As String, _
outputFileName As String _
) As Boolean |
Parameters
- encryptedFileName
- Type: System..::..String
File name to be decrypted (absolute or relative path)
- keyStore
- Type: DidiSoft.Pgp..::..KeyStore
Key store instance containing the public key for digital signature verification
- decryptionPassword
- Type: System..::..String
Password used to encrypt the file
- outputFileName
- Type: System..::..String
File name of the Output decrypted file (absolute or relative path)
Return Value
true if signature is valid, false if signature is invalid or there is no signature at all
Remarks
Examples
CopyC#
using System;
using DidiSoft.Pgp;
public classKeyStoreDecryptAndVerifyFilePBE
{
public static void Demo()
{
KeyStore keyStore = new KeyStore(@"DataFiles\key.store", "password");
PGPLib pgp = new PGPLib();
bool validSigning = pgp.DecryptAndVerifyFilePBE(@"DataFiles\OUTPUT.pgp",
keyStore,
"decryption password",
@"DataFiles\OUTPUT.txt");
Console.WriteLine("Signature is valid: " + validSigning);
}
}
CopyVB.NET
Imports System
Imports DidiSoft.Pgp
Public ClassKeyStoreDecryptAndVerifyFilePBE
Public Shared Sub Demo()
Dim keyStore As New KeyStore("DataFiles\key.store", "password")
Dim pgp As New PGPLib()
Dim validSigning As Boolean = pgp.DecryptAndVerifyFilePBE("DataFiles\OUTPUT.pgp", _
keyStore, _
"decryption password", _
"DataFiles\OUTPUT.txt")
Console.WriteLine("Signature is valid: " + validSigning)
End Sub
End Class
Exceptions
See Also