NeoMutt  2024-10-02-37-gfa9146
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 "lib.h"
31
32struct AddressList;
33struct Body;
34struct Email;
35struct Envelope;
36struct Message;
37struct State;
38
43{
44 char *email;
45 char *hash;
46 char *label;
47 char *issuer;
48 char trust;
50 struct SmimeKey *next;
51};
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
73{
81};
82
83void smime_init(void);
84void smime_cleanup(void);
85
86int smime_class_application_handler(struct Body *b, struct State *s);
87struct Body * smime_class_build_smime_entity (struct Body *b, char *certlist);
88int smime_class_decrypt_mime (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **b_dec);
89char * smime_class_find_keys (const struct AddressList *addrlist, bool oppenc_mode);
90void smime_class_getkeys (struct Envelope *env);
91void smime_class_invoke_import (const char *infile, const char *mailbox);
93struct Body * smime_class_sign_message (struct Body *b, const struct AddressList *from);
95int smime_class_verify_one (struct Body *b, struct State *s, const char *tempfile);
96int smime_class_verify_sender (struct Email *e, struct Message *msg);
98
99#endif /* MUTT_NCRYPT_SMIME_H */
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:2121
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:2058
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:798
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:2140
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:1497
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:1332
void smime_class_getkeys(struct Envelope *env)
Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
Definition: smime.c:758
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:1130
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:1206
bool smime_class_valid_passphrase(void)
Ensure we have a valid passphrase - Implements CryptModuleSpecs::valid_passphrase() -.
Definition: smime.c:165
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:1706
void smime_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
Definition: smime.c:156
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:76
uint16_t KeyFlags
Flags describing PGP/SMIME keys, e.g. KEYFLAG_CANSIGN.
Definition: lib.h:125
ExpandoDataSmimeCmd
Expando UIDs for Smime Commands.
Definition: smime.h:73
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition: smime.h:79
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition: smime.h:74
@ ED_SMI_SIGNATURE_FILE
SmimeCommandContext.sig_fname.
Definition: smime.h:80
@ ED_SMI_DIGEST_ALGORITHM
SmimeCommandContext.digestalg.
Definition: smime.h:76
@ ED_SMI_CERTIFICATE_IDS
SmimeCommandContext.certificates.
Definition: smime.h:75
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition: smime.h:78
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition: smime.h:77
void smime_init(void)
Initialise smime globals.
Definition: smime.c:85
void smime_cleanup(void)
Clean up smime globals.
Definition: smime.c:95
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: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: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