如何在pyOpenSSL中验证RSA SHA1签名 [英] How do you verify an RSA SHA1 signature in pyOpenSSL

查看:344
本文介绍了如何在pyOpenSSL中验证RSA SHA1签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装M2Crypto并遇到问题.我不想强迫我的客户使用此类难以安装的库.因此,我想尝试一下pyOpenSSL.我可以从pem证书中获取公钥,但是找不到任何方法来验证签名.

I tried installing M2Crypto and facing problems. I don't want to force my customers to use such libraries which are difficult to install. So, I thought I would give pyOpenSSL a try. I am able to get the public key from pem certificate but am not able to find any way to verify the signature.

推荐答案

我相信您想要的是此博客条目(属于我)中的代码:

I believe that what you want is the code from this blog entry (it's mine):

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

如您所见,您必须使用DER来处理证书并获得适当的零件.这花费了我大量的精力和时间,所以请让我知道它是否对您也有用.

As you can see you have to use DER to handle the certificate and get the appropriate parts. That took me a considerable amount of effort and days so let me know whether it worked for you too.

这篇关于如何在pyOpenSSL中验证RSA SHA1签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆