M2Crypto:load_dynamic_engine() 的属性错误

发布于 2024-08-20 07:02:05 字数 657 浏览 3 评论 0原文

我正在使用 M2Crypto-0.20.2。我想使用 OpenSC 项目中的 engine_pkcs11 和 Aladdin PKI 客户端进行基于令牌的身份验证,通过 ssl 进行 xmlrpc 调用。

我正在尝试加载 PKCS#11 引擎以及 Aladdin 模块(请参阅下面的代码)。但我收到一个错误: 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")

根据 M2Crypto 文档,此函数应该可用。这是我正在阅读的文档: http://www.heikkitoivonen.net/m2crypto/api/

任何人都可以向我指出正确的文档或帮助我弄清楚如何加载引擎吗?

谢谢!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

一向肩并 2024-08-27 07:02:05

我自己没有使用过Engine模块,所以无法给你任何明确的答案。但是,您应该查看 test_engine.py 模块以了解一些信息指针。我猜测要加载 OpenSSL 提供的引擎,您不应该使用 load_dynamic_engine() 的形式,而应该使用 load_dynamic()load_openssl().您可能仅在加载第 3 方模块时才需要 load_dynamic_engine()

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 either load_dynamic() or load_openssl(). You'd probably need load_dynamic_engine() only when loading 3rd party modules.

吹梦到西洲 2024-08-27 07:02:05

我读错了文档。 load_dynamic_engine() 属于 Engine 模块。

我更改了命令,现在出现了不同的错误:
Engine.load_dynamic_engine("dynamic","/usr/local/ssl/lib/engines/engine_pkcs11.so")

错误的引擎 ID
Engine.load_dynamic_engine("动态","/usr/local/ssl/lib/engines/engine_pkcs11.so")
文件“/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py”,第 92 行,位于 load_dynamic_engine
e.ctrl_cmd_string("LOAD", 无)
文件“/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py”,第 38 行,在 ctrl_cmd_string 中
引发 EngineError(Err.get_error())
M2Crypto.Engine.EngineError:23541:错误:260B606D:引擎例程:DYNAMIC_LOAD:初始化失败:eng_dyn.c:521:

知道这意味着什么吗?

I was reading the documentation wrong. The load_dynamic_engine() belong in the Engine module.

I changed the command and now get a different error:
Engine.load_dynamic_engine("dynamic","/usr/local/ssl/lib/engines/engine_pkcs11.so")

bad engine id
Engine.load_dynamic_engine("dynamic","/usr/local/ssl/lib/engines/engine_pkcs11.so")
File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 92, in load_dynamic_engine
e.ctrl_cmd_string("LOAD", None)
File "/usr/local/lib/python2.4/site-packages/M2Crypto/Engine.py", line 38, in ctrl_cmd_string
raise EngineError(Err.get_error())
M2Crypto.Engine.EngineError: 23541:error:260B606D:engine routines:DYNAMIC_LOAD:init failed:eng_dyn.c:521:

Any idea what this means?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文