tlslite.VerifierDB.VerifierDB

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

## Class VerifierDB

    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.

Method Summary
| ``__init__`(self, filename)` Create a new VerifierDB instance.
| ``__setitem__`(self, username, verifierEntry)` Add a verifier entry to the database.
tuple | ``makeVerifier`(username, password, bits)` Create a verifier entry which can be stored in a VerifierDB. (Static method)
Inherited from BaseDB
bool | ``__contains__`(self, username)` Check if the database contains the specified username.
| ``__delitem__`(self, username)`
| ``__getitem__`(self, username)`
| ``check`(self, username, param)`
| ``create`(self)` Create a new on-disk database.
list | ``keys`(self)` Return a list of usernames in the database.
| ``open`(self)` Open a pre-existing on-disk database.

Instance Method Details

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

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

Static Method Details

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

Generated by Epydoc 2.0 on Mon Feb 21 21:56:55 2005 | http://epydoc.sf.net