|
From: <pe...@us...> - 2003-12-18 17:40:35
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline
In directory sc8-pr-cvs1:/tmp/cvs-serv29659/src/java/org/neuclear/id/tools/commandline
Modified Files:
CommandLineSigner.java IdentityCreator.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: CommandLineSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline/CommandLineSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CommandLineSigner.java 12 Dec 2003 00:13:11 -0000 1.3
--- CommandLineSigner.java 18 Dec 2003 17:40:19 -0000 1.4
***************
*** 1,4 ****
--- 1,9 ----
/* $Id$
* $Log$
+ * Revision 1.4 2003/12/18 17:40:19 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.3 2003/12/12 00:13:11 pelle
* This may actually work now. Need to put a few more test cases in to make sure.
***************
*** 284,288 ****
of = subject.getLocalName() + ".xml";
System.err.println("Key with alias: " + alias + " doesnt exist in our keystore. \nSaving unsigned Identity as: " + of);
! } else {
System.err.println("Signing by " + alias + " ...");
subject.sign(alias, sig);
--- 289,293 ----
of = subject.getLocalName() + ".xml";
System.err.println("Key with alias: " + alias + " doesnt exist in our keystore. \nSaving unsigned Identity as: " + of);
! } else if(!subject.isSigned()) {
System.err.println("Signing by " + alias + " ...");
subject.sign(alias, sig);
Index: IdentityCreator.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/tools/commandline/IdentityCreator.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** IdentityCreator.java 11 Dec 2003 16:16:14 -0000 1.3
--- IdentityCreator.java 18 Dec 2003 17:40:19 -0000 1.4
***************
*** 1,4 ****
--- 1,9 ----
/* $Id$
* $Log$
+ * Revision 1.4 2003/12/18 17:40:19 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.3 2003/12/11 16:16:14 pelle
* Some changes to make the xml a bit more readable.
***************
*** 243,251 ****
final String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER);
final String defaultreceiver = cmd.getOptionValue("b");
final PublicKey newkid = pksource.getPublicKey(allow);
if (newkid == null)
throw new CryptoException("PublicKey not available for: " + allow);
return new IdentityBuilder(identity, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver);
-
}
--- 248,268 ----
final String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER);
final String defaultreceiver = cmd.getOptionValue("b");
+ if (!sig.canSignFor(allow)){
+ System.out.println("You do not currently have a key matching this name. Do you with to create one?");
+ if (!Utility.getAffirmative(true)) {
+ System.out.println("OK, Bye");
+ System.exit(0);
+ }
+ System.out.print("Generating Keys for "+allow+"... ");
+ PublicKey pub=sig.generateKey(allow);
+ System.out.println("DONE");
+ System.out.println("STORING Keys");
+ sig.save();
+
+ }
final PublicKey newkid = pksource.getPublicKey(allow);
if (newkid == null)
throw new CryptoException("PublicKey not available for: " + allow);
return new IdentityBuilder(identity, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver);
}
|