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.
source
share