How to verify RSA SHA1 signature in pyOpenSSL

I tried to install M2Crypto and run into problems. I do not want to force my clients to use libraries that are difficult to install. So, I thought I would try pyOpenSSL. I can get the public key from the pem certificate, but I cannot find a way to verify the signature.

+1
source share
2 answers

You simply cannot do this with pyOpenSSL. This is a very limited shell around the openssl library. But I have an assumption that it is wrong with creating M2Crypto on your host. Try to run:

export SWIG_FEATURES=-I/usr/include/openssl 

before trying to install M2Crypto.

0
source

I believe that you need the code from this blog post (it's mine):

http://www.v13.gr/blog/?p=303

As you can see, you should use DER to process the certificate and obtain the appropriate parts. It took a lot of effort and days, so let me know if this works for you.

0
source

Source: https://habr.com/ru/post/923895/


All Articles