NeoMutt  2025-12-11-911-gd8d604
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
crypt_mod.h
Go to the documentation of this file.
1
23
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 "mutt/lib.h"
30#include "lib.h"
31
32struct Address;
33struct AddressList;
34struct Body;
35struct Email;
36struct Envelope;
37struct Message;
38struct NcryptModuleData;
39
48{
50
57 void (*init)(void);
58
65 void (*cleanup)(struct NcryptModuleData *mod_data);
66
73 void (*void_passphrase)(void);
74
86 bool (*valid_passphrase)(void);
87
100 int (*decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec);
101
112 int (*application_handler)(struct Body *b, struct State *state);
113
124 int (*encrypted_handler)(struct Body *b, struct State *state);
125
139 char *(*find_keys)(const struct AddressList *addrlist, bool oppenc_mode);
140
151 struct Body *(*sign_message)(struct Body *b, const struct AddressList *from);
152
164 int (*verify_one)(struct Body *b, struct State *state, const char *tempf);
165
175
183 void (*set_sender)(const char *sender);
184
199 struct Body *(*pgp_encrypt_message)(struct Body *b, char *keylist, bool sign, const struct AddressList *from);
200
209 struct Body *(*pgp_make_key_attachment)(void);
210
222 bool (*pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one);
223
235 struct Body *(*pgp_traditional_encryptsign)(struct Body *b, SecurityFlags flags, char *keylist);
236
244 void (*pgp_invoke_getkeys)(struct Address *addr);
245
253 void (*pgp_invoke_import)(const char *fname);
254
263 void (*pgp_extract_key_from_attachment)(FILE *fp, struct Body *b);
264
272 void (*smime_getkeys)(struct Envelope *env);
273
284 int (*smime_verify_sender)(struct Email *e, struct Message *msg);
285
296 struct Body *(*smime_build_smime_entity)(struct Body *b, char *certlist);
297
306 void (*smime_invoke_import)(const char *infile, const char *mailbox);
307};
308
315{
316 const struct CryptModuleSpecs *specs;
318};
319STAILQ_HEAD(CryptModuleList, CryptModule);
320
321/* High Level crypto module interface */
322void crypto_module_register(const struct CryptModuleSpecs *specs);
323const struct CryptModuleSpecs *crypto_module_lookup(struct NcryptModuleData *mod_data, int identifier);
324
325#endif /* MUTT_NCRYPT_CRYPT_MOD_H */
const struct CryptModuleSpecs * crypto_module_lookup(struct NcryptModuleData *mod_data, int identifier)
Lookup a crypto module by name.
Definition crypt_mod.c:57
void crypto_module_register(const struct CryptModuleSpecs *specs)
Register a new crypto module.
Definition crypt_mod.c:41
Convenience wrapper for the library headers.
API for encryption/signing of emails.
uint16_t SecurityFlags
Definition lib.h:104
#define STAILQ_HEAD(name, type)
Definition queue.h:312
An email address.
Definition address.h:35
The body of an email.
Definition body.h:36
int(* encrypted_handler)(struct Body *b, struct State *state)
Definition crypt_mod.h:124
void(* pgp_invoke_import)(const char *fname)
Definition crypt_mod.h:253
int(* decrypt_mime)(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec)
Definition crypt_mod.h:100
void(* smime_getkeys)(struct Envelope *env)
Definition crypt_mod.h:272
void(* set_sender)(const char *sender)
Definition crypt_mod.h:183
void(* pgp_extract_key_from_attachment)(FILE *fp, struct Body *b)
Definition crypt_mod.h:263
void(* init)(void)
Definition crypt_mod.h:57
int identifier
Identifying bit.
Definition crypt_mod.h:49
bool(* valid_passphrase)(void)
Definition crypt_mod.h:86
int(* application_handler)(struct Body *b, struct State *state)
Definition crypt_mod.h:112
SecurityFlags(* send_menu)(struct Email *e)
Definition crypt_mod.h:174
int(* smime_verify_sender)(struct Email *e, struct Message *msg)
Definition crypt_mod.h:284
bool(* pgp_check_traditional)(FILE *fp, struct Body *b, bool just_one)
Definition crypt_mod.h:222
int(* verify_one)(struct Body *b, struct State *state, const char *tempf)
Definition crypt_mod.h:164
void(* void_passphrase)(void)
Definition crypt_mod.h:73
void(* cleanup)(struct NcryptModuleData *mod_data)
Definition crypt_mod.h:65
void(* pgp_invoke_getkeys)(struct Address *addr)
Definition crypt_mod.h:244
void(* smime_invoke_import)(const char *infile, const char *mailbox)
Definition crypt_mod.h:306
A crypto plugin module.
Definition crypt_mod.h:315
const struct CryptModuleSpecs * specs
Crypto module definition.
Definition crypt_mod.h:316
STAILQ_ENTRY(CryptModule) entries
Linked list.
The envelope/body of an email.
Definition email.h:39
The header of an Email.
Definition envelope.h:57
A local copy of an email.
Definition message.h:34
Ncrypt private Module data.
Definition module_data.h:38
Keep track when processing files.
Definition state.h:54