TrustedPickle - Python module

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
  | ## `TrustedPickle` -- Signed pickle files TrustedPickle exports the following constants: `TRUSTED` Signer class code indicating that the signers returned were listed as trusted programmers. The document should be used without sending any alerts to the user. `TRANSFERRED` Signer class code indicating that no trusted programmers have signed the document, but the signers listed have trust relationships with other programmers who did sign the document. The document should be used without sending any alerts to the user. `UNKNOWN` Signer class code indicating that no trusted programmers have signed the document. Additionally, the document did not contain any trust relationships with anyone on the trusted programmers list. If no `PublicKey`s are returned, that indicates that the document is unsigned. The document should either be rejected or the user should be alerted and given a chance to decide whether the document is used or not. `REVOKED` Signer class code indicating that the signers returned are no longer trusted. The document should not be used. TrustedPickle exports the following exceptions: exception `FileFormatError` Thrown when a key or pickle file cannot be read because the data has been written in an unexpected format. This will happen, for instance, if you try to read a standard pickle file as a TrustedPickle file. exception `MismatchedKeys` Thrown when a mismatched key pair (a private key from one user and a public key from another) is used to try and sign a document or trust relationship. This exception is never thrown by any `Test()` function. TrustedPickle exports the following functions: `Hash`(String) Calculates a numeric hash of `String`. In general, you should not need to call this function unless you want to give your users an option of ignoring future warnings on a given document as opposed to future warnings from a given set of signers.
  |  | `>>> hex(TrustedPickle.Hash(Doc2.Data)) '0xFCE9E27B0E883459A0551BF5F9CBE582L'`
`NewKeys`() Interactively creates a new public and private key pair. Call from Python's command line interface. TrustedPickle exports the following classes: class `ModuleObject`(Module) Used internally to wrap and unwrap a module. I recommend against using this class directly to try and pickle multiple modules in a single file. Although it is possible, there are many subtle caveats that I do not plan to detail in this documentation. class `PrivateKey`(Filename[, Password[, Key]]) This class lets you read in a private key file from disk. The `Password` parameter defaults to `""` if not present. The `Key` parameter is for internal use only. class `PublicKey`(n, Key, Name, Address, PrivVal) You should never need to directly instantiate a `PublicKey` object. Instantiate a `PublicKeyFile` object instead. class `PublicKeyFile`(Filename[, Public]) This class lets you read in a public key file from disk. The `Public` parameter is for internal use only. class `Signature`(Signer, Validator) class `Signature`(Data, PublicFile, Private) You should never need to directly instantiate a `Signature` object. Instead, call the `Sign` member of a `TPickle` object. class `TPickle`(Filename) This class lets you create and manipulate signed pickle documents. class `TrustRelationship`(Truster, Trustee, n, Transferrable, Validator) class `TrustRelationship`(Truster, Trustee, PrivVal[, Transferrable]) You should never need to directly instantiate a `TrustRelationship` object. Instead, call the `AddTrust` member of a `TPickle` object.