certmanager/lib Library API Documentation

Encryption and Decryption
[Signing and Encrypting Actions]

Collaboration diagram for Encryption and Decryption:


Functions

bool CryptPlug::findCertificates (const char *addressee, char **certificates, int *newSize, bool secretOnly, char **attrOrder, const char *unknownAttrsHandling)
bool CryptPlug::encryptMessage (const char *cleartext, const char **ciphertext, const size_t *cipherLen, const char *addressee, struct StructuringInfo *structuring, int *errId, char **errTxt)
bool CryptPlug::encryptAndSignMessage (const char *cleartext, const char **ciphertext, const char *certificate, struct StructuringInfo *structuring)
bool CryptPlug::decryptMessage (const char *ciphertext, bool cipherIsBinary, int cipherLen, const char **cleartext, const char *certificate, int *errId, char **errTxt)
bool CryptPlug::decryptAndCheckMessage (const char *ciphertext, bool cipherIsBinary, int cipherLen, const char **cleartext, const char *certificate, bool *signatureFound, struct SignatureMetaData *sigmeta, int *errId, char **errTxt, char **attrOrder, const char *unknownAttrsHandling)
bool CryptPlugWrapper::findCertificates (const char *addressee, char **certificates, int *newSize, bool secretOnly)
bool CryptPlugWrapper::encryptMessage (const char *cleartext, const char **ciphertext, const size_t *cipherLen, const char *addressee, StructuringInfoWrapper &structuring, int *errId, char **errTxt)
bool CryptPlugWrapper::encryptAndSignMessage (const char *cleartext, const char **ciphertext, const char *certificate, StructuringInfoWrapper &structuring)
bool CryptPlugWrapper::decryptMessage (const char *ciphertext, bool cipherIsBinary, int cipherLen, char **cleartext, const char *certificate, int *errId, char **errTxt)
bool CryptPlugWrapper::decryptAndCheckMessage (const char *ciphertext, bool cipherIsBinary, int cipherLen, char **cleartext, const char *certificate, bool *signatureFound, CryptPlug::SignatureMetaData *sigmeta, int *errId, char **errTxt)

Detailed Description

The following methods are used to encrypt and decrypt email messages.

Function Documentation

bool CryptPlug::findCertificates const char *  addressee,
char **  certificates,
int *  newSize,
bool  secretOnly,
char **  attrOrder,
const char *  unknownAttrsHandling
[inherited]
 

Find all certificate for a given addressee.

NOTE: The certificate parameter must point to a not-yet allocated char*. The function will allocate the memory needed and return the size in newSize. If secretOnly is true, only secret keys are returned.

Definition at line 1551 of file cryptplug.cpp.

bool CryptPlug::encryptMessage const char *  cleartext,
const char **  ciphertext,
const size_t *  cipherLen,
const char *  addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct StructuringInfo structuring,
int *  errId,
char **  errTxt
[inherited]
 

Encrypts an email message in cleartext according to the addressee and the current settings (algorithm, etc.) and returns the encoded data bloc in *ciphertext. The length returned in *cipherLen tells you the size (==amount of bytes) of the ciphertext, if the structuring information would return with contentTEncCode set to "base64" the ciphertext might contain a char 0x00 and has to be converted into base64 before sending.

If the message could be encrypted, the function returns true, otherwise false.

Use the StructuringInfo data returned in parameter structuring to find out how to build the respective MIME object (or the plain text message body, resp.).

Note:
The function allocates memory for the *ciphertext, so mlass="mdname" nowrap> addressee,
struct