Sun.security.x509.CertAndKeyGen and sun.security.pkcs.PKCS10 are missing in JDK8. Implementation Suggestions

In JDK8, the class sun.security.x509.CertAndKeyGen no longer exists. Also missing is sun.security.pkcs.PKCS10 . In JDK7, they existed. What could be an alternative to these class methods?

+7
java security x509certificate pkcs # 10
source share
3 answers

I think what you are looking for: sun.security.tools.keytool.CertAndKeyGen

You will find it inside rt.jar in the JRE libraries.

Remember that this class is outside of J2SE , most likely it is available only with OpenJDK , therefore, for example, the GNU compiler will not have it.

+5
source share

If you are using maven, put this in pom.xml. ( from this question ):

 <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.2</version> <configuration> <fork>true</fork> <compilerArgument>-XDignore.symbol.file</compilerArgument> </configuration> </plugin> 
+1
source share

Instead, you should switch to the BouncyCastle API.

-one
source share

All Articles