Reading an X.509 certificate with Java

后端 未结 1 1966
时光取名叫无心
时光取名叫无心 2020-12-10 05:21

I am trying to use Java to read a certificate that I received from an external party. The code is throwing the following error:

java.lang.RuntimeExcep

相关标签:
1条回答
  • 2020-12-10 05:58

    Try to type this using openssl, and then import the result:

    openssl x509 -outform der -in certificate.pem -out certificate.der
    

    or use the Java Bouncy Castle functionality in the lightweight API:

    http://www.bouncycastle.org/docs/pkixdocs1.5on/org/bouncycastle/openssl/PEMReader.html

    You may encode the result again and then use the default CertificateBuilder in Java to get a JCE defined certificate.

    0 讨论(0)
提交回复
热议问题