Top |
Functions
Types and Values
enum | GMimeAutocryptPreferEncrypt |
struct | GMimeAutocryptHeader |
struct | GMimeAutocryptHeaderList |
Functions
g_mime_autocrypt_header_new ()
GMimeAutocryptHeader *
g_mime_autocrypt_header_new (void
);
Creates a new GMimeAutocryptHeader object.
g_mime_autocrypt_header_new_from_string ()
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.
g_mime_autocrypt_header_get_address ()
InternetAddressMailbox *
g_mime_autocrypt_header_get_address (GMimeAutocryptHeader *ah
);
Gets the internal address of the Autocrypt header, or NULL
if not set.
g_mime_autocrypt_header_set_address ()
void g_mime_autocrypt_header_set_address (GMimeAutocryptHeader *ah
,InternetAddressMailbox *address
);
Set the address associated with the autocrypt_header.
g_mime_autocrypt_header_set_address_from_string ()
void g_mime_autocrypt_header_set_address_from_string (GMimeAutocryptHeader *ah
,const char *address
);
Set the address associated with the autocrypt_header.
Parameters
ah |
a GMimeAutocryptHeader object |
|
address |
a |
g_mime_autocrypt_header_get_address_as_string ()
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.
g_mime_autocrypt_header_get_prefer_encrypt ()
GMimeAutocryptPreferEncrypt
g_mime_autocrypt_header_get_prefer_encrypt
(GMimeAutocryptHeader *ah
);
Gets the encryption preference stated by the Autocrypt header.
g_mime_autocrypt_header_set_prefer_encrypt ()
void g_mime_autocrypt_header_set_prefer_encrypt (GMimeAutocryptHeader *ah
,GMimeAutocryptPreferEncrypt pref
);
Set the encryption preference associated with the Autocrypt header.
g_mime_autocrypt_header_get_keydata ()
GBytes *
g_mime_autocrypt_header_get_keydata (GMimeAutocryptHeader *ah
);
Gets the raw keydata of the Autocrypt header, or NULL
if not set.
g_mime_autocrypt_header_set_keydata ()
void g_mime_autocrypt_header_set_keydata (GMimeAutocryptHeader *ah
,GBytes *data
);
Set the raw key data associated with the Autocrypt header.
g_mime_autocrypt_header_get_effective_date ()
GDateTime *
g_mime_autocrypt_header_get_effective_date
(GMimeAutocryptHeader *ah
);
Gets the effective date of the Autocrypt header, or NULL
if not set.
g_mime_autocrypt_header_set_effective_date ()
void g_mime_autocrypt_header_set_effective_date (GMimeAutocryptHeader *ah
,GDateTime *effective_date
);
Set the effective date associated with the Autocrypt header.
g_mime_autocrypt_header_is_complete ()
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.
g_mime_autocrypt_header_to_string ()
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).
Parameters
ah |
a GMimeAutocryptHeader object |
|
gossip |
a gboolean, indicating whether this header is for use with gossip |
g_mime_autocrypt_header_compare ()
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
g_mime_autocrypt_header_clone ()
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
.
g_mime_autocrypt_header_list_new ()
GMimeAutocryptHeaderList *
g_mime_autocrypt_header_list_new (void
);
Creates a new GMimeAutocryptHeaderList object.
g_mime_autocrypt_header_list_add_missing_addresses ()
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.
g_mime_autocrypt_header_list_add ()
void g_mime_autocrypt_header_list_add (GMimeAutocryptHeaderList *list
,GMimeAutocryptHeader *header
);
Adds a the passed GMimeAutocryptHeader to the list.
g_mime_autocrypt_header_list_get_count ()
guint
g_mime_autocrypt_header_list_get_count
(GMimeAutocryptHeaderList *list
);
See how many Autocrypt headers are in the list.
g_mime_autocrypt_header_list_get_header_at ()
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)
g_mime_autocrypt_header_list_get_header_for_address ()
GMimeAutocryptHeader * g_mime_autocrypt_header_list_get_header_for_address (GMimeAutocryptHeaderList *list
,InternetAddressMailbox *mailbox
);
Gets the Autocrypt header corresponding to the given mailbox
.
g_mime_autocrypt_header_list_remove_incomplete ()
void
g_mime_autocrypt_header_list_remove_incomplete
(GMimeAutocryptHeaderList *list
);
Remove all incomplete Autocrypt headers from the list.
Types and Values
struct GMimeAutocryptHeader
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.
Members
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. |