|
From: Tomas G. <to...@pr...> - 2004-06-28 12:14:09
|
With only a certificate, I believe you should use setCertificateEntry instead of setKeyEntry. /Tomas Koen Serry wrote: > Hi all, > > I'm on the verge of doing a commit of the class > se.anatom.ejbca.admin.Install > As it depended too heavely on the batch files and needed therefor to > know what platform it was run on, I replaced it to do the calls > immediately to the session beans. > The final step (modifying the XML files of both Jetty and tomcat still > needs to be done, but in the import of the keystore in the javacerts I > need to provide a key (|*setKeyEntry > <http://java.sun.com/j2se/1.4.2/docs/api/java/security/KeyStore.html#setKeyEntry%28java.lang.String,%20byte%5B%5D,%20java.security.cert.Certificate%5B%5D%29>*(String > <http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html> alias, > byte[] key, Certificate > <http://java.sun.com/j2se/1.4.2/docs/api/java/security/cert/Certificate.html>[] chain)| > but I don't know what it is, nor where to get it from. (Below the snippet) > > Could someone give me a hint. This should facilitate the install greatly. > > > KeyStore ks = KeyStore.getInstance("JKS"); > ks.load(new > FileInputStream(System.getProperty("JAVA_HOME")+File.separator+"jre"+File.separator+"lib"+File.separator+"security"+File.separator+"cacerts"),this.javacacertspasswd.toCharArray()); > ks.deleteEntry("EJBCA-CA"); > ks.setKeyEntry("EJBCA-CA",new byte[0]/*TODO: don't know > what to add*/,all); > > > Another point: does anyone have objections to removing all related > batch files if this works fine? > > Thanks, > > Koen |