m2crypto

(When) Will m2crypto be ported to Python3?

戏子无情 提交于 2019-12-05 19:06:16
Is there a port underway of m2crypto to Python3? I'm going to be starting a new toy project that needs cross-platform/cross-language crypto, and m2crypto looks like the way to go, but I'd rather work with Py3, to avoid having to explicitly convert to UTF8 everywhere. Is there any chance that a port of this library is underway? A person started working on this and produced a partial patch which is available in https://bugzilla.osafoundation.org/show_bug.cgi?id=12853 . It would need someone who has need for Python 3.0 to finish it up. Code is at https://gitorious.org/chandler/m2crypto (branch

problems installing M2Crypto on Mint: follow-up

风格不统一 提交于 2019-12-05 02:53:05
问题 I asked a question here regarding installing the M2Crypto python library in Mint. That question was answered successfully and I was able to build and install M2Crypto. However, I am not able to use it within Python. when I attempt to import the module, I get the following error: >>> import M2Crypto Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/M2Crypto/__init__.py", line 22, in <module> import __m2crypto ImportError: /usr

Verify signature with pyopenssl

我是研究僧i 提交于 2019-12-05 00:39:44
问题 I believe that since this question, pyOpenSSL has started supporting the verification of signatures (as of pyOpenSSL 0.11. I am working on a project which was started by someone else using M2Crypto. M2Crypto is really painful to include on platforms such as Heroku as it requires the use of SWIG. Consequently I am trying to remove the dependency on M2Crypto and replace with pyOpenSSL which is easy to install via Pip, and doesn't require custom buildpacks and more which SWIG-related things do.

Installing M2Crypto on CentOS

自闭症网瘾萝莉.ら 提交于 2019-12-04 18:19:50
问题 I am trying to install M2Crypto on CentOS by compiling from the source. i am doing a python setup.py build But I get the following error, /usr/local/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'test_suite' warnings.warn(msg) running build running build_py running build_ext building 'M2Crypto.__m2crypto' extension swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c swig -python -I/usr/local/include/python2.6 -I/usr/include -includeall -o SWIG/_m2crypto_wrap.c

Timestamp server rfc3161 response token generation in Python

≯℡__Kan透↙ 提交于 2019-12-04 14:51:42
I'm trying to implement tsa server on python using twisted. Currently I'm using openssl binary to generate response, but this seems ugly to me, that's why I'm trying to figure out how to make response token with m2crypto. Thanks in advance for help! Maris. EDITED: how to achieve with m2crypto?: openssl ts -reply -section tsa_config1 -queryfile query.tsq -out response.tsr M2Crypto does not yet wrap those pieces of openssl, so you can't use M2Crypto for what you are using the openssl command line client for. You can simply use the rfc3162ng module. download the certificate of your favorite TSA:

easy_install M2Crypto failing on Windows platform

爱⌒轻易说出口 提交于 2019-12-04 13:22:48
问题 I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following: SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h' SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h' SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h' SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h' error: Setup script exited with error: command 'swig.exe'

M2crypto signature “algorithm”

这一生的挚爱 提交于 2019-12-04 08:33:42
These two codes provide the same signature, which is expected: code1: from M2Crypto import RSA, EVP import base64, hashlib text = "some text" pkey = EVP.load_key("mykey.pem") #"mykey.pem" was generated as: openssl genrsa -des3 -out mykey.pem 2048 pkey.sign_init() pkey.sign_update(text) signature = pkey.sign_final() print base64.b64encode(signature) code2: pkey = RSA.load_key("mykey.pem") signature = pkey.sign(hashlib.sha1(text).digest()) print base64.b64encode(signature) However, if I want to "imitate" the signature algorithm, i.e. encrypting the digest with the private key, I get a different

Validating SAML signature in python

五迷三道 提交于 2019-12-04 04:06:02
问题 I need to implement authentication in python from a 3rd party by using SAML2. I have looked into pysaml2 and found that to be quite confusing, and decided to give M2Crypto a chance after I found this question by Ennael. The SAML token I receive can be found here. I have already extracted all the information I need from the Assertion tag (the user's SSN, IP and the SAML tokens expiration window) but I can't get the verify_signature function from Ennael (and the revised code from Ezra Nugroho)

problems installing M2Crypto on Mint: follow-up

岁酱吖の 提交于 2019-12-03 16:31:09
I asked a question here regarding installing the M2Crypto python library in Mint. That question was answered successfully and I was able to build and install M2Crypto. However, I am not able to use it within Python. when I attempt to import the module, I get the following error: >>> import M2Crypto Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/M2Crypto/__init__.py", line 22, in <module> import __m2crypto ImportError: /usr/local/lib/python2.7/dist-packages/M2Crypto/__m2crypto.so: undefined symbol: SSLv2_method If anyone know

easy_install M2Crypto failing on Windows platform

走远了吗. 提交于 2019-12-03 08:28:15
I am attempting to install M2Crypto on a Windows XP platform. I have Python, easy_install and SWIG installed, but when I attempt to easy_install M2Crypto I get the following: SWIG\_m2crypto.i(31) : Error: Unable to find 'openssl\opensslv.h' SWIG\_m2crypto.i(45) : Error: Unable to find 'openssl\safestack.h' SWIG\_evp.i(12) : Error: Unable to find 'openssl\opensslconf.h' SWIG\_ec.i(7) : Error: Unable to find 'openssl\opensslconf.h' error: Setup script exited with error: command 'swig.exe' failed with exit status 1 I have read elsewhere that people have suggested easy_install openssl-devel , but