Package dkim :: Class DomainSigner
[hide private]
[frames] | no frames]

Class DomainSigner

source code

object --+
         |
        DomainSigner
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, message=None, logger=None, signature_algorithm='rsa-sha256', minkey=1024)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add_frozen(self, s)
Add headers not in should_not_sign to frozen_sign.
source code
 
set_message(self, message) source code
 
default_sign_headers(self)
Return the default list of headers to sign: those in should_sign or frozen_sign, with those in frozen_sign signed an extra time to prevent additions.
source code
 
all_sign_headers(self)
Return header list of all existing headers not in should_not_sign.
source code
 
gen_header(self, fields, include_headers, canon_policy, header_name, pk, standardize=False) source code
 
verify_sig(self, sig, include_headers, sig_header, dnsfunc) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  FROZEN = ('from', 'date', 'subject')
  SHOULD = ('sender', 'reply-to', 'subject', 'date', 'message-id...
  SHOULD_NOT = ('return-path', 'received', 'comments', 'keywords...
  RFC5322_SINGLETON = ('date', 'from', 'sender', 'reply-to', 'to...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, message=None, logger=None, signature_algorithm='rsa-sha256', minkey=1024)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

add_frozen(self, s)

source code 

Add headers not in should_not_sign to frozen_sign.

Parameters:
  • s - list of headers to add to frozen_sign

Since: 0.5

>>> dkim = DKIM()
>>> dkim.add_frozen(DKIM.RFC5322_SINGLETON)
>>> [text(x) for x in sorted(dkim.frozen_sign)]
['cc', 'date', 'from', 'in-reply-to', 'message-id', 'references', 'reply-to', 'sender', 'subject', 'to']

default_sign_headers(self)

source code 

Return the default list of headers to sign: those in should_sign or frozen_sign, with those in frozen_sign signed an extra time to prevent additions.

Since: 0.5

all_sign_headers(self)

source code 

Return header list of all existing headers not in should_not_sign.

Since: 0.5


Class Variable Details [hide private]

SHOULD

Value:
('sender',
 'reply-to',
 'subject',
 'date',
 'message-id',
 'to',
 'cc',
 'mime-version',
...

SHOULD_NOT

Value:
('return-path',
 'received',
 'comments',
 'keywords',
 'bcc',
 'resent-bcc',
 'dkim-signature')

RFC5322_SINGLETON

Value:
('date',
 'from',
 'sender',
 'reply-to',
 'to',
 'cc',
 'bcc',
 'message-id',
...