NeoMutt  2024-12-12-14-g7b49f7
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
private.h
Go to the documentation of this file.
1
24#ifndef MUTT_AUTOCRYPT_PRIVATE_H
25#define MUTT_AUTOCRYPT_PRIVATE_H
26
27#include <sqlite3.h>
28#include <stdbool.h>
29#include "mutt/lib.h"
30
31struct Address;
32struct AddressList;
33struct AutocryptAccount;
34struct AutocryptAccountArray;
36struct AutocryptPeer;
38struct Menu;
39
40extern sqlite3 *AutocryptDB;
41
46{
47 int num;
49 struct Address *addr;
50};
51ARRAY_HEAD(AccountEntryArray, struct AccountEntry *);
52
59{
65};
66
67int mutt_autocrypt_account_init(bool prompt);
69
72int mutt_autocrypt_db_account_get(struct Address *addr, struct AutocryptAccount **account);
73int mutt_autocrypt_db_account_get_all(struct AutocryptAccountArray *aaa);
74int mutt_autocrypt_db_account_insert(struct Address *addr, const char *keyid, const char *keydata, bool prefer_encrypt);
81int mutt_autocrypt_db_init(bool can_create);
83void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al);
85int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer);
89int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer);
92
95
96int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata);
97int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid);
102
103bool populate_menu(struct Menu *menu);
104
105#endif /* MUTT_AUTOCRYPT_PRIVATE_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
ExpandoDataAutocrypt
Expando UIDs for Autocrypt.
Definition: private.h:59
@ ED_AUT_ADDRESS
AccountEntry.addr.
Definition: private.h:62
@ ED_AUT_KEYID
AutocryptAccount.keyid.
Definition: private.h:61
@ ED_AUT_NUMBER
AccountEntry.num.
Definition: private.h:63
@ ED_AUT_ENABLED
AutocryptAccount.enabled.
Definition: private.h:60
@ ED_AUT_PREFER_ENCRYPT
AutocryptAccount.prefer_encrypt.
Definition: private.h:64
void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al)
Normalise a list of Email Addresses.
Definition: db.c:179
struct AutocryptPeer * mutt_autocrypt_db_peer_new(void)
Create a new AutocryptPeer.
Definition: db.c:522
int mutt_autocrypt_db_account_delete(struct AutocryptAccount *acct)
Delete an Account from the Autocrypt database.
Definition: db.c:427
bool mutt_autocrypt_gpgme_is_valid_key(const char *keyid)
Is a key id valid?
Definition: gpgme.c:361
int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer)
Insert a peer into the Autocrypt database.
Definition: db.c:621
int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata)
Create a GPGME key.
Definition: gpgme.c:158
struct AutocryptGossipHistory * mutt_autocrypt_db_gossip_history_new(void)
Create a new AutocryptGossipHistory.
Definition: db.c:824
void mutt_autocrypt_db_close(void)
Close the Autocrypt SQLite database connection.
Definition: db.c:133
int mutt_autocrypt_gpgme_select_key(struct Buffer *keyid, struct Buffer *keydata)
Select a Autocrypt key.
Definition: gpgme.c:232
sqlite3 * AutocryptDB
Handle to the open Autocrypt database.
Definition: db.c:56
int mutt_autocrypt_db_gossip_history_insert(struct Address *addr, struct AutocryptGossipHistory *gossip_hist)
Insert a gossip history into the Autocrypt database.
Definition: db.c:853
int mutt_autocrypt_db_account_get(struct Address *addr, struct AutocryptAccount **account)
Get Autocrypt Account data from the database.
Definition: db.c:265
int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer)
Get peer info from the Autocrypt database.
Definition: db.c:553
int mutt_autocrypt_db_peer_update(struct AutocryptPeer *peer)
Update the peer info in an Autocrypt database.
Definition: db.c:687
int mutt_autocrypt_db_account_get_all(struct AutocryptAccountArray *aaa)
Get all accounts from an Autocrypt database.
Definition: db.c:461
int mutt_autocrypt_db_account_insert(struct Address *addr, const char *keyid, const char *keydata, bool prefer_encrypt)
Insert an Account into the Autocrypt database.
Definition: db.c:327
void mutt_autocrypt_db_account_free(struct AutocryptAccount **ptr)
Free an AutocryptAccount.
Definition: db.c:246
struct AutocryptAccount * mutt_autocrypt_db_account_new(void)
Create a new AutocryptAccount.
Definition: db.c:237
int mutt_autocrypt_schema_update(void)
Update the version number of the Autocrypt database schema.
Definition: schema.c:107
int mutt_autocrypt_schema_init(void)
Set up an Autocrypt database.
Definition: schema.c:41
void mutt_autocrypt_db_normalize_addr(struct Address *a)
Normalise an Email Address.
Definition: db.c:168
void mutt_autocrypt_db_peer_history_free(struct AutocryptPeerHistory **ptr)
Free an AutocryptPeerHistory.
Definition: db.c:752
int mutt_autocrypt_gpgme_init(void)
Initialise GPGME.
Definition: gpgme.c:70
int mutt_autocrypt_db_account_update(struct AutocryptAccount *acct)
Update Account info in the Autocrypt database.
Definition: db.c:381
int mutt_autocrypt_account_init(bool prompt)
Create a new Autocrypt account.
Definition: autocrypt.c:143
int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid)
Read a key from GPGME.
Definition: gpgme.c:320
void mutt_autocrypt_db_peer_free(struct AutocryptPeer **ptr)
Free an AutocryptPeer.
Definition: db.c:531
void mutt_autocrypt_db_gossip_history_free(struct AutocryptGossipHistory **ptr)
Free an AutocryptGossipHistory.
Definition: db.c:833
struct AutocryptPeerHistory * mutt_autocrypt_db_peer_history_new(void)
Create a new AutocryptPeerHistory.
Definition: db.c:743
bool populate_menu(struct Menu *menu)
Add the Autocrypt data to a Menu.
int mutt_autocrypt_db_init(bool can_create)
Initialise the Autocrypt SQLite database.
Definition: db.c:83
void mutt_autocrypt_scan_mailboxes(void)
Scan mailboxes for Autocrypt headers.
Definition: autocrypt.c:914
int mutt_autocrypt_gpgme_select_or_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata)
Ask the user to select or create an Autocrypt key.
Definition: gpgme.c:279
int mutt_autocrypt_db_peer_history_insert(struct Address *addr, struct AutocryptPeerHistory *peerhist)
Insert peer history into the Autocrypt database.
Definition: db.c:771
Convenience wrapper for the library headers.
An entry in the Autocrypt account Menu.
Definition: private.h:46
struct Address * addr
Email address associated with the account.
Definition: private.h:49
struct AutocryptAccount * account
Account details.
Definition: private.h:48
int num
Number in the index.
Definition: private.h:47
An email address.
Definition: address.h:36
Autocrypt account.
Definition: lib.h:110
Autocrypt gossip history.
Definition: lib.h:150
Autocrypt peer history.
Definition: lib.h:139
Autocrypt peer.
Definition: lib.h:123
char * keyid
PGP Key id.
Definition: lib.h:127
char * keydata
PGP Key data.
Definition: lib.h:128
String manipulation buffer.
Definition: buffer.h:36
Definition: lib.h:79