Decrypts OpenPGP encrypted string message
Namespace:
DidiSoft
Assembly:
PGPLib (in PGPLib.dll) Version: 1.6.3.19546
Syntax
| Visual Basic (Declaration) |
|---|
Public Function DecryptString ( _
encryptedString As String, _
keyStore As KeyStore, _
privateKeyPassword As String _
) As String |
Return Value
decrypted plain text string
Examples
CopyC#
using System;
using DidiSoft;
class DecryptStringWithKeyStore
{
public void Demo()
{
KeyStore ks = new KeyStore(@"DataFiles\key.store", "changeit");
try {
PGPLib pgp = new PGPLib();
string encryptedString = ...
string plainText = pgp.DecryptString(encryptedString, ks, "password");
}
catch (ArgumentException)
{
Console.WriteLine("No suitable deryption key was found in this key store.");
}
}
}
CopyVB.NET
Imports System
Imports DidiSoft
Class DecryptStringWithKeyStore
Public Sub Demo()
Dim ks As New KeyStore("DataFiles\key.store", "changeit")
Try
Dim pgp As New PGPLib()
Dim encryptedString As String = ...
Dim plainText As String = pgp.DecryptString(encryptedString, ks, "password")
Catch generatedExceptionName As ArgumentException
Console.WriteLine("No suitable deryption key was found in this key store.")
End Try
End Sub
End Class
Exceptions
See Also