Package zeroinstall :: Package injector :: Module trust :: Class TrustDB
[frames] | no frames]

Class TrustDB

source code

object --+
         |
        TrustDB

A database of trusted keys.


See Also: trust_db - the singleton instance of this class

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
bool
is_trusted(self, fingerprint, domain=None) source code
{str}
get_trust_domains(self, fingerprint)
Return the set of domains in which this key is trusted.
source code
{str}
get_keys_for_domain(self, domain)
Return the set of keys trusted for this domain.
source code
 
trust_key(self, fingerprint, domain='*')
Add key to the list of trusted fingerprints.
source code
 
untrust_key(self, key, domain='*') source code
 
save(self) source code
 
notify(self)
Call all watcher callbacks.
source code
 
ensure_uptodate(self) source code

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

Instance Variables
{str: set(str)} keys
maps trusted key fingerprints to a set of domains for which where it is trusted
  watchers
callbacks invoked by notify
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

is_trusted(self, fingerprint, domain=None)

source code 
Parameters:
  • domain (str | None)
  • fingerprint (str)
Returns: bool

get_trust_domains(self, fingerprint)

source code 

Return the set of domains in which this key is trusted. If the list includes '*' then the key is trusted everywhere.

Parameters:
  • fingerprint (str)
Returns: {str}

Since: 0.27

get_keys_for_domain(self, domain)

source code 

Return the set of keys trusted for this domain.

Parameters:
  • domain (str)
Returns: {str}

Since: 0.27

trust_key(self, fingerprint, domain='*')

source code 

Add key to the list of trusted fingerprints.

Parameters:
  • fingerprint (str) - base 16 fingerprint without any spaces
  • domain (str) - domain in which key is to be trusted

Note: call notify after trusting one or more new keys

untrust_key(self, key, domain='*')

source code 
Parameters:
  • domain (str)
  • key (str)

notify(self)

source code 

Call all watcher callbacks. This should be called after trusting or untrusting one or more new keys.

Since: 0.25