Project Python SourceForge
Introduction
Legal Notes
Suitability
 
Setup
Download
Installation
 
How to
Key Generation
Signing a Document
Testing a Document
Trust Relationships
 
Documentation
TrustedPickle
ModuleObject
PrivateKey
PublicKey
PublicKeyFile
Signature
TPickle
TrustRelationship

PublicKeyFile -- File which contains public keys and trusts

PublicKeyFile instances export the following attributes:

Keys
Dictionary of PublicKey objects in this file. Each key object is indexed by its 128-bit public key value.
Owner
128-bit public key value of the user who created this file.
Revoked
Dictionary of dictionaries, just like Trusted, below. Each PublicKey in this attribute is a trust relationship we no longer honor.
Trusted
Dictionary of dictionaries. Both the inner and outer dictionaries are indexed with 128-bit public key values. Each Trusted[Trustee][Truster] node contains a TrustRelationship instance where Trustee is trusting Truster. Each TrustRelationship instance is signed with the Truster's private key.

PublicKeyFile instances export the following functions:

AddTrust(PubFilename, Private[, Transferrable])

Creates a valid TrustRelationship object where the PublicKeyFile's Owner is the truster and the trustee is taken from the PublicKeyFile named by PubFilename. Call Write() after calling AddTrust(). If the PrivateKey in Private does not match the Owner's public key, then AddTrust() will throw a MismatchedKeys exception.

If Transferrable is set to "Y" (default is "N") then the truster is not only vouching for any files created by the trustee, but also allowing the trustee to create further trust relationships. Use great caution before setting Transferrable to "Y".

Merge(PubFile[, Overwrite])
Merges all public keys and trust relationships in the PublicKeyFile named by PubFile into the PublicKeyFile object. Call Write() after calling Merge(). If Overwrite is set to True (it defaults to False) then any duplicate entries in PubFile will overwrite those in the PublicKeyFile.
MyPublicKey()
Returns the owner's PublicKey instance. Shortcut for Keys[Owner].
Read()
Reads instance from disk.
RevokeTrust(Relationship)
Removes the given TrustRelationship object (if present) from Trusted and adds it to Revoked.
Write()
Writes instance back out to disk.