在JDK8中,类sun.security.x509.CertAndKeyGen
不再存在。还缺少sun.security.pkcs.PKCS10
。在JDK7中他们存在。什么可以替代这些类方法?
答案 0 :(得分:6)
I think you are looking for: sun.security.tools.keytool.CertAndKeyGen
You'll find it inside the rt.jar under the JRE libraries.
Keep in mind this class is outside of J2SE, it's likely only available with OpenJDK, so for example the GNU Compiler won't have it.
答案 1 :(得分:2)
如果您使用的是maven,请将其放在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>
答案 2 :(得分:-2)
您应该切换到BouncyCastle API。