gdata.tlslite.VerifierDB | index /home/afshar/wrk/gdata-python-client/src/gdata/tlslite/VerifierDB.py

`Class for storing SRP password verifiers.`

Modules

``

Crypto array base64 | binascii math gdata.tlslite.mathtls | os sys traceback |

Classes

``

gdata.tlslite.BaseDB.BaseDB
  VerifierDB

class VerifierDB(gdata.tlslite.BaseDB.BaseDB)
`` | `This class represent an in-memory or on-disk database of SRP password verifiers. A VerifierDB can be passed to a server handshake to authenticate a client based on one of the verifiers. This class is thread-safe.`

Methods defined here:

__init__(self, filename=None)
  `Create a new VerifierDB instance.
  @type filename: str
  @param filename: Filename for an on-disk database, or None for
  an in-memory database. If the filename already exists, follow
  this with a call to open(). To create a new on-disk database,
  follow this with a call to create().`

__setitem__(self, username, verifierEntry)
  `Add a verifier entry to the database.
  @type username: str
  @param username: The username to associate the verifier with.
  Must be less than 256 characters in length. Must not already
  be in the database.
  @type verifierEntry: tuple
  @param verifierEntry: The verifier entry to add. Use
  L{tlslite.VerifierDB.VerifierDB.makeVerifier} to create a
  verifier entry.`

Static methods defined here:

makeVerifier(username, password, bits)
  `Create a verifier entry which can be stored in a VerifierDB.
  @type username: str
  @param username: The username for this verifier. Must be less
  than 256 characters in length.
  @type password: str
  @param password: The password for this verifier.
  @type bits: int
  @param bits: This values specifies which SRP group parameters
  to use. It must be one of (1024, 1536, 2048, 3072, 4096, 6144,
  8192). Larger values are more secure but slower. 2048 is a
  good compromise between safety and speed.
  @rtype: tuple
  @return: A tuple which may be stored in a VerifierDB.`

Methods inherited from gdata.tlslite.BaseDB.BaseDB:

__contains__(self, username)
  `Check if the database contains the specified username.
  @type username: str
  @param username: The username to check for.
  @rtype: bool
  @return: True if the database contains the username, False
  otherwise.`

__delitem__(self, username)

__getitem__(self, username)

check(self, username, param)

create(self)
  `Create a new on-disk database.
  @raise anydbm.error: If there's a problem creating the database.`

keys(self)
  `Return a list of usernames in the database.
  @rtype: list
  @return: The usernames in the database.`

open(self)
  `Open a pre-existing on-disk database.
  @raise anydbm.error: If there's a problem opening the database.
  @raise ValueError: If the database is not of the right type.`

Functions

``

sha1 = openssl_sha1(...)
  `Returns a sha1 hash object; optionally initialized with a string`

Data
`` |  | cryptlibpyLoaded = False gmpyLoaded = False m2cryptoLoaded = False prngName = 'os.urandom' pycryptoLoaded = True sieve = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, ...]