util Package — pwman3 0.6 documentation

### Navigation

- index
- modules |
- pwman3 0.6 documentation »

# util Package

## `callback` Module

Callback interface To be used when UI needs to be back to get info from user.

class `pwman.util.callback.` `CLICallback`

  Bases: `pwman.util.callback.Callback`

  `getinput`(question)
  `getnewsecret`(question)
  `getsecret`(question)

class `pwman.util.callback.` `Callback`

  Bases: `object`

  Callback interface. Callback classes must implement this.

  `error`(error)

    Present error to user

  `getinput`(question)

    Return text

  `getsecret`(question)

    Return key

  `notice`(warning)

    Present notice to user

  `warning`(warning)

    Present warning to user

## `config` Module

class `pwman.util.config.` `Config`(filename=None, defaults=None, **kwargs)

  Bases: `object`

  `get_value`(section, name)
  `save`()
  `set_value`(section, name, value)

exception `pwman.util.config.` `ConfigException`(message)

  Bases: `exceptions.Exception`

  Basic exception for config.

exception `pwman.util.config.` `ConfigNoConfigException`(message)

  Bases: `pwman.util.config.ConfigException`

`pwman.util.config.` `get_pass_conf`(config)

## `crypto_engine` Module

class `pwman.util.crypto_engine.` `CryptoEngine`(salt=None, digest=None, algorithm='AES', timeout=-1, reader=None)

  Bases: `object`

  `authenticate`(password)

    salt and digest are stored in a file or a database

  `callback`

    return call back function

  `changepassword`(reader=<built-in function raw_input>)
  `decrypt`(cipher_text)
  `encrypt`(text)
  `forget`()

    discard cipher

  classmethod `get`(timeout=-1)
  `get_cryptedkey`()

    return _keycrypted

  `set_cryptedkey`(key)

exception `pwman.util.crypto_engine.` `CryptoException`

  Bases: `exceptions.Exception`

`pwman.util.crypto_engine.` `DecodeAES`(c, e)

`pwman.util.crypto_engine.` `EncodeAES`(c, s)

`pwman.util.crypto_engine.` `generate_password`(pass_len=8, uppercase=True, lowercase=True, digits=True, special_chars=True)

`pwman.util.crypto_engine.` `get_cipher`(password, salt)

  Create a chiper object from a hashed password

`pwman.util.crypto_engine.` `get_digest`(password, salt)

  Get a digest based on clear text password

`pwman.util.crypto_engine.` `prepare_data`(text, block_size)

  prepare data before encryption so the lenght matches the expected lenght by the algorithm.

`pwman.util.crypto_engine.` `zerome`(string)

  securely erase strings ... for windows: ctypes.cdll.msvcrt.memset

### Navigation

- index
- modules |
- pwman3 0.6 documentation »