Decrypts a PGP encrypted message.
Namespace:
DidiSoft
Assembly:
PGPLib (in PGPLib.dll) Version: 1.6.3.19546
Syntax
| Visual Basic (Declaration) |
|---|
Public Function DecryptString ( _
encryptedString As String, _
privateKeyFile As FileInfo, _
privateKeyPassword As String _
) As String |
Return Value
Decrypted string
Examples
CopyC#
using System;
using System.IO;
using DidiSoft;
class DecryptString {
public static String Demo(String encryptedString)
{
PGPLib pgp = new PGPLib();
String plainString = pgp.DecryptString(encryptedString,
new FileInfo(@"DataFiles\private.key"),
"changeit");
return plainString;
}
}
CopyVB.NET
Imports System
Imports System.IO
Imports DidiSoft
Class DecryptString
Public Shared Function Demo(ByVal encryptedString As String) As String
Dim pgp As New PGPLib()
Dim plainString As String = pgp.DecryptString(encryptedString, _
New FileInfo("DataFiles\private.key"), _
"changeit")
Return plainString
End Function
End Class
Exceptions
| Exception | Condition |
|---|
| PgpException | if an error has occured |
| System.IO..::.IOException | if a problem has occured reading private key file |
See Also