linotp.lib.security.provider module

The security provider is a dynamic handler for security relevant tasks like random, crypt, decrypt, sign

class linotp.lib.security.provider.SecurityProvider(secLock)[source]

Bases: object

the security provider is the singleton in the server who provides the security modules to run security relevant methods

  • read the hsm configurations
  • set up a pool of hsm modules
  • bind a hsm to one session
  • free the hsm from session after usage

the thread id is used as session identifier

createHSMPool(hsm_id=None, *args, **kw)[source]

setup a pool of security providers

dropSecurityModule(hsm_id=None, sessionId=None)[source]
getSecurityModule(hsm_id=None, sessionId=None)[source]
loadSecurityModule(id=None)[source]

return the specified security module

Parameters:id (String or None) – identifier for the security module (from the configuration)
Returns:None or the created object
Return type:security module
load_config(config)[source]

load the security modules configuration

setupModule(hsm_id, config=None)[source]

setupModule is called during runtime to define the config parameters like password or connection strings

linotp.lib.security.provider.main()[source]