Decrypts and verifies PGP encrypted and signed string message

Namespace: DidiSoft.Pgp
Assembly: DidiSoft.Pgp (in DidiSoft.Pgp.dll) Version: 1.7.3.35547

Syntax

C#
public bool DecryptAndVerifyString(
	string inputString,
	KeyStore keyStore,
	string privateKeyPassword,
	out string outputString
)
Visual Basic
Public Function DecryptAndVerifyString ( _
	inputString As String, _
	keyStore As KeyStore, _
	privateKeyPassword As String, _
	<OutAttribute> ByRef outputString As String _
) As Boolean
Visual C++
public:
bool DecryptAndVerifyString(
	String^ inputString, 
	KeyStore^ keyStore, 
	String^ privateKeyPassword, 
	[OutAttribute] String^% outputString
)

Parameters

inputString
Type: System..::..String
String message that is OpenPGP encrypted and optionaly signed
keyStore
Type: DidiSoft.Pgp..::..KeyStore
KeyStore object containing the private decryption key and public verification key
privateKeyPassword
Type: System..::..String
Private key password
outputString
Type: System..::..String%
Decrypted plaintext message.
Must be called with the out keyword in C#. In VB.NET is a normal ByRef invokation.

Return Value

true if signature is valid, false if signature is invalid

Remarks

Supports OpenPGP version 3 format too (used by PGP 2.x systems).

Exceptions

ExceptionCondition
DidiSoft.Pgp..::..PGPExceptionif an OpenPGP related error has occurred
System.IO..::..IOExceptionif a problem has occurred reading public key file or private key file
DidiSoft.Pgp.Exceptions..::..WrongPasswordExceptionIf the password for the decryption key is incorrect
NonPGPDataExceptionif the input data is not a valid OpenPGP encrypted message

See Also