NeoMutt  2024-03-23-147-g885fbc
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
pgp.h
Go to the documentation of this file.
1
24#ifndef MUTT_NCRYPT_PGP_H
25#define MUTT_NCRYPT_PGP_H
26
27#include <stdbool.h>
28#include <stdio.h>
29#include "lib.h"
30
31struct AddressList;
32struct Body;
33struct Email;
34struct PgpKeyInfo;
35struct State;
36
43{
45 const char *fname;
46 const char *sig_fname;
47 const char *signas;
48 const char *ids;
49};
50
57{
63};
64
65char * pgp_fpr_or_lkeyid (struct PgpKeyInfo *k);
66char * pgp_keyid (struct PgpKeyInfo *k);
67char * pgp_long_keyid (struct PgpKeyInfo *k);
68char * pgp_short_keyid (struct PgpKeyInfo *k);
69char * pgp_this_keyid (struct PgpKeyInfo *k);
70bool pgp_use_gpg_agent (void);
71
72int pgp_class_application_handler (struct Body *b, struct State *state);
73bool pgp_class_check_traditional (FILE *fp, struct Body *b, bool just_one);
74int pgp_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec);
75int pgp_class_encrypted_handler (struct Body *b, struct State *state);
76struct Body * pgp_class_encrypt_message (struct Body *b, char *keylist, bool sign, const struct AddressList *from);
77void pgp_class_extract_key_from_attachment(FILE *fp, struct Body *b);
78char * pgp_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode);
80struct Body * pgp_class_sign_message (struct Body *b, const struct AddressList *from);
81struct Body * pgp_class_traditional_encryptsign (struct Body *b, SecurityFlags flags, char *keylist);
83int pgp_class_verify_one (struct Body *b, struct State *state, const char *tempfile);
85
86#endif /* MUTT_NCRYPT_PGP_H */
int pgp_class_application_handler(struct Body *b, struct State *state)
Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::applicat...
Definition: pgp.c:472
int pgp_class_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Decrypt an encrypted MIME part - Implements CryptModuleSpecs::decrypt_mime() -.
Definition: pgp.c:1162
int pgp_class_encrypted_handler(struct Body *b, struct State *state)
Manage a PGP or S/MIME encrypted MIME part - Implements CryptModuleSpecs::encrypted_handler() -.
Definition: pgp.c:1247
char * pgp_class_find_keys(const struct AddressList *addrlist, bool oppenc_mode)
Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -.
Definition: pgp.c:1466
bool pgp_class_check_traditional(FILE *fp, struct Body *b, bool just_one)
Look for inline (non-MIME) PGP content - Implements CryptModuleSpecs::pgp_check_traditional() -.
Definition: pgp.c:869
struct Body * pgp_class_encrypt_message(struct Body *b, char *keylist, bool sign, const struct AddressList *from)
PGP encrypt an email - Implements CryptModuleSpecs::pgp_encrypt_message() -.
Definition: pgp.c:1590
void pgp_class_extract_key_from_attachment(FILE *fp, struct Body *b)
Extract PGP key from an attachment - Implements CryptModuleSpecs::pgp_extract_key_from_attachment() -...
Definition: pgp.c:1003
struct Body * pgp_class_traditional_encryptsign(struct Body *b, SecurityFlags flags, char *keylist)
Create an inline PGP encrypted, signed email - Implements CryptModuleSpecs::pgp_traditional_encryptsi...
Definition: pgp.c:1724
SecurityFlags pgp_class_send_menu(struct Email *e)
Ask the user whether to sign and/or encrypt the email - Implements CryptModuleSpecs::send_menu() -.
Definition: pgp.c:1896
struct Body * pgp_class_sign_message(struct Body *b, const struct AddressList *from)
Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -.
Definition: pgp.c:1335
bool pgp_class_valid_passphrase(void)
Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
Definition: pgp.c:85
int pgp_class_verify_one(struct Body *b, struct State *state, const char *tempfile)
Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -.
Definition: pgp.c:898
void pgp_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
Definition: pgp.c:76
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:76
char * pgp_long_keyid(struct PgpKeyInfo *k)
Get a key's long id.
Definition: pgp.c:165
char * pgp_this_keyid(struct PgpKeyInfo *k)
Get the ID of this key.
Definition: pgp.c:191
char * pgp_keyid(struct PgpKeyInfo *k)
Get the ID of the main (parent) key.
Definition: pgp.c:204
char * pgp_fpr_or_lkeyid(struct PgpKeyInfo *k)
Get the fingerprint or long keyid.
Definition: pgp.c:234
char * pgp_short_keyid(struct PgpKeyInfo *k)
Get a key's short id.
Definition: pgp.c:177
ExpandoDataPgpCmd
Expando UIDs for PGP Commands.
Definition: pgp.h:57
@ ED_PGC_KEY_IDS
PgpCommandContext.ids.
Definition: pgp.h:60
@ ED_PGC_FILE_SIGNATURE
PgpCommandContext.sig_fname.
Definition: pgp.h:59
@ ED_PGC_NEED_PASS
PgpCommandContext.need_passphrase.
Definition: pgp.h:61
@ ED_PGC_SIGN_AS
PgpCommandContext.signas.
Definition: pgp.h:62
@ ED_PGC_FILE_MESSAGE
PgpCommandContext.fname.
Definition: pgp.h:58
bool pgp_use_gpg_agent(void)
Does the user want to use the gpg agent?
Definition: pgp.c:127
Key value store.
The body of an email.
Definition: body.h:36
The envelope/body of an email.
Definition: email.h:39
Data for a PGP command.
Definition: pgp.h:43
bool need_passphrase
p
Definition: pgp.h:44
const char * signas
a
Definition: pgp.h:47
const char * fname
f
Definition: pgp.h:45
const char * ids
r
Definition: pgp.h:48
const char * sig_fname
s
Definition: pgp.h:46
Information about a PGP key.
Definition: pgplib.h:47
Keep track when processing files.
Definition: state.h:48