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.
I am trying to load the PKCS#11 engine as well as the Aladdin module (see code below). But I get an error:
AttributeError: ‘module’ object has no attribute ‘load_dynamic_engine’
from M2Crypto import SSL, m2
m2.load_dynamic_engine("dynamic","/usr/local/ssl/lib/engines/engine_pkcs11.so")
m2.load_dynamic_engine("pkcs11","/usr/lib/libeTPkcs11.so")
According to the M2Crypto documentation, this function should be available. This is the documentation I’m reading: http://www.heikkitoivonen.net/m2crypto/api/
Can anyone point me to the correct documentation or help with figuring out how to load the engines?
Thanks!
I haven’t used the Engine module myself, so I cannot give you any definite answers. However, you should take a look at test_engine.py module for some pointers. I am guessing that to load engines provided by OpenSSL you shouldn’t use that form of
load_dynamic_engine(), but eitherload_dynamic()orload_openssl(). You’d probably needload_dynamic_engine()only when loading 3rd party modules.