Package openid :: Package store :: Module nonce
[frames | no frames]

Module openid.store.nonce

Function Summary
bool checkTimestamp(nonce_string, allowed_skew, now)
Is the timestamp that is part of the specified nonce string within the allowed clock-skew of the current time?
str mkNonce(when)
Generate a nonce with the current timestamp
(int, str) split(nonce_string)
Extract a timestamp from the given nonce string

Function Details

checkTimestamp(nonce_string, allowed_skew=18000, now=None)

Is the timestamp that is part of the specified nonce string within the allowed clock-skew of the current time?
Parameters:
nonce_string - The nonce that is being checked
           (type=str)
allowed_skew - How many seconds should be allowed for completing the request, allowing for clock skew.
           (type=int)
now - The current time, as a Unix timestamp
           (type=int)
Returns:
Whether the timestamp is correctly formatted and within the allowed skew of the current time.
           (type=bool)

mkNonce(when=None)

Generate a nonce with the current timestamp
Parameters:
when - Unix timestamp representing the issue time of the nonce. Defaults to the current time.
           (type=int)
Returns:
A string that should be usable as a one-way nonce
           (type=str)

See Also: time

split(nonce_string)

Extract a timestamp from the given nonce string
Parameters:
nonce_string - the nonce from which to extract the timestamp
           (type=str)
Returns:
A pair of a Unix timestamp and the salt characters
           (type=(int, str))
Raises:
ValueError - if the nonce does not start with a correctly formatted time string

Generated by Epydoc 2.1 on Fri Dec 14 16:10:52 2007 http://epydoc.sf.net