GMime.AutocryptHeader¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
address |
r |
the |
|
effective_date |
r |
the date associated with the Autocrypt header in this message. |
|
keydata |
r |
the raw binary form of the encoded key. |
|
parent_object |
r |
parent |
|
prefer_encrypt |
r |
a |
Class Details¶
- class GMime.AutocryptHeader(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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.
- classmethod new()¶
- Returns:
a new
GMime.AutocryptHeader
object.- Return type:
Creates a new
GMime.AutocryptHeader
object.
- classmethod new_from_string(string)¶
- Parameters:
string (
str
) – The raw string value of an Autocrypt header- Returns:
a new
GMime.AutocryptHeader
object, orNone
on error.- Return type:
Creates a new
GMime.AutocryptHeader
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.
- clone(src)¶
- Parameters:
src (
GMime.AutocryptHeader
) – aGMime.AutocryptHeader
object
If address and type already match between src and self, copy keydata, prefer_encrypt, effective_date from src to self.
- compare(ah2)¶
- Parameters:
ah2 (
GMime.AutocryptHeader
) – aGMime.AutocryptHeader
object- Returns:
-1, 0, or 1 when self is less than, equal to, or greater than ah2.
- Return type:
Compare two Autocrypt Headers. This is useful for comparison, as well as for sorting headers by:
address
effective_date
keydata
prefer_encrypt
- get_address()¶
- Returns:
the address associated with the Autocrypt header
- Return type:
Gets the internal address of the Autocrypt header, or
None
if not set.
- get_address_as_string()¶
- Returns:
the address associated with the Autocrypt header
- Return type:
Gets the internal address of the Autocrypt header as a C string, or
None
if not set.
- get_effective_date()¶
- Returns:
the effective date associated with the Autocrypt header
- Return type:
Gets the effective date of the Autocrypt header, or
None
if not set.
- get_keydata()¶
- Returns:
the raw key data associated with the Autocrypt header
- Return type:
Gets the raw keydata of the Autocrypt header, or
None
if not set.
- get_prefer_encrypt()¶
- Returns:
the encryption preference associated with the Autocrypt header
- Return type:
Gets the encryption preference stated by the Autocrypt header.
- is_complete()¶
-
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.
- set_address(address)¶
- Parameters:
address (
GMime.InternetAddressMailbox
) – aGMime.InternetAddressMailbox
value
Set the address associated with the autocrypt_header.
- set_address_from_string(address)¶
-
Set the address associated with the autocrypt_header.
- set_effective_date(effective_date)¶
- Parameters:
effective_date (
GLib.DateTime
) – aGLib.DateTime
object
Set the effective date associated with the Autocrypt header.
- set_keydata(keydata)¶
- Parameters:
keydata (
GLib.Bytes
) – aGLib.Bytes
object
Set the raw key data associated with the Autocrypt header.
- set_prefer_encrypt(pref)¶
- Parameters:
pref (
GMime.AutocryptPreferEncrypt
) – aGMime.AutocryptPreferEncrypt
value
Set the encryption preference associated with the Autocrypt header.
- to_string(gossip)¶
- Parameters:
gossip (
bool
) – abool
, indicating whether this header is for use with gossip- Returns:
the string representation of the Autocrypt header.
- Return type:
Gets the string representation of the Autocrypt header, or
None
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).