NeoMutt  2022-04-29-81-g9c5a59
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 Message;
37 struct State;
38 
47 {
48  int identifier;
49 
56  void (*init)(void);
57 
64  void(*cleanup)(void);
65 
72  void (*void_passphrase)(void);
73 
85  bool (*valid_passphrase)(void);
86 
99  int (*decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur);
100 
111  int (*application_handler)(struct Body *m, struct State *s);
112 
123  int (*encrypted_handler)(struct Body *m, struct State *s);
124 
138  char *(*find_keys)(const struct AddressList *addrlist, bool oppenc_mode);
139 
150  struct Body *(*sign_message)(struct Body *a, const struct AddressList *from);
151 
163  int (*verify_one)(struct Body *sigbdy, struct State *s, const char *tempf);
164 
174 
182  void (*set_sender)(const char *sender);
183 
198  struct Body *(*pgp_encrypt_message)(struct Body *a, char *keylist, bool sign, const struct AddressList *from);
199 
208  struct Body *(*pgp_make_key_attachment)(void);
209 
221  bool (*pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one);
222 
234  struct Body *(*pgp_traditional_encryptsign)(struct Body *a, SecurityFlags flags, char *keylist);
235 
243  void (*pgp_invoke_getkeys)(struct Address *addr);
244 
252  void (*pgp_invoke_import)(const char *fname);
253 
262  void (*pgp_extract_key_from_attachment)(FILE *fp, struct Body *top);
263 
271  void (*smime_getkeys)(struct Envelope *env);
272 
283  int (*smime_verify_sender)(struct Email *e, struct Message *msg);
284 
295  struct Body *(*smime_build_smime_entity)(struct Body *a, char *certlist);
296 
305  void (*smime_invoke_import)(const char *infile, const char *mailbox);
306 };
307 
308 /* High Level crypto module interface */
309 void crypto_module_register(struct CryptModuleSpecs *specs);
311 
312 #endif /* MUTT_NCRYPT_CRYPT_MOD_H */
void crypto_module_register(struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition: crypt_mod.c:51
struct CryptModuleSpecs * crypto_module_lookup(int identifier)
Lookup a crypto module by name.
Definition: crypt_mod.c:65
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:74
Key value store.
An email address.
Definition: address.h:36
The body of an email.
Definition: body.h:36
int(* verify_one)(struct Body *sigbdy, struct State *s, const char *tempf)
Definition: crypt_mod.h:163
void(* pgp_invoke_import)(const char *fname)
Definition: crypt_mod.h:252
int(* encrypted_handler)(struct Body *m, struct State *s)
Definition: crypt_mod.h:123
int(* decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Definition: crypt_mod.h:99
void(* smime_getkeys)(struct Envelope *env)
Definition: crypt_mod.h:271
void(* set_sender)(const char *sender)
Definition: crypt_mod.h:182
void(* pgp_extract_key_from_attachment)(FILE *fp, struct Body *top)
Definition: crypt_mod.h:262
void(* init)(void)
Definition: crypt_mod.h:56
int identifier
Identifying bit.
Definition: crypt_mod.h:48
bool(* valid_passphrase)(void)
Definition: crypt_mod.h:85
void(* cleanup)(void)
Definition: crypt_mod.h:64
SecurityFlags(* send_menu)(struct Email *e)
Definition: crypt_mod.h:173
int(* smime_verify_sender)(struct Email *e, struct Message *msg)
Definition: crypt_mod.h:283
int(* application_handler)(struct Body *m, struct State *s)
Definition: crypt_mod.h:111
bool(* pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one)
Definition: crypt_mod.h:221
void(* void_passphrase)(void)
Definition: crypt_mod.h:72
void(* pgp_invoke_getkeys)(struct Address *addr)
Definition: crypt_mod.h:243
void(* smime_invoke_import)(const char *infile, const char *mailbox)
Definition: crypt_mod.h:305
The envelope/body of an email.
Definition: email.h:37
The header of an Email.
Definition: envelope.h:57
A local copy of an email.
Definition: mxapi.h:43
Keep track when processing files.
Definition: state.h:46