| Top |
| enum | GMimeAutocryptPreferEncrypt |
| struct | GMimeAutocryptHeader |
| struct | GMimeAutocryptHeaderList |
GMimeAutocryptHeader *
g_mime_autocrypt_header_new (void);
Creates a new GMimeAutocryptHeader object.
GMimeAutocryptHeader *
g_mime_autocrypt_header_new_from_string
(const char *string);
Creates a new GMimeAutocryptHeader object based on the value of an Autocrypt: header.
Note that this will not have an effective_date
set, since the
effective_date
is derived from the Date: line in the same block of
e-mail headers, but cannot be extracted from the raw Autocrypt:
header itself.
InternetAddressMailbox *
g_mime_autocrypt_header_get_address (GMimeAutocryptHeader *ah);
Gets the internal address of the Autocrypt header, or NULL if not set.
void g_mime_autocrypt_header_set_address (GMimeAutocryptHeader *ah,InternetAddressMailbox *address);
Set the address associated with the autocrypt_header.
void g_mime_autocrypt_header_set_address_from_string (GMimeAutocryptHeader *ah,const char *address);
Set the address associated with the autocrypt_header.
ah |
a GMimeAutocryptHeader object |
|
address |
a |
const char *
g_mime_autocrypt_header_get_address_as_string
(GMimeAutocryptHeader *ah);
Gets the internal address of the Autocrypt header as a C string, or NULL if not set.
GMimeAutocryptPreferEncrypt
g_mime_autocrypt_header_get_prefer_encrypt
(GMimeAutocryptHeader *ah);
Gets the encryption preference stated by the Autocrypt header.
void g_mime_autocrypt_header_set_prefer_encrypt (GMimeAutocryptHeader *ah,GMimeAutocryptPreferEncrypt pref);
Set the encryption preference associated with the Autocrypt header.
GBytes *
g_mime_autocrypt_header_get_keydata (GMimeAutocryptHeader *ah);
Gets the raw keydata of the Autocrypt header, or NULL if not set.
void g_mime_autocrypt_header_set_keydata (GMimeAutocryptHeader *ah,GBytes *data);
Set the raw key data associated with the Autocrypt header.
GDateTime *
g_mime_autocrypt_header_get_effective_date
(GMimeAutocryptHeader *ah);
Gets the effective date of the Autocrypt header, or NULL if not set.
void g_mime_autocrypt_header_set_effective_date (GMimeAutocryptHeader *ah,GDateTime *effective_date);
Set the effective date associated with the Autocrypt header.
gboolean
g_mime_autocrypt_header_is_complete (GMimeAutocryptHeader *ah);
When dealing with Autocrypt headers derived from a message, some sender addresses will not have a legitimate/complete header associated with them. When a given sender address has no complete header of a specific type, it should "reset" the state of the associated address.
char * g_mime_autocrypt_header_to_string (GMimeAutocryptHeader *ah,gboolean gossip);
Gets the string representation of the Autocrypt header, or NULL on
error. For example, it might return:
prefer-encrypt=mutual; addr=bob@example.com; keydata=AAAB15BE...
If you are using this object to populate an Autocrypt-Gossip
header, you should set gossip
to TRUE (this will suppress
inclusion of prefer-encrypt).
ah |
a GMimeAutocryptHeader object |
|
gossip |
a gboolean, indicating whether this header is for use with gossip |
int g_mime_autocrypt_header_compare (GMimeAutocryptHeader *ah1,GMimeAutocryptHeader *ah2);
Compare two Autocrypt Headers. This is useful for comparison, as well as for sorting headers by:
address
effective_date
keydata
prefer_encrypt
void g_mime_autocrypt_header_clone (GMimeAutocryptHeader *dst,GMimeAutocryptHeader *src);
If address and type already match between src
and dst
, copy
keydata, prefer_encrypt, effective_date from src
to dst
.
GMimeAutocryptHeaderList *
g_mime_autocrypt_header_list_new (void);
Creates a new GMimeAutocryptHeaderList object.
guint g_mime_autocrypt_header_list_add_missing_addresses (GMimeAutocryptHeaderList *list,InternetAddressList *addresses);
Adds a new incomplete GMimeAutocryptHeader object for each InternetAddressMailbox found in addresses.
void g_mime_autocrypt_header_list_add (GMimeAutocryptHeaderList *list,GMimeAutocryptHeader *header);
Adds a the passed GMimeAutocryptHeader to the list.
guint
g_mime_autocrypt_header_list_get_count
(GMimeAutocryptHeaderList *list);
See how many Autocrypt headers are in the list.
GMimeAutocryptHeader * g_mime_autocrypt_header_list_get_header_at (GMimeAutocryptHeaderList *list,guint index);
Get the Nth header in the list (returns NULL on error, or if index
is out of bounds)
GMimeAutocryptHeader * g_mime_autocrypt_header_list_get_header_for_address (GMimeAutocryptHeaderList *list,InternetAddressMailbox *mailbox);
Gets the Autocrypt header corresponding to the given mailbox
.
void
g_mime_autocrypt_header_list_remove_incomplete
(GMimeAutocryptHeaderList *list);
Remove all incomplete Autocrypt headers from the list.
struct GMimeAutocryptHeader {
GObject parent_object;
InternetAddressMailbox *address;
GMimeAutocryptPreferEncrypt prefer_encrypt;
GBytes *keydata;
GDateTime *effective_date;
};
An object containing Autocrypt information about a given e-mail address, as derived from a message header.
See https://autocrypt.org/ for details and motivation.
parent GObject |
||
InternetAddressMailbox * |
the InternetAddressMailbox associated with this Autocrypt header. |
|
GMimeAutocryptPreferEncrypt |
a GMimeAutocryptPreferEncrypt value (defaults to |
|
the raw binary form of the encoded key. |
||
the date associated with the Autocrypt header in this message. |