X509_STORE 和 X509_STORE_CTX 之间有什么区别?
谁能告诉我证书信任链是如何由这些结构形成的以及这两个结构代表什么?
can any one tell me how the Certificate trust chain is formed with these structures and what these two structure represent?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
摘自x509vfy.h中的源代码:
X509_STORE 或多或少代表您的全局证书验证设置,您在其中存储中间证书和 CRL。该存储可以多次使用,而您设置 X509_STORE_CTX 只是为了执行一次验证,然后丢弃/释放它。
将 X509_STORE 视为您的配置,将 X509_STORE_CTX 视为有状态的一次性对象。
如果您想亲自查看,我建议您下载源代码并查看 app/verify.c。
Taken from the source code in x509vfy.h:
The X509_STORE represents more or less your global certificate validation setup, where you store the intermediate certificates and CRLs. The store can be used multiple times, whereas you set up a X509_STORE_CTX just to perform one validation, after that you discard/free it.
Think of the X509_STORE as your configuration and the X509_STORE_CTX as a stateful one-shot object.
If you'd like to see for yourself I recommend downloading the sources and having a look at app/verify.c.