Encrypts given String in ASCII format.

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

Syntax

C#
public string EncryptString(
	string stringToEncrypt,
	KeyStore keyStore,
	long keyId
)
Visual Basic
Public Function EncryptString ( _
	stringToEncrypt As String, _
	keyStore As KeyStore, _
	keyId As Long _
) As String
Visual C++
public:
String^ EncryptString(
	String^ stringToEncrypt, 
	KeyStore^ keyStore, 
	long long keyId
)

Parameters

stringToEncrypt
Type: System..::..String
plain text string to be encrypted
keyStore
Type: DidiSoft.Pgp..::..KeyStore
KeyStore holding the encryption key
keyId
Type: System..::..Int64
Encryption key Id

Return Value

the encrypted string

Remarks

Compression algorithm used is the one specified through Compression
Symmetric cipher algorithm used is the one specified through Cypher

Exceptions

ExceptionCondition
DidiSoft.Pgp.Exceptions..::..WrongPublicKeyExceptionIf the supplied public key is not usable
DidiSoft.Pgp..::..PGPExceptionGeneral encryption error
System.IO..::..IOExceptionI/O error

See Also