Creating an X509 Certificate in Java without BouncyCastle?

前端 未结 5 737
终归单人心
终归单人心 2020-11-27 11:35

Is it possible to sanely create an X509 Certificate in Java code without using the Bouncy Castle X509V*CertificateGenerator classes?

5条回答
  •  感动是毒
    2020-11-27 12:36

    All the basic components to make a self-signed certificate (signing, X509 encoding etc) are available in JRE. Unlike BC, Sun's JCE doesn't provide any public calls to sign a certificate. However, all the functions are available in Keytool. You can simply copy the code from keytool to do this. The method you need to copy is doSelfCert().

提交回复
热议问题