OpenPGP signs and encrypts given String message in one pass with keys located in a KeyStore
Namespace: DidiSoft.PgpAssembly: 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
Compression algorithm used is the one specified through Compression
Symmetric cipher algorithm used is the one specified through Cypher
Exceptions
| Exception | Condition |
|---|---|
| DidiSoft.Pgp..::..PGPException | if an OpenPGP related error has occurred |
| System.IO..::..IOException | I/O error |
| DidiSoft.Pgp.Exceptions..::..WrongPasswordException | if the supplied password for the private key is incorrect |
| DidiSoft.Pgp.Exceptions..::..WrongPrivateKeyException | if the supplied private key is not suitable for signing |