Converting a byte array to a X.509 certificate

匆匆过客 提交于 2019-12-04 10:08:42

It seems your base64-encoded data does not represent an X.509 certificate:

[The X509EncodedKeySpec class] represents the ASN.1 encoding of a public key

Export the whole X.509 certificate in Java, or try to find an equivalent of the X509EncodedKeySpec class in the .NET framework.

I have encountered a similar issue, and in my case it boiled down to an 'endian' problem.

The solution was simply to reverse the byte array (Array.Reverse in .NET)

I don't have the 2 IDEs in front of me to show a proof, but if you get stuck, give it a try!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!