NeoMutt  2024-12-12-19-ge4b57e
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
smime.h
Go to the documentation of this file.
1
24#ifndef MUTT_NCRYPT_SMIME_H
25#define MUTT_NCRYPT_SMIME_H
26
27#include "config.h"
28#include <stdbool.h>
29#include <stdio.h>
30#include "mutt/lib.h"
31#include "lib.h"
32
33struct AddressList;
34struct Body;
35struct Email;
36struct Envelope;
37struct Message;
38
43{
44 char *email;
45 char *hash;
46 char *label;
47 char *issuer;
48 char trust;
50 struct SmimeKey *next;
51};
52ARRAY_HEAD(SmimeKeyArray, struct SmimeKey *);
53
58{
59 const char *key;
60 const char *cryptalg;
61 const char *digestalg;
62 const char *fname;
63 const char *sig_fname;
64 const char *certificates;
65 const char *intermediates;
66};
67
74{
83};
84
85void smime_init(void);
86void smime_cleanup(void);
87
88int smime_class_application_handler(struct Body *b, struct State *s);
89struct Body * smime_class_build_smime_entity (struct Body *b, char *certlist);
90int smime_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec);
91char * smime_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode);
92void smime_class_getkeys (struct Envelope *env);
93void smime_class_invoke_import (const char *infile, const char *mailbox);
95struct Body * smime_class_sign_message (struct Body *b, const struct AddressList *from);
97int smime_class_verify_one (struct Body *b, struct State *s, const char *tempfile);
98int smime_class_verify_sender (struct Email *e, struct Message *msg);
100
101#endif /* MUTT_NCRYPT_SMIME_H */
#define ARRAY_HEAD(name, type)
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:1980
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:1917
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:656
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:1999
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:1356
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:1191
void smime_class_getkeys(struct Envelope *env)
Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
Definition: smime.c:616
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:989
int smime_class_verify_sender(struct Email *e, struct Message *msg)
Does the sender match the certificate? - Implements CryptModuleSpecs::smime_verify_sender() -.
Definition: smime.c:1065
bool smime_class_valid_passphrase(void)
Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
Definition: smime.c:158
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:1565
void smime_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
Definition: smime.c:149
Convenience wrapper for the library headers.
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:82
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition: lib.h:131
ExpandoDataSmimeCmd
Expando UIDs for Smime Commands.
Definition: smime.h:74
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition: smime.h:81
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition: smime.h:75
@ ED_SMI_SIGNATURE_FILE
SmimeCommandContext.sig_fname.
Definition: smime.h:82
@ ED_SMI_DIGEST_ALGORITHM
SmimeCommandContext.digestalg.
Definition: smime.h:78
@ ED_SMI_CERTIFICATE_IDS
SmimeCommandContext.certificates.
Definition: smime.h:76
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition: smime.h:80
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition: smime.h:79
@ ED_SMI_CERTIFICATE_PATH
Path of Smime certificates.
Definition: smime.h:77
void smime_init(void)
Initialise smime globals.
Definition: smime.c:82
void smime_cleanup(void)
Clean up smime globals.
Definition: smime.c:92
Key value store.
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:58
const char * sig_fname
s
Definition: smime.h:63
const char * intermediates
i
Definition: smime.h:65
const char * digestalg
d
Definition: smime.h:61
const char * cryptalg
a
Definition: smime.h:60
const char * key
k
Definition: smime.h:59
const char * fname
f
Definition: smime.h:62
const char * certificates
c
Definition: smime.h:64
An SIME key.
Definition: smime.h:43
KeyFlags flags
Definition: smime.h:49
char * hash
Definition: smime.h:45
struct SmimeKey * next
Definition: smime.h:50
char * issuer
Definition: smime.h:47
char * email
Definition: smime.h:44
char * label
Definition: smime.h:46
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition: smime.h:48
Keep track when processing files.
Definition: state.h:48