Package openid :: Package server :: Module server :: Class Signatory
[frames] | no frames]

Class Signatory

source code

object --+
         |
        Signatory

I sign things.

I also check signatures.

All my state is encapsulated in an OpenIDStore, which means I'm not generally pickleable but I am easy to reconstruct.

Instance Methods [hide private]
  __init__(self, store)
Create a new Signatory.
bool verify(self, assoc_handle, sig, signed_pairs)
Verify that the signature for some data is valid.
OpenIDResponse sign(self, response)
Sign a response.
openid.association.Association createAssociation(self, dumb=True, assoc_type='HMAC-SHA1')
Make a new association.
openid.association.Association getAssociation(self, assoc_handle, dumb)
Get the association with the specified handle.
  invalidate(self, assoc_handle, dumb)
Invalidates the association with the given handle.

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


Class Variables [hide private]
int SECRET_LIFETIME = 1209600
The number of seconds a secret remains valid.

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, store)
(Constructor)

source code 

Create a new Signatory.
Parameters:
Overrides: object.__init__

verify(self, assoc_handle, sig, signed_pairs)

source code 

Verify that the signature for some data is valid.
Parameters:
  • assoc_handle (str) - The handle of the association used to sign the data.
  • sig (str) - The base-64 encoded signature to check.
  • signed_pairs (list of pairs) - The data to check, an ordered list of key-value pairs. The keys should be as they are in the request's signed list, without any "openid." prefix.
Returns: bool
True if the signature is valid, False if not.

sign(self, response)

source code 

Sign a response.

I take a OpenIDResponse, create a signature for everything in its signed list, and return a new copy of the response object with that signature included.
Parameters:
Returns: OpenIDResponse
A signed copy of the response.

createAssociation(self, dumb=True, assoc_type='HMAC-SHA1')

source code 

Make a new association.
Parameters:
  • dumb (bool) - Is this association for a dumb-mode transaction?
  • assoc_type (str) - The type of association to create. Currently there is only one type defined, HMAC-SHA1.
Returns: openid.association.Association
the new association.

getAssociation(self, assoc_handle, dumb)

source code 

Get the association with the specified handle.
Parameters:
  • dumb (bool) - Is this association used with dumb mode?
Returns: openid.association.Association
the association, or None if no valid association with that handle was found.

invalidate(self, assoc_handle, dumb)

source code 

Invalidates the association with the given handle.
Parameters:
  • dumb (bool) - Is this association used with dumb mode?

Class Variable Details [hide private]

SECRET_LIFETIME


The number of seconds a secret remains valid.
Type:
int
Value:
1209600