NeoMutt  2019-12-07-168-gc45f47
Teaching an old dog new tricks
DOXYGEN
CryptModuleSpecs Struct Reference

Crypto API. More...

#include "crypt_mod.h"

+ Collaboration diagram for CryptModuleSpecs:

Data Fields

int identifier
 Identifying bit. More...
 
void(* init )(void)
 Initialise the crypto module. More...
 
void(* void_passphrase )(void)
 Forget the cached passphrase. More...
 
bool(* valid_passphrase )(void)
 Ensure we have a valid passphrase. More...
 
int(* decrypt_mime )(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
 Decrypt an encrypted MIME part. More...
 
int(* application_handler )(struct Body *m, struct State *s)
 Manage the MIME type "application/pgp" or "application/smime". More...
 
int(* encrypted_handler )(struct Body *m, struct State *s)
 Manage a PGP or S/MIME encrypted MIME part. More...
 
char *(* find_keys )(struct AddressList *addrlist, bool oppenc_mode)
 Find the keyids of the recipients of a message. More...
 
struct Body *(* sign_message )(struct Body *a, const struct AddressList *from)
 Cryptographically sign the Body of a message. More...
 
int(* verify_one )(struct Body *sigbdy, struct State *s, const char *tempf)
 Check a signed MIME part against a signature. More...
 
int(* send_menu )(struct Email *e)
 Ask the user whether to sign and/or encrypt the email. More...
 
void(* set_sender )(const char *sender)
 Set the sender of the email. More...
 
struct Body *(* pgp_encrypt_message )(struct Body *a, char *keylist, bool sign, const struct AddressList *from)
 PGP encrypt an email. More...
 
struct Body *(* pgp_make_key_attachment )(void)
 Generate a public key attachment. More...
 
int(* pgp_check_traditional )(FILE *fp, struct Body *b, bool just_one)
 Look for inline (non-MIME) PGP content. More...
 
struct Body *(* pgp_traditional_encryptsign )(struct Body *a, SecurityFlags flags, char *keylist)
 Create an inline PGP encrypted, signed email. More...
 
void(* pgp_invoke_getkeys )(struct Address *addr)
 Run a command to download a PGP key. More...
 
void(* pgp_invoke_import )(const char *fname)
 Import a key from a message into the user's public key ring. More...
 
void(* pgp_extract_key_from_attachment )(FILE *fp, struct Body *top)
 Extract PGP key from an attachment. More...
 
void(* smime_getkeys )(struct Envelope *env)
 Get the S/MIME keys required to encrypt this email. More...
 
int(* smime_verify_sender )(struct Mailbox *m, struct Email *e)
 Does the sender match the certificate? More...
 
struct Body *(* smime_build_smime_entity )(struct Body *a, char *certlist)
 Encrypt the email body to all recipients. More...
 
void(* smime_invoke_import )(const char *infile, const char *mailbox)
 Add a certificate and update index file (externally) More...
 

Detailed Description

Crypto API.

A structure to describe a crypto module.

Definition at line 44 of file crypt_mod.h.

Field Documentation

◆ identifier

int CryptModuleSpecs::identifier

Identifying bit.

Definition at line 46 of file crypt_mod.h.

◆ init

void(* CryptModuleSpecs::init) (void)

Initialise the crypto module.

Definition at line 51 of file crypt_mod.h.

◆ void_passphrase

void(* CryptModuleSpecs::void_passphrase) (void)

Forget the cached passphrase.

Definition at line 55 of file crypt_mod.h.

◆ valid_passphrase

bool(* CryptModuleSpecs::valid_passphrase) (void)

Ensure we have a valid passphrase.

Return values
trueSuccess
falseFailed

If the passphrase is within the expiry time (backend-specific), use it. If not prompt the user again.

Definition at line 64 of file crypt_mod.h.

◆ decrypt_mime

int(* CryptModuleSpecs::decrypt_mime) (FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)

Decrypt an encrypted MIME part.

Parameters
[in]fp_inFile containing the encrypted part
[out]fp_outFile containing the decrypted part
[in]bBody of the email
[out]curBody containing the decrypted part
Return values
0Success
-1Failure

Definition at line 74 of file crypt_mod.h.

◆ application_handler

int(* CryptModuleSpecs::application_handler) (struct Body *m, struct State *s)

Manage the MIME type "application/pgp" or "application/smime".

Parameters
mBody of the email
sState of text being processed
Return values
0Success
-1Error

Definition at line 82 of file crypt_mod.h.

◆ encrypted_handler

int(* CryptModuleSpecs::encrypted_handler) (struct Body *m, struct State *s)

Manage a PGP or S/MIME encrypted MIME part.

Parameters
mBody of the email
sState of text being processed
Return values
0Success
-1Error

Definition at line 90 of file crypt_mod.h.

◆ find_keys

char*(* CryptModuleSpecs::find_keys) (struct AddressList *addrlist, bool oppenc_mode)

Find the keyids of the recipients of a message.

Parameters
addrlistAddress List
oppenc_modeIf true, use opportunistic encryption
Return values
ptrSpace-separated string of keys
NULLAt least one of the keys can't be found

If oppenc_mode is true, only keys that can be determined without prompting will be used.

Definition at line 101 of file crypt_mod.h.

◆ sign_message

struct Body*(* CryptModuleSpecs::sign_message) (struct Body *a, const struct AddressList *from)

Cryptographically sign the Body of a message.

Parameters
aBody of the message
fromFrom line
Return values
ptrNew encrypted Body
NULLError

Definition at line 109 of file crypt_mod.h.

◆ verify_one

int(* CryptModuleSpecs::verify_one) (struct Body *sigbdy, struct State *s, const char *tempf)

Check a signed MIME part against a signature.

Parameters
sigbdyBody of the signed mail
sState of text being processed
tempfFile containing the key
Return values
0Success
-1Error

Definition at line 118 of file crypt_mod.h.

◆ send_menu

int(* CryptModuleSpecs::send_menu) (struct Email *e)

Ask the user whether to sign and/or encrypt the email.

Parameters
eEmail
Return values
numFlags, e.g. APPLICATION_PGP | SEC_ENCRYPT

Definition at line 124 of file crypt_mod.h.

◆ set_sender

void(* CryptModuleSpecs::set_sender) (const char *sender)

Set the sender of the email.

Parameters
senderEmail address

Definition at line 129 of file crypt_mod.h.

◆ pgp_encrypt_message

struct Body*(* CryptModuleSpecs::pgp_encrypt_message) (struct Body *a, char *keylist, bool sign, const struct AddressList *from)

PGP encrypt an email.

Parameters
aBody of email to encrypt
keylistList of keys, or fingerprints (space separated)
signIf true, sign the message too
fromFrom line, to choose the key to sign
Return values
ptrEncrypted Body
NULLError

Encrypt the mail body to all the given keys.

Definition at line 142 of file crypt_mod.h.

◆ pgp_make_key_attachment

struct Body*(* CryptModuleSpecs::pgp_make_key_attachment) (void)

Generate a public key attachment.

Return values
ptrNew Body containing the attachment
NULLError

Definition at line 149 of file crypt_mod.h.

◆ pgp_check_traditional

int(* CryptModuleSpecs::pgp_check_traditional) (FILE *fp, struct Body *b, bool just_one)

Look for inline (non-MIME) PGP content.

Parameters
fpFile pointer to the current attachment
bBody of email to check
just_oneIf true, just check one email part
Return values
1It's an inline PGP email
0It's not inline, or an error

Definition at line 158 of file crypt_mod.h.

◆ pgp_traditional_encryptsign

struct Body*(* CryptModuleSpecs::pgp_traditional_encryptsign) (struct Body *a, SecurityFlags flags, char *keylist)

Create an inline PGP encrypted, signed email.

Parameters
aBody of the email
flagsFlags, see SecurityFlags
keylistList of keys to encrypt to (space-separated)
Return values
ptrNew encrypted/siged Body
NULLError

Definition at line 167 of file crypt_mod.h.

◆ pgp_invoke_getkeys

void(* CryptModuleSpecs::pgp_invoke_getkeys) (struct Address *addr)

Run a command to download a PGP key.

Parameters
addrAddress to search for

Definition at line 172 of file crypt_mod.h.

◆ pgp_invoke_import

void(* CryptModuleSpecs::pgp_invoke_import) (const char *fname)

Import a key from a message into the user's public key ring.

Parameters
fnameFile containing the message

Definition at line 177 of file crypt_mod.h.

◆ pgp_extract_key_from_attachment

void(* CryptModuleSpecs::pgp_extract_key_from_attachment) (FILE *fp, struct Body *top)

Extract PGP key from an attachment.

Parameters
fpFile containing email
topBody of the email

Definition at line 183 of file crypt_mod.h.

◆ smime_getkeys

void(* CryptModuleSpecs::smime_getkeys) (struct Envelope *env)

Get the S/MIME keys required to encrypt this email.

Parameters
envEnvelope of the email

Definition at line 189 of file crypt_mod.h.

◆ smime_verify_sender

int(* CryptModuleSpecs::smime_verify_sender) (struct Mailbox *m, struct Email *e)

Does the sender match the certificate?

Parameters
mMailbox
eEmail
Return values
0Success
1Failure

Definition at line 197 of file crypt_mod.h.

◆ smime_build_smime_entity

struct Body*(* CryptModuleSpecs::smime_build_smime_entity) (struct Body *a, char *certlist)

Encrypt the email body to all recipients.

Parameters
aBody of email
certlistList of key fingerprints (space separated)
Return values
ptrNew S/MIME encrypted Body
NULLError

Definition at line 205 of file crypt_mod.h.

◆ smime_invoke_import

void(* CryptModuleSpecs::smime_invoke_import) (const char *infile, const char *mailbox)

Add a certificate and update index file (externally)

Parameters
infileFile containing certificate
mailboxMailbox

Definition at line 211 of file crypt_mod.h.


The documentation for this struct was generated from the following file: