NeoMutt  2025-12-11-236-g400a5f
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
smime.h
Go to the documentation of this file.
1
23
24#ifndef MUTT_NCRYPT_SMIME_H
25#define MUTT_NCRYPT_SMIME_H
26
27#include <stdbool.h>
28#include <stdio.h>
29#include "mutt/lib.h"
30#include "lib.h"
31
32struct AddressList;
33struct Body;
34struct Email;
35struct Envelope;
36struct Message;
37
42{
43 char *email;
44 char *hash;
45 char *label;
46 char *issuer;
47 char trust;
49 struct SmimeKey *next;
50};
51ARRAY_HEAD(SmimeKeyArray, struct SmimeKey *);
52
57{
58 const char *key;
59 const char *cryptalg;
60 const char *digestalg;
61 const char *fname;
62 const char *sig_fname;
63 const char *certificates;
64 const char *intermediates;
65};
66
83
84void smime_init(void);
85void smime_cleanup(void);
86
87int smime_class_application_handler(struct Body *b, struct State *s);
88struct Body * smime_class_build_smime_entity (struct Body *b, char *certlist);
89int smime_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec);
90char * smime_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode);
91void smime_class_getkeys (struct Envelope *env);
92void smime_class_invoke_import (const char *infile, const char *mailbox);
94struct Body * smime_class_sign_message (struct Body *b, const struct AddressList *from);
96int smime_class_verify_one (struct Body *b, struct State *s, const char *tempfile);
97int smime_class_verify_sender (struct Email *e, struct Message *msg);
99
100#endif /* MUTT_NCRYPT_SMIME_H */
#define ARRAY_HEAD(name, T)
Define a named struct for arrays of elements of a certain type.
Definition array.h:47
int smime_class_application_handler(struct Body *b, struct State *s)
Manage the MIME type "application/pgp" or "application/smime" - Implements CryptModuleSpecs::applicat...
Definition smime.c:1981
int smime_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 smime.c:1918
char * smime_class_find_keys(const struct AddressList *addrlist, bool oppenc_mode)
Find the keyids of the recipients of a message - Implements CryptModuleSpecs::find_keys() -.
Definition smime.c:654
SecurityFlags smime_class_send_menu(struct Email *e)
Ask the user whether to sign and/or encrypt the email - Implements CryptModuleSpecs::send_menu() -.
Definition smime.c:2000
struct Body * smime_class_sign_message(struct Body *b, const struct AddressList *from)
Cryptographically sign the Body of a message - Implements CryptModuleSpecs::sign_message() -.
Definition smime.c:1354
struct Body * smime_class_build_smime_entity(struct Body *b, char *certlist)
Encrypt the email body to all recipients - Implements CryptModuleSpecs::smime_build_smime_entity() -.
Definition smime.c:1189
void smime_class_getkeys(struct Envelope *env)
Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
Definition smime.c:614
void smime_class_invoke_import(const char *infile, const char *mailbox)
Add a certificate and update index file (externally) - Implements CryptModuleSpecs::smime_invoke_impo...
Definition smime.c:987
int smime_class_verify_sender(struct Email *e, struct Message *msg)
Does the sender match the certificate?
Definition smime.c:1063
bool smime_class_valid_passphrase(void)
Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
Definition smime.c:155
int smime_class_verify_one(struct Body *b, struct State *s, const char *tempfile)
Check a signed MIME part against a signature - Implements CryptModuleSpecs::verify_one() -.
Definition smime.c:1566
void smime_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
Definition smime.c:146
Convenience wrapper for the library headers.
API for encryption/signing of emails.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition lib.h:84
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition lib.h:133
ExpandoDataSmimeCmd
Expando UIDs for Smime Commands.
Definition smime.h:73
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition smime.h:80
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition smime.h:74
@ ED_SMI_SIGNATURE_FILE
SmimeCommandContext.sig_fname.
Definition smime.h:81
@ ED_SMI_DIGEST_ALGORITHM
SmimeCommandContext.digestalg.
Definition smime.h:77
@ ED_SMI_CERTIFICATE_IDS
SmimeCommandContext.certificates.
Definition smime.h:75
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition smime.h:79
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition smime.h:78
@ ED_SMI_CERTIFICATE_PATH
Path of Smime certificates.
Definition smime.h:76
void smime_init(void)
Initialise smime globals.
Definition smime.c:79
void smime_cleanup(void)
Clean up smime globals.
Definition smime.c:89
The body of an email.
Definition body.h:36
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
Data for a SIME command.
Definition smime.h:57
const char * sig_fname
s
Definition smime.h:62
const char * intermediates
i
Definition smime.h:64
const char * digestalg
d
Definition smime.h:60
const char * cryptalg
a
Definition smime.h:59
const char * key
k
Definition smime.h:58
const char * fname
f
Definition smime.h:61
const char * certificates
c
Definition smime.h:63
An SIME key.
Definition smime.h:42
KeyFlags flags
Key flags.
Definition smime.h:48
char * hash
Key hash.
Definition smime.h:44
struct SmimeKey * next
Linked list.
Definition smime.h:49
char * issuer
Key issuer.
Definition smime.h:46
char * email
Email address.
Definition smime.h:43
char * label
Key label.
Definition smime.h:45
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition smime.h:47
Keep track when processing files.
Definition state.h:48