Wrapper for PGP/SMIME calls to GPGME. More...
Go to the source code of this file.
Data Structures | |
struct | CryptKeyInfo |
A stored PGP key. More... | |
struct | CryptEntry |
An entry in the Select-Key menu. More... | |
Enumerations | |
enum | KeyInfo { KIP_NAME = 0 , KIP_AKA , KIP_VALID_FROM , KIP_VALID_TO , KIP_KEY_TYPE , KIP_KEY_USAGE , KIP_FINGERPRINT , KIP_SERIAL_NO , KIP_ISSUED_BY , KIP_SUBKEY , KIP_MAX } |
PGP Key info. More... | |
enum | KeyCap { KEY_CAP_CAN_ENCRYPT , KEY_CAP_CAN_SIGN , KEY_CAP_CAN_CERTIFY } |
PGP/SMIME Key Capabilities. More... | |
Functions | |
void | pgp_gpgme_set_sender (const char *sender) |
Set the sender of the email - Implements CryptModuleSpecs::set_sender() -. | |
int | pgp_gpgme_application_handler (struct Body *b, struct State *state) |
Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::application_handler() -. | |
bool | pgp_gpgme_check_traditional (FILE *fp, struct Body *b, bool just_one) |
Look for inline (non-MIME) PGP content - Implements CryptModuleSpecs::pgp_check_traditional() -. | |
int | pgp_gpgme_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec) |
Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -. | |
int | pgp_gpgme_encrypted_handler (struct Body *b, struct State *state) |
Manage a PGP or S/MIME encrypted MIME part - Implements CryptModuleSpecs::encrypted_handler() -. | |
struct Body * | pgp_gpgme_encrypt_message (struct Body *b, char *keylist, bool sign, const struct AddressList *from) |
PGP encrypt an email - Implements CryptModuleSpecs::pgp_encrypt_message() -. | |
char * | pgp_gpgme_find_keys (const struct AddressList *addrlist, bool oppenc_mode) |
Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -. | |
void | pgp_gpgme_invoke_import (const char *fname) |
Import a key from a message into the user's public key ring - Implements CryptModuleSpecs::pgp_invoke_import() -. | |
struct Body * | pgp_gpgme_make_key_attachment (void) |
Generate a public key attachment - Implements CryptModuleSpecs::pgp_make_key_attachment() -. | |
SecurityFlags | pgp_gpgme_send_menu (struct Email *e) |
Ask the user whether to sign and/or encrypt the email - Implements CryptModuleSpecs::send_menu() -. | |
struct Body * | pgp_gpgme_sign_message (struct Body *b, const struct AddressList *from) |
Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -. | |
int | pgp_gpgme_verify_one (struct Body *b, struct State *state, const char *tempfile) |
Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -. | |
int | smime_gpgme_application_handler (struct Body *b, struct State *state) |
Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::application_handler() -. | |
struct Body * | smime_gpgme_build_smime_entity (struct Body *b, char *keylist) |
Encrypt the email body to all recipients - Implements CryptModuleSpecs::smime_build_smime_entity() -. | |
int | smime_gpgme_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec) |
Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -. | |
char * | smime_gpgme_find_keys (const struct AddressList *addrlist, bool oppenc_mode) |
Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -. | |
void | smime_gpgme_init (void) |
Initialise the crypto module - Implements CryptModuleSpecs::init() -. | |
SecurityFlags | smime_gpgme_send_menu (struct Email *e) |
Ask the user whether to sign and/or encrypt the email - Implements CryptModuleSpecs::send_menu() -. | |
struct Body * | smime_gpgme_sign_message (struct Body *b, const struct AddressList *from) |
Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -. | |
int | smime_gpgme_verify_one (struct Body *b, struct State *state, const char *tempfile) |
Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -. | |
int | smime_gpgme_verify_sender (struct Email *e, struct Message *msg) |
Does the sender match the certificate? - Implements CryptModuleSpecs::smime_verify_sender() -. | |
gpgme_ctx_t | create_gpgme_context (bool for_smime) |
Create a new GPGME context. | |
struct CryptKeyInfo * | crypt_copy_key (struct CryptKeyInfo *key) |
Return a copy of KEY. | |
const char * | crypt_fpr_or_lkeyid (struct CryptKeyInfo *k) |
Find the fingerprint of a key. | |
bool | crypt_id_is_strong (struct CryptKeyInfo *key) |
Is the key strong. | |
int | crypt_id_is_valid (struct CryptKeyInfo *key) |
Is key ID valid. | |
const char * | crypt_keyid (struct CryptKeyInfo *k) |
Find the ID for the key. | |
int | digit (const char *s) |
unsigned int | key_check_cap (gpgme_key_t key, enum KeyCap cap) |
Check the capabilities of a key. | |
Wrapper for PGP/SMIME calls to GPGME.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file crypt_gpgme.h.
enum KeyInfo |
PGP Key info.
Definition at line 56 of file crypt_gpgme.h.
enum KeyCap |
PGP/SMIME Key Capabilities.
Enumerator | |
---|---|
KEY_CAP_CAN_ENCRYPT | Key can be used for encryption. |
KEY_CAP_CAN_SIGN | Key can be used for signing. |
KEY_CAP_CAN_CERTIFY | Key can be used to certify. |
Definition at line 74 of file crypt_gpgme.h.
gpgme_ctx_t create_gpgme_context | ( | bool | for_smime | ) |
Create a new GPGME context.
for_smime | If true, protocol of the context is set to CMS |
ptr | New GPGME context |
Definition at line 361 of file crypt_gpgme.c.
struct CryptKeyInfo * crypt_copy_key | ( | struct CryptKeyInfo * | key | ) |
Return a copy of KEY.
key | Key to copy |
ptr | Copy of key |
Definition at line 234 of file crypt_gpgme.c.
const char * crypt_fpr_or_lkeyid | ( | struct CryptKeyInfo * | k | ) |
Find the fingerprint of a key.
k | Key to examine |
ptr | Fingerprint if available, otherwise the long keyid |
Definition at line 214 of file crypt_gpgme.c.
bool crypt_id_is_strong | ( | struct CryptKeyInfo * | key | ) |
Is the key strong.
key | Key to test |
true | Validity of key is sufficient |
Definition at line 275 of file crypt_gpgme.c.
int crypt_id_is_valid | ( | struct CryptKeyInfo * | key | ) |
Is key ID valid.
key | Key to test |
true | Key is valid |
When the key is not marked as unusable
Definition at line 310 of file crypt_gpgme.c.
const char * crypt_keyid | ( | struct CryptKeyInfo * | k | ) |
Find the ID for the key.
k | Key to use |
ptr | ID string for the key |
Return the keyID for the key K. Note that this string is valid as long as K is valid
Definition at line 138 of file crypt_gpgme.c.
int digit | ( | const char * | s | ) |
unsigned int key_check_cap | ( | gpgme_key_t | key, |
enum KeyCap | cap | ||
) |
Check the capabilities of a key.
key | GPGME key |
cap | Flags, e.g. KEY_CAP_CAN_ENCRYPT |
>0 | Key has the capabilities |
Definition at line 2948 of file crypt_gpgme.c.