title: Need help using M2Crypto.Engine to access USB Token
body: <p>I am using M2Crypto-0.20.2. I want to use engine_pkcs11 from the OpenSC project and the Aladdin PKI client for token based authentication making xmlrpc calls over ssl.</p>
  
  <pre><code>from M2Crypto import Engine
  
  Engine.load_dynamic()
  dynamic = Engine.Engine('dynamic')
  # Load the engine_pkcs from the OpenSC project
  dynamic.ctrl_cmd_string("SO_PATH", "/usr/local/ssl/lib/engines/engine_pkcs11.so")
  Engine.cleanup()
  
  Engine.load_dynamic()
  # Load the Aladdin PKI Client
  aladdin = Engine.Engine('dynamic')
  aladdin.ctrl_cmd_string("SO_PATH", "/usr/lib/libeTPkcs11.so")
  
  key = aladdin.load_private_key("PIN","password")
  </code></pre>
  
  <p>This is the error I receive:</p>
  
  <pre><code>key = pkcs.load_private_key("PIN","eT0ken")
  File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 70, in load_private_key
      return self._engine_load_key(m2.engine_load_private_key, name, pin)
  File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 60, in _engine_load_key
      raise EngineError(Err.get_error())
  M2Crypto.Engine.EngineError: 23730:error:26096075:engine routines:ENGINE_load_private_key:not initialised:eng_pkey.c:112:
  </code></pre>
  
  <p>For <code>load_private_key()</code>, what should be passed as the first argument?  The M2Crypto documentation does not explain it.</p>
  
  <p>I don't get any errors loading the engines, but I'm not sure if I'm loading them correctly.  It seems like the engine ID has to be a specific name but I don't find that list anywhere.   <code>'dynamic'</code> is working for me.  </p>
  
  <p>Any help would be appreciated!</p>