Bouncycastle:X509CertificateHolder 到 X509Certificate?
在 r146 之前的版本中,可以直接创建 X509Certificate 对象。 现在该 API 已弃用,新 API 仅提供一个 X509CertificateHolder
对象。
我找不到将 X509CertificateHolder
转换为 X509Certificate
的方法。
这怎么能做到呢?
In versions prior to r146 it was possible to create X509Certificate
objects directly.
Now that API is deprecated and the new one only deliveres a X509CertificateHolder
object.
I cannot find a way to transform a X509CertificateHolder
to X509Certificate
.
How can this be done?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我会回答我自己的问题,但不会删除它,以防其他人遇到同样的问题:
对于属性证书:
不好,因为它是编码和解码,但它有效。
I will answer to my own questions, but not delete it, in case someone else got the same problems:
And for attribute certificates:
Not nice, as it is encoding and decoding, but it works.
另一种选择是这个:)
Another option is this one :)
可以将
X509CertificateHolder
获取到X509Certificate
和toString
。 (代码第一句无关紧要)........
This is an possibility to get the
X509CertificateHolder
toX509Certificate
andtoString
. (first sentence of the code is irrelevant)........