|
From: <pe...@us...> - 2003-12-18 17:40:11
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons
In directory sc8-pr-cvs1:/tmp/cvs-serv29525/src/java/org/neuclear/commons
Modified Files:
Utility.java
Log Message:
You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
IdentityCreator has been modified to allow creation of keys.
Note The actual Creation of Certificates still have a problem that will be resolved later today.
Index: Utility.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/Utility.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Utility.java 21 Nov 2003 04:43:42 -0000 1.2
--- Utility.java 18 Dec 2003 17:40:07 -0000 1.3
***************
*** 2,5 ****
--- 2,10 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/12/18 17:40:07 pelle
+ * You can now create keys that get stored with a X509 certificate in the keystore. These can be saved as well.
+ * IdentityCreator has been modified to allow creation of keys.
+ * Note The actual Creation of Certificates still have a problem that will be resolved later today.
+ *
* Revision 1.2 2003/11/21 04:43:42 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 128,131 ****
--- 133,139 ----
import java.io.PrintStream;
+ import java.io.BufferedReader;
+ import java.io.InputStreamReader;
+ import java.io.IOException;
public final class Utility {
***************
*** 193,196 ****
--- 201,224 ----
return i;
return def;
+ }
+ /**
+ * Asks the User Y/N on the Console
+ * @return
+ */
+ public static boolean getAffirmative(final boolean def) throws IOException {
+ final String prompt = def?"(yes)/no":"yes/(no)";
+ String line=prompt(prompt).toLowerCase();
+ if (isEmpty(line))
+ return def;
+ return (line.equals("y")||line.equals("yes"));
+ }
+
+ public static String prompt(String prompt) throws IOException {
+ System.out.print(prompt);
+ return readLine();
+ }
+ public static String readLine() throws IOException {
+ BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
+ return reader.readLine();
}
|