NeoMutt  2024-11-14-34-g5aaf0d
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;
38struct State;
39
44{
45 char *email;
46 char *hash;
47 char *label;
48 char *issuer;
49 char trust;
51 struct SmimeKey *next;
52};
53ARRAY_HEAD(SmimeKeyArray, struct SmimeKey *);
54
59{
60 const char *key;
61 const char *cryptalg;
62 const char *digestalg;
63 const char *fname;
64 const char *sig_fname;
65 const char *certificates;
66 const char *intermediates;
67};
68
75{
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:2123
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:2060
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:799
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:2142
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:1499
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:1334
void smime_class_getkeys(struct Envelope *env)
Get the S/MIME keys required to encrypt this email - Implements CryptModuleSpecs::smime_getkeys() -.
Definition: smime.c:759
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:1132
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:1208
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:1708
void smime_class_void_passphrase(void)
Forget the cached passphrase - Implements CryptModuleSpecs::void_passphrase() -.
Definition: smime.c:156
Convenience wrapper for the library headers.
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:75
@ ED_SMI_MESSAGE_FILE
SmimeCommandContext.fname.
Definition: smime.h:81
@ ED_SMI_ALGORITHM
SmimeCommandContext.cryptalg.
Definition: smime.h:76
@ 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:77
@ ED_SMI_KEY
SmimeCommandContext.key.
Definition: smime.h:80
@ ED_SMI_INTERMEDIATE_IDS
SmimeCommandContext.intermediates.
Definition: smime.h:79
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:59
const char * sig_fname
s
Definition: smime.h:64
const char * intermediates
i
Definition: smime.h:66
const char * digestalg
d
Definition: smime.h:62
const char * cryptalg
a
Definition: smime.h:61
const char * key
k
Definition: smime.h:60
const char * fname
f
Definition: smime.h:63
const char * certificates
c
Definition: smime.h:65
An SIME key.
Definition: smime.h:44
KeyFlags flags
Definition: smime.h:50
char * hash
Definition: smime.h:46
struct SmimeKey * next
Definition: smime.h:51
char * issuer
Definition: smime.h:48
char * email
Definition: smime.h:45
char * label
Definition: smime.h:47
char trust
i=Invalid r=revoked e=expired u=unverified v=verified t=trusted
Definition: smime.h:49
Keep track when processing files.
Definition: state.h:48