本帖最后由 杨兴庭 于 2013-7-30 22:32 编辑
想生成一个证书,但是,每次都要在程序关闭后才会在文件夹中出现证书,这是为什么?
进程后加入p.waitFor()就会挂死,网上的方法好像也不管用
代码:- try{
- Process p=Runtime.getRuntime().exec(new String[]{
- "keytool", "-genkey", "-keyalg", "RSA", "-keystore", "mykeystore.keystore", "-storepass", jtf3.getText(),
- "-dname", "\"cn=", jtf1.getText(),"ou=",jtf5.getText(), "o=",jtf6.getText(),"L=",jtf7.getText(),
- "ST=",jtf8.getText(),"c=",jtf9.getText(),"\"", "-validity", jtf10.getText(),"-alias", jtf2.getText()}
- );
- }catch(Exception e){System.out.println("wrong");}
复制代码 |