tlslite.verifierdb.VerifierDB

Package tlslite :: Module verifierdb :: Class VerifierDB |
[hide private]
[frames] | no frames]

# Class VerifierDB

source code

    basedb.BaseDB --+
                    |
                   VerifierDB

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.

Instance Methods | [hide private]
__init__(self, filename=None) Create a new VerifierDB instance. | source code
__setitem__(self, username, verifierEntry) Add a verifier entry to the database. | source code
_checkItem(self, value, username, param) | source code
_getItem(self, username, valueStr) | source code
_setItem(self, username, value) | source code
Inherited from `basedb.BaseDB`: `__contains__`, `__delitem__`, `__getitem__`, `check`, `create`, `keys`, `open`

Static Methods | [hide private]
tuple |
makeVerifier(username, password, bits) Create a verifier entry which can be stored in a VerifierDB. | source code

Method Details | [hide private]

### __init__(self, filename=None) (Constructor) | source code
Create a new VerifierDB instance. Parameters: `filename` (str) - 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(). Overrides: basedb.BaseDB.__init__

### __setitem__(self, username, verifierEntry) (Index assignment operator) | source code
Add a verifier entry to the database. Parameters: `username` (str) - The username to associate the verifier with. Must be less than 256 characters in length. Must not already be in the database. `verifierEntry` (tuple) - The verifier entry to add. Use tlslite.verifierdb.VerifierDB.makeVerifier to create a verifier entry. Overrides: basedb.BaseDB.__setitem__

### makeVerifier(username, password, bits) Static Method | source code
Create a verifier entry which can be stored in a VerifierDB. Parameters: `username` (str) - The username for this verifier. Must be less than 256 characters in length. `password` (str) - The password for this verifier. `bits` (int) - 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. Returns: tuple A tuple which may be stored in a VerifierDB.