Hi Dave, thank you for your help. I solved the problem by retyping the command. I don't know why, but it works now. And i currently work on the alternative solution with JSS.
ron Dave worte: > Ron Lu wrote: > > Hi, > > i tried to use the methode exec from the Class Runtime to run certutil > in java. The function of listing all certificates in a certain db(-L -d > C:\test) works well. However, i cannot add any cert to the db, although it > works when i do this from the command-line. > > My code looks as follows: > > String cmdadd = "C:/nss3_10/certutil.exe " + > > "–A –n nickName" + > > " –t \"c,c,c\"" + > > " –i " + "C:/cert_test/certName.der" + > > " -d " + "C:/cert_test"; > > Process p = Runtime.getRuntime().exec(cmdadd); > > You probably want to use JSS and use the importCertToPerm method of the > CryptoManager class. > > http://www.mozilla.org/projects/security/pki/jss/ > http://www.mozilla.org/projects/security/pki/jss/javadoc/org/mozilla/jss/CryptoManager.html#importCertToPerm(org.mozilla.jss.crypto.X509Certificate,%20java.lang.String) > > If you *really* want to continue doing it the way you are, I've had > better experience passing in the command as an array of Strings rather > than as one big string. > > Dave > _______________________________________________ > dev-tech-crypto mailing list > dev-tech-crypto@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-tech-crypto -- GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS. Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail _______________________________________________ dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto