Alternative to CertandKeygen for self-creating certificate in Java

I have the following way to create a self-signed certificate using the CertandKeyGen class.

CertandKeyGen cert = new CertandKeyGen("RSA", "SHA256withRSA);  
cert.generate(size);  
..  
X509Certificate certificate = cert.getSelfCertificate(name, validity);

Since these are the internal APIs from keytool, I am considering a similar approach using java.security. * API. I want to know if this is currently possible. If so, what are the APIs? I rummaged, but I can’t find anything. I know about the Bouncy API (X509V3CertificateGenerator), but I do not want to use third-party APIs.

Thank.

+2
source share
1 answer

, /, keytool, API Java.

CA/Signing, BouncyCastle .

, api .

+1

Source: https://habr.com/ru/post/1652456/


All Articles