NeoMutt  2020-06-26-250-g349c94
Teaching an old dog new tricks
DOXYGEN
crypt_mod.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_NCRYPT_CRYPT_MOD_H
25 #define MUTT_NCRYPT_CRYPT_MOD_H
26 
27 #include <stdbool.h>
28 #include <stdio.h>
29 #include "lib.h"
30 
31 struct Address;
32 struct AddressList;
33 struct Body;
34 struct Email;
35 struct Envelope;
36 struct Mailbox;
37 struct State;
38 
45 {
46  int identifier;
47 
51  void (*init)(void);
52 
56  void(*cleanup)(void);
57 
61  void (*void_passphrase)(void);
62 
71  bool (*valid_passphrase)(void);
72 
82  int (*decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
83 
91  int (*application_handler)(struct Body *m, struct State *s);
92 
100  int (*encrypted_handler)(struct Body *m, struct State *s);
101 
112  char *(*find_keys)(struct AddressList *addrlist, bool oppenc_mode);
113 
121  struct Body *(*sign_message)(struct Body *a, const struct AddressList *from);
122 
131  int (*verify_one)(struct Body *sigbdy, struct State *s, const char *tempf);
132 
138  int (*send_menu)(struct Email *e);
139 
144  void (*set_sender)(const char *sender);
145 
157  struct Body *(*pgp_encrypt_message)(struct Body *a, char *keylist, bool sign, const struct AddressList *from);
158 
164  struct Body *(*pgp_make_key_attachment)(void);
165 
174  int (*pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one);
175 
184  struct Body *(*pgp_traditional_encryptsign)(struct Body *a, SecurityFlags flags, char *keylist);
185 
190  void (*pgp_invoke_getkeys)(struct Address *addr);
191 
196  void (*pgp_invoke_import)(const char *fname);
197 
203  void (*pgp_extract_key_from_attachment)(FILE *fp, struct Body *top);
204 
209  void (*smime_getkeys)(struct Envelope *env);
210 
218  int (*smime_verify_sender)(struct Mailbox *m, struct Email *e);
219 
227  struct Body *(*smime_build_smime_entity)(struct Body *a, char *certlist);
228 
234  void (*smime_invoke_import)(const char *infile, const char *mailbox);
235 };
236 
237 /* High Level crypto module interface */
238 void crypto_module_register(struct CryptModuleSpecs *specs);
240 
241 #endif /* MUTT_NCRYPT_CRYPT_MOD_H */
int(* send_menu)(struct Email *e)
Ask the user whether to sign and/or encrypt the email.
Definition: crypt_mod.h:138
The envelope/body of an email.
Definition: email.h:37
int(* encrypted_handler)(struct Body *m, struct State *s)
Manage a PGP or S/MIME encrypted MIME part.
Definition: crypt_mod.h:100
int(* verify_one)(struct Body *sigbdy, struct State *s, const char *tempf)
Check a signed MIME part against a signature.
Definition: crypt_mod.h:131
int(* application_handler)(struct Body *m, struct State *s)
Manage the MIME type "application/pgp" or "application/smime".
Definition: crypt_mod.h:91
void(* pgp_extract_key_from_attachment)(FILE *fp, struct Body *top)
Extract PGP key from an attachment.
Definition: crypt_mod.h:203
void(* void_passphrase)(void)
Forget the cached passphrase.
Definition: crypt_mod.h:61
int(* pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one)
Look for inline (non-MIME) PGP content.
Definition: crypt_mod.h:174
An email address.
Definition: address.h:34
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:83
The body of an email.
Definition: body.h:34
void(* smime_invoke_import)(const char *infile, const char *mailbox)
Add a certificate and update index file (externally)
Definition: crypt_mod.h:234
int(* decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Decrypt an encrypted MIME part.
Definition: crypt_mod.h:82
void crypto_module_register(struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition: crypt_mod.c:51
A mailbox.
Definition: mailbox.h:81
Crypto API.
Definition: crypt_mod.h:44
void(* set_sender)(const char *sender)
Set the sender of the email.
Definition: crypt_mod.h:144
int(* smime_verify_sender)(struct Mailbox *m, struct Email *e)
Does the sender match the certificate?
Definition: crypt_mod.h:218
void(* cleanup)(void)
Clean up the crypt module.
Definition: crypt_mod.h:56
API for encryption/signing of emails.
void(* pgp_invoke_import)(const char *fname)
Import a key from a message into the user&#39;s public key ring.
Definition: crypt_mod.h:196
bool(* valid_passphrase)(void)
Ensure we have a valid passphrase.
Definition: crypt_mod.h:71
int identifier
Identifying bit.
Definition: crypt_mod.h:46
Keep track when processing files.
Definition: state.h:44
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65
void(* smime_getkeys)(struct Envelope *env)
Get the S/MIME keys required to encrypt this email.
Definition: crypt_mod.h:209
void(* pgp_invoke_getkeys)(struct Address *addr)
Run a command to download a PGP key.
Definition: crypt_mod.h:190
void(* init)(void)
Initialise the crypto module.
Definition: crypt_mod.h:51
The header of an Email.
Definition: envelope.h:54