[英]Trying to read CRL pem file in python with OpenSSL
I have CRL files which I need to read issuer, last update and next update information. 我有一些CRL文件,需要阅读发行人,上次更新和下一次更新的信息。 However I am only able to read revoked as given below.
但是,我只能阅读下面给出的已撤销。
crl = crypto.load_crl(crypto.FILETYPE_PEM, pem)
revoked_list = crl.get_revoked()
I am using Python 2.7 and pyOpenSSL 0.15. 我正在使用Python 2.7和pyOpenSSL 0.15。 How can I read issuer and other data in CRL?
如何读取CRL中的发行人和其他数据?
First: I think you need to update you pyOpenSSL library. 首先:我认为您需要更新pyOpenSSL库。 The latest (17.0 from the 20.04.2017) has the following functions:
最新版本(2017年4月20日的版本为17.0)具有以下功能:
get_issuer()
In order to get the CRL's issuer. 为了获得CRL的发行人。
And 和
export(cert, key, type=1, days=100, digest=<object object>)
In order to export the CRL as a string. 为了将CRL导出为字符串。
Parameters: 参数:
cert (X509) – The certificate used to sign the CRL. cert(X509)–用于签署CRL的证书。
key (PKey) – The key used to sign the CRL. 密钥(PKey)–用于签署CRL的密钥。
Source: The PyOpenSSL library website : 资料来源:PyOpenSSL库网站:
http://www.pyopenssl.org/en/stable/api/crypto.html#OpenSSL.crypto.CRL http://www.pyopenssl.org/en/stable/api/crypto.html#OpenSSL.crypto.CRL
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.