现在有一堆 SSL 证书,需要提取其中的 Issuer 、 Subject 等信息吧,就是 windows 下双击这个证书里能看到的颁发者、使用时间啥的。之前用 C#的 System.Security.Cryptography.X509Certificates 包来做的,现在开发环境换 python 了,也没找到比较好用的库。
求老司机引导一下……
求老司机引导一下……
|
bxb100Dec 21, 2016 via Android
1
好像自带库里有,没用过,我也不清楚,帮
|
|
way2expDec 21, 2016
2
|
|
vvoodyDec 21, 2016
3
PyOpenSSL
OpenSSL.SSL.Connection() get_peer_certificate() get_peer_cert_chain() |
|
4
import os
os.system("openssl x509 -text -noout -in cert.crt") |
|
jinfeng333Dec 21, 2016
6
|
|
9
好,自问自答一波
使用 pyOpenSSL: OpenSSL.crypto.load_certificate(type, buffer) get_subject() get_issuer() |