我已经在 ubuntu 服务器上安装了带有 jboss 的 ejbca。jboss的版本是5.1.0.GA,而ejbca的版本是4_0_10。现在我将在我的 java 项目(eclipse)中使用 ejbca 函数,所以我实现了以下代码:
CryptoProviderTools.installBCProvider();
String urlstr = "https://EJBCA.cloud:8443/ejbca/ejbcaws/ejbcaws?wsdl";
System.setProperty("javax.net.ssl.trustStore","C:\\Users\\PcEclipse.jks");
System.setProperty("javax.net.ssl.trustStorePassword","Prova");
System.setProperty("javax.net.ssl.keyStore","C:\\Users\\PcEclipse.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "Prova");
QName qname = new QName("http://ws.protocol.core.ejbca.org/", "EjbcaWSService");
EjbcaWSService service = null;
try {
service = new EjbcaWSService(new URL(urlstr),qname);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
System.out.println("errore nell'url");
}
EjbcaWS ejbcaraws = service.getEjbcaWSPort();
但我有一个例外
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://EJBCA.cloud:8443/ejbca/ejbcaws/ejbcaws?wsdl. It failed with:
Got java.security.cert.CertificateException: No name matching EJBCA.cloud found while opening stream from https://EJBCA.cloud:8443/ejbca/ejbcaws/ejbcaws?wsdl.
密钥库是使用 ejbca web ui 创建一个新的身份和在 jks 扩展中创建一个密钥库生成的。这是密钥库的问题?如何创建正确的密钥库/信任库?谢谢
我已经生成了一个新的密钥库和信任库,但现在错误是:
Caused by: java.security.UnrecoverableKeyException: Password must not be null