sun.security.x509.CertAndKeyGen和sun.security.pkcs.PKCS10 - 在JDK8中缺失.实施建议

Ern*_*dis 7 java security x509certificate pkcs#10

在JDK8中,该类sun.security.x509.CertAndKeyGen不再存在.也sun.security.pkcs.PKCS10缺少了.在JDK7中他们存在.什么可以替代这些类方法?

mes*_*mpi 8

如果您使用的是 Maven,请将其放入 pom.xml 中。(来自这个问题):

<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>
Run Code Online (Sandbox Code Playgroud)


mik*_*pr4 6

我想你正在寻找:sun.security.tools.keytool.CertAndKeyGen

您可以在JRE库下的rt.jar中找到它.

请记住,这个类在J2SE之外,它可能仅适用于OpenJDK,因此例如GNU编译器不会拥有它.