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
 
__init__(self, store)
Create a new Signatory.
source code
bool
verify(self, assoc_handle, message)
Verify that the signature for some data is valid.
source code
OpenIDResponse
sign(self, response)
Sign a response.
source code
openid.association.Association
createAssociation(self, dumb=True, assoc_type='HMAC-SHA1')
Make a new association.
source code
openid.association.Association
getAssociation(self, assoc_handle, dumb, checkExpiration=True)
Get the association with the specified handle.
source code
 
invalidate(self, assoc_handle, dumb)
Invalidates the association with the given handle.
source code

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

Class Variables
int SECRET_LIFETIME = 1209600
The number of seconds a secret remains valid.
Properties

Inherited from object: __class__

Method Details

__init__(self, store)
(Constructor)

source code 

Create a new Signatory.

Parameters:
Overrides: object.__init__

verify(self, assoc_handle, message)

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.
  • message (openid.message.Message) - The signed message to verify
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, checkExpiration=True)

source code 

Get the association with the specified handle.

Parameters:
  • dumb (bool) - Is this association used with dumb mode?
  • assoc_handle (str)
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?
  • assoc_handle (str)