#11 Just Found Out, 1 little Bug

closed
nobody
None
5
2004-10-14
2004-09-17
Enoch Chong
No

-.-" I posted to the wrong place...

in the MyKeyStore.java

This program portion is forget to handle the fileName
of text consist of space inside like /enoch test/, it
must enclose with quote like "/enoch test/".

before:
public static void genkey(String alias, char[]
password, String fileName, String dname) {
StringBuffer cmd = new StringBuffer("-genkey -keyalg rsa");
cmd.append(" -alias ").append(alias);
...
} // genkey

public static void selfcert(String alias, char[]
password, String fileName, String dname) {
StringBuffer cmd = new StringBuffer("-selfcert");
cmd.append(" -alias ").append(alias);
...
} // selfcert

After:

Just adding one line to it, and it can run normally no
matter the filename consist of the space or not.

public static void genkey(String alias, char[]
password, String fileName, String dname) {
StringBuffer cmd = new StringBuffer("-genkey -keyalg rsa");
fileName = "\"" + fileName + "\"";
cmd.append(" -alias ").append(alias);
...
} // genkey

public static void selfcert(String alias, char[]
password, String fileName, String dname) {
StringBuffer cmd = new StringBuffer("-selfcert");
fileName = "\"" + fileName + "\"";
cmd.append(" -alias ").append(alias);
...
} // selfcert

That's all-.-"

Discussion

  • Jorg Janke
    Jorg Janke
    2004-10-14

    • status: open --> closed
     
  • Jorg Janke
    Jorg Janke
    2004-10-14

    Logged In: YES
    user_id=87038

    fixed.