24#ifndef MUTT_AUTOCRYPT_PRIVATE_H
25#define MUTT_AUTOCRYPT_PRIVATE_H
34struct AutocryptAccountArray;
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
ExpandoDataAutocrypt
Expando UIDs for Autocrypt.
@ ED_AUT_ADDRESS
AccountEntry.addr.
@ ED_AUT_KEYID
AutocryptAccount.keyid.
@ ED_AUT_NUMBER
AccountEntry.num.
@ ED_AUT_ENABLED
AutocryptAccount.enabled.
@ ED_AUT_PREFER_ENCRYPT
AutocryptAccount.prefer_encrypt.
void mutt_autocrypt_db_normalize_addrlist(struct AddressList *al)
Normalise a list of Email Addresses.
struct AutocryptPeer * mutt_autocrypt_db_peer_new(void)
Create a new AutocryptPeer.
int mutt_autocrypt_db_account_delete(struct AutocryptAccount *acct)
Delete an Account from the Autocrypt database.
bool mutt_autocrypt_gpgme_is_valid_key(const char *keyid)
Is a key id valid?
int mutt_autocrypt_db_peer_insert(struct Address *addr, struct AutocryptPeer *peer)
Insert a peer into the Autocrypt database.
int mutt_autocrypt_gpgme_create_key(struct Address *addr, struct Buffer *keyid, struct Buffer *keydata)
Create a GPGME key.
struct AutocryptGossipHistory * mutt_autocrypt_db_gossip_history_new(void)
Create a new AutocryptGossipHistory.
void mutt_autocrypt_db_close(void)
Close the Autocrypt SQLite database connection.
int mutt_autocrypt_gpgme_select_key(struct Buffer *keyid, struct Buffer *keydata)
Select a Autocrypt key.
sqlite3 * AutocryptDB
Handle to the open Autocrypt database.
int mutt_autocrypt_db_gossip_history_insert(struct Address *addr, struct AutocryptGossipHistory *gossip_hist)
Insert a gossip history into the Autocrypt database.
int mutt_autocrypt_db_account_get(struct Address *addr, struct AutocryptAccount **account)
Get Autocrypt Account data from the database.
int mutt_autocrypt_db_peer_get(struct Address *addr, struct AutocryptPeer **peer)
Get peer info from the Autocrypt database.
int mutt_autocrypt_db_peer_update(struct AutocryptPeer *peer)
Update the peer info in an Autocrypt database.
int mutt_autocrypt_db_account_get_all(struct AutocryptAccountArray *aaa)
Get all accounts from an Autocrypt database.
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.
void mutt_autocrypt_db_account_free(struct AutocryptAccount **ptr)
Free an AutocryptAccount.
struct AutocryptAccount * mutt_autocrypt_db_account_new(void)
Create a new AutocryptAccount.
int mutt_autocrypt_schema_update(void)
Update the version number of the Autocrypt database schema.
int mutt_autocrypt_schema_init(void)
Set up an Autocrypt database.
void mutt_autocrypt_db_normalize_addr(struct Address *a)
Normalise an Email Address.
void mutt_autocrypt_db_peer_history_free(struct AutocryptPeerHistory **ptr)
Free an AutocryptPeerHistory.
int mutt_autocrypt_gpgme_init(void)
Initialise GPGME.
int mutt_autocrypt_db_account_update(struct AutocryptAccount *acct)
Update Account info in the Autocrypt database.
int mutt_autocrypt_account_init(bool prompt)
Create a new Autocrypt account.
int mutt_autocrypt_gpgme_import_key(const char *keydata, struct Buffer *keyid)
Read a key from GPGME.
void mutt_autocrypt_db_peer_free(struct AutocryptPeer **ptr)
Free an AutocryptPeer.
void mutt_autocrypt_db_gossip_history_free(struct AutocryptGossipHistory **ptr)
Free an AutocryptGossipHistory.
struct AutocryptPeerHistory * mutt_autocrypt_db_peer_history_new(void)
Create a new AutocryptPeerHistory.
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.
void mutt_autocrypt_scan_mailboxes(void)
Scan mailboxes for Autocrypt headers.
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.
int mutt_autocrypt_db_peer_history_insert(struct Address *addr, struct AutocryptPeerHistory *peerhist)
Insert peer history into the Autocrypt database.
Convenience wrapper for the library headers.
An entry in the Autocrypt account Menu.
struct Address * addr
Email address associated with the account.
struct AutocryptAccount * account
Account details.
int num
Number in the index.
Autocrypt gossip history.
char * keydata
PGP Key data.
String manipulation buffer.