我对Java安全方面很陌生,偶然发现了一个叫做BouncyCastle的库。但是他们提供的示例和网上的一些示例都要求使用
return new PKCS10CertificationRequest("SHA256withRSA", new X500Principal(
"CN=Requested Test Certificate"), pair.getPublic(), null, pair.getPrivate()
但是当我使用PKCS10CertificationRequest
时,它看起来已经过时了。所以我开始研究另一种方法,使用CertificationRequest
类。但我很困惑,构造函数不使用相同的参数,而是需要CertificationRequestInfo
类,我不确定如何填写它。
CertificationRequest request = new CertificationRequest(...);
如果有人能帮我弄清楚如何生成CSR,以便我可以将其发送到服务器进行签名,那就太好了。