|
From: Liliana C. <lil...@bu...> - 2015-02-24 09:32:49
|
Hello all,
I'm trying to use EJBCA Web Services to create end entities and P12 certificates.
I've arrived to create them, but I need to save the certificate in a particular location. To do this, I've found a sample code using
KeyStoreHelper class. The problem is that this class is not included within the WSDL (org.ejbca.core.protocol.ws) and I cannot import it
(org.ejbca.core.protocol.ws.common.KeyStoreHelper is unknown).
String username = user1.getUsername();
String password = user1.getPassword();
String outputPath = "C:\\temp\\ClientEJBCA_WS";
String filepath = username + ".p12";
if(result==null){
System.err.println("No keystore could be generated for user");
System.exit(1);
}else{
filepath = outputPath + "/" + filepath;
}
try {
fos = new FileOutputStream(filepath);
} catch (FileNotFoundException ex) {
Logger.getLogger(ClientEJBCA_WS.class.getName()).log(Level.SEVERE, null, ex);
}
KeyStore ks = KeyStoreHelper.getKeyStore(result.getKeystoreData(),"PKCS12",password);
ks.store(fos, password.toCharArray());
try {
fos.close();
System.out.println("Keystore generated, written to " + filepath);
} catch (IOException ex) {
Logger.getLogger(ClientEJBCA_WS.class.getName()).log(Level.SEVERE, null, ex);
}
}
Where can I find KeyStoreHelper class ?
Thanks in advance for your help.
Best regards,
Liliana Cabalantti
Suivi de projets - Atos France
Big Data & Security Service Line
T. +33 (0)1 30 80 63 95
F. +33 (0)1 30 80 63 40
lil...@at...<mailto:lil...@at...>
Avenue Jean Jaurès - BP 68
78340 Les Clayes-sous-Bois
http://www.atos.net<http://www.atos.net/>
[cid:image001.png@01D0501B.F3583E10]
>>>>> Bull a rejoint le groupe Atos <<<<<
|