NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
private.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_AUTOCRYPT_PRIVATE_H
24 #define MUTT_AUTOCRYPT_PRIVATE_H
25 
26 #include <sqlite3.h>
27 #include <stdbool.h>
28 
29 struct Address;
30 struct AddressList;
31 struct AutocryptAccount;
33 struct AutocryptPeer;
35 struct Buffer;
36 struct Mailbox;
37 
38 extern sqlite3 *AutocryptDB;
39 
40 int mutt_autocrypt_account_init(bool prompt);
42 
46 int mutt_autocrypt_db_account_get_all(struct AutocryptAccount ***accounts, int *num_accounts);
47 int mutt_autocrypt_db_account_insert(struct Address *addr, const char *keyid, const char *keydata, bool prefer_encrypt);
50 void mutt_autocrypt_db_close(void);
52 int mutt_autocrypt_db_gossip_history_insert(struct Address *addr, struct AutocryptGossipHistory *gossip_hist);
54 int mutt_autocrypt_db_init(struct Mailbox *m, bool can_create);
56 void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al);
58 int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer);
60 int mutt_autocrypt_db_peer_history_insert(struct Address *addr, struct AutocryptPeerHistory *peerhist);
62 int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer);
65 
68 
69 int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata);
70 int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid);
75 
76 #endif /* MUTT_AUTOCRYPT_PRIVATE_H */
void mutt_autocrypt_db_close(void)
Close the Autocrypt SQLite database connection.
Definition: db.c:132
void mutt_autocrypt_db_peer_free(struct AutocryptPeer **ptr)
Free an AutocryptPeer.
Definition: db.c:530
int mutt_autocrypt_db_account_update(struct AutocryptAccount *acct)
Update Account info in the Autocrypt database.
Definition: db.c:375
char * keydata
Definition: lib.h:121
int mutt_autocrypt_db_peer_update(struct AutocryptPeer *peer)
Update the peer info in an Autocrypt database.
Definition: db.c:680
void mutt_autocrypt_db_account_free(struct AutocryptAccount **ptr)
Free an AutocryptAccount.
Definition: db.c:246
int mutt_autocrypt_gpgme_init(void)
Initialise GPGME.
Definition: gpgme.c:67
String manipulation buffer.
Definition: buffer.h:33
struct AutocryptPeerHistory * mutt_autocrypt_db_peer_history_new(void)
Create a new AutocryptPeerHistory.
Definition: db.c:736
An email address.
Definition: address.h:35
struct AutocryptPeer * mutt_autocrypt_db_peer_new(void)
Create a new AutocryptPeer.
Definition: db.c:521
int mutt_autocrypt_gpgme_select_key(struct Buffer *keyid, struct Buffer *keydata)
Select a Autocrypt key.
Definition: gpgme.c:228
struct AutocryptAccount * mutt_autocrypt_db_account_new(void)
Create a new AutocryptAccount.
Definition: db.c:237
int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer)
Get peer info from the Autocrypt database.
Definition: db.c:552
int mutt_autocrypt_db_peer_history_insert(struct Address *addr, struct AutocryptPeerHistory *peerhist)
Insert peer history into the Autocrypt database.
Definition: db.c:764
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:324
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:843
int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer)
Insert a peer into the Autocrypt database.
Definition: db.c:617
Autocrypt peer.
Definition: lib.h:115
int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata)
Create a GPGME key.
Definition: gpgme.c:155
bool mutt_autocrypt_gpgme_is_valid_key(const char *keyid)
Is a key id valid?
Definition: gpgme.c:357
A mailbox.
Definition: mailbox.h:81
Autocrypt gossip history.
Definition: lib.h:142
int mutt_autocrypt_db_account_get_all(struct AutocryptAccount ***accounts, int *num_accounts)
Get all accounts from an Autocrypt database.
Definition: db.c:456
void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al)
Normalise a list of Email Addresses.
Definition: db.c:178
int mutt_autocrypt_schema_init(void)
Set up an Autocrypt database.
Definition: schema.c:38
Autocrypt peer history.
Definition: lib.h:131
void mutt_autocrypt_scan_mailboxes(struct Mailbox *m)
Scan mailboxes for Autocrypt headers.
Definition: autocrypt.c:933
int mutt_autocrypt_account_init(bool prompt)
Create a new Autocrypt account.
Definition: autocrypt.c:155
Autocrypt account.
Definition: lib.h:103
sqlite3 * AutocryptDB
Definition: db.c:52
int mutt_autocrypt_db_account_get(struct Address *addr, struct AutocryptAccount **account)
Get Autocrypt Account data from the database.
Definition: db.c:265
struct Account * account
Account that owns this Mailbox.
Definition: mailbox.h:131
struct AutocryptGossipHistory * mutt_autocrypt_db_gossip_history_new(void)
Create a new AutocryptGossipHistory.
Definition: db.c:814
int mutt_autocrypt_db_account_delete(struct AutocryptAccount *acct)
Delete an Account from the Autocrypt database.
Definition: db.c:421
int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid)
Read a key from GPGME.
Definition: gpgme.c:316
void mutt_autocrypt_db_gossip_history_free(struct AutocryptGossipHistory **ptr)
Free an AutocryptGossipHistory.
Definition: db.c:823
void mutt_autocrypt_db_normalize_addr(struct Address *a)
Normalise an Email Address.
Definition: db.c:167
char * keyid
Definition: lib.h:120
int mutt_autocrypt_db_init(struct Mailbox *m, bool can_create)
Initialise the Autocrypt SQLite database.
Definition: db.c:80
void mutt_autocrypt_db_peer_history_free(struct AutocryptPeerHistory **ptr)
Free an AutocryptPeerHistory.
Definition: db.c:745
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:275
int mutt_autocrypt_schema_update(void)
Update the version number of the Autocrypt database schema.
Definition: schema.c:104