OpenPGP signs and encrypts given String message in one pass with keys located in a KeyStore

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

Syntax

C#
public string SignAndEncryptString(
	string inputString,
	KeyStore keyStore,
	long privateSigningKeyId,
	string privateSigningKeyPassword,
	long publicEncryptionKeyId
)
Visual Basic
Public Function SignAndEncryptString ( _
	inputString As String, _
	keyStore As KeyStore, _
	privateSigningKeyId As Long, _
	privateSigningKeyPassword As String, _
	publicEncryptionKeyId As Long _
) As String
Visual C++
public:
String^ SignAndEncryptString(
	String^ inputString, 
	KeyStore^ keyStore, 
	long long privateSigningKeyId, 
	String^ privateSigningKeyPassword, 
	long long publicEncryptionKeyId
)

Parameters

inputString
Type: System..::..String
Message to be encrypted and signed
keyStore
Type: DidiSoft.Pgp..::..KeyStore
KeyStore holding the signing and encryption keys
privateSigningKeyId
Type: System..::..Int64
Private signing key Id
privateSigningKeyPassword
Type: System..::..String
Private signing key password
publicEncryptionKeyId
Type: System..::..Int64
Public encryption key Id

Return Value

OpenPGP signed and encrypted message

Remarks

* (Note that this is not the same as first encrypt and then sign, because in that case a double compression is performed.)
Compression algorithm used is the one specified through Compression
Symmetric cipher algorithm used is the one specified through Cypher

Exceptions

ExceptionCondition
DidiSoft.Pgp..::..PGPExceptionif an OpenPGP related error has occurred
System.IO..::..IOExceptionI/O error
DidiSoft.Pgp.Exceptions..::..WrongPasswordExceptionif the supplied password for the private key is incorrect
DidiSoft.Pgp.Exceptions..::..WrongPrivateKeyExceptionif the supplied private key is not suitable for signing

See Also