|
From: <pe...@us...> - 2003-11-21 04:45:47
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline
In directory sc8-pr-cvs1:/tmp/cvs-serv10855/src/java/org/neuclear/signers/commandline
Modified Files:
BuildAllTopLevel.java CommandLineSigner.java
IdentityCreator.java
Log Message:
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
Otherwise You will Finaliate.
Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
This should hopefully make everything more stable (and secure).
Index: BuildAllTopLevel.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/BuildAllTopLevel.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BuildAllTopLevel.java 20 Nov 2003 23:42:24 -0000 1.1
--- BuildAllTopLevel.java 21 Nov 2003 04:45:13 -0000 1.2
***************
*** 33,36 ****
--- 33,42 ----
$Id$
$Log$
+ Revision 1.2 2003/11/21 04:45:13 pelle
+ EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ Otherwise You will Finaliate.
+ Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ This should hopefully make everything more stable (and secure).
+
Revision 1.1 2003/11/20 23:42:24 pelle
Getting all the tests to work in id
***************
*** 46,52 ****
* Time: 3:26:45 PM
*/
! public class BuildAllTopLevel {
! public static SignedNamedObject createIdentities(String name, Signer signer, PublicKeySource pubsource) throws NeuClearException, XMLException {
! IdentityBuilder id = new IdentityBuilder(
name,
pubsource.getPublicKey(name),
--- 52,58 ----
* Time: 3:26:45 PM
*/
! public final class BuildAllTopLevel {
! public static SignedNamedObject createIdentities(final String name, final Signer signer, final PublicKeySource pubsource) throws NeuClearException, XMLException {
! final IdentityBuilder id = new IdentityBuilder(
name,
pubsource.getPublicKey(name),
***************
*** 59,71 ****
}
! public static void main(String args[]) {
try {
! JCESigner rootsig = new DefaultSigner(new GuiDialogAgent());
! JCESigner testsig = new TestCaseSigner();
! Store store = new FileStore("target/testdata/repository");
store.receive(createIdentities("neu://", rootsig, rootsig));
store.receive(createIdentities("neu://test", rootsig, testsig));
store.receive(createIdentities("neu://pelle", rootsig, rootsig));
store.receive(createIdentities("neu://verax", rootsig, rootsig));
} catch (NeuClearException e) {
--- 65,79 ----
}
! public static void main(final String[] args) {
try {
! final JCESigner rootsig = new DefaultSigner(new GuiDialogAgent());
! final JCESigner testsig = new TestCaseSigner();
! final Store store = new FileStore("target/testdata/repository");
store.receive(createIdentities("neu://", rootsig, rootsig));
store.receive(createIdentities("neu://test", rootsig, testsig));
store.receive(createIdentities("neu://pelle", rootsig, rootsig));
store.receive(createIdentities("neu://verax", rootsig, rootsig));
+ store.receive(createIdentities("neu://bob@test", testsig, testsig));
+ store.receive(createIdentities("neu://alice@test", testsig, testsig));
} catch (NeuClearException e) {
Index: CommandLineSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/CommandLineSigner.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** CommandLineSigner.java 13 Nov 2003 23:26:42 -0000 1.13
--- CommandLineSigner.java 21 Nov 2003 04:45:13 -0000 1.14
***************
*** 1,4 ****
--- 1,10 ----
/* $Id$
* $Log$
+ * Revision 1.14 2003/11/21 04:45:13 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.13 2003/11/13 23:26:42 pelle
* The signing service and web authentication application is now almost working.
***************
*** 177,185 ****
*/
public class CommandLineSigner {
! public CommandLineSigner(String args[]) throws ParseException, ConfigurationException {
CryptoTools.ensureProvider();
options = createOptions();
! CommandLineParser clparser = CommandLineParserFactory.newParser();
cmd = clparser.parse(options, args);
--- 183,191 ----
*/
public class CommandLineSigner {
! public CommandLineSigner(final String[] args) throws ParseException, ConfigurationException {
CryptoTools.ensureProvider();
options = createOptions();
! final CommandLineParser clparser = CommandLineParserFactory.newParser();
cmd = clparser.parse(options, args);
***************
*** 191,197 ****
}
! public static void main(String args[]) {
try {
! CommandLineSigner signer = new CommandLineSigner(args);
signer.execute();
} catch (Exception e) {
--- 197,203 ----
}
! public static void main(final String[] args) {
try {
! final CommandLineSigner signer = new CommandLineSigner(args);
signer.execute();
} catch (Exception e) {
***************
*** 200,206 ****
}
! public void checkArguments() {
if (!hasArguments()) {
! HelpFormatter help = new HelpFormatter();
help.printHelp("java " +
this.getClass().getName() +
--- 206,212 ----
}
! public final void checkArguments() {
if (!hasArguments()) {
! final HelpFormatter help = new HelpFormatter();
help.printHelp("java " +
this.getClass().getName() +
***************
*** 219,226 ****
}
! public void execute() {
try {
! NamedObjectBuilder subject = build();
if (Utility.isEmpty(alias)) {
--- 225,232 ----
}
! public final void execute() {
try {
! final NamedObjectBuilder subject = build();
if (Utility.isEmpty(alias)) {
***************
*** 237,241 ****
OutputStream dest = System.out;
if (!Utility.isEmpty(of)) {
! File outFile = new File(of);
if (outFile.getParentFile() != null)
outFile.getParentFile().mkdirs();
--- 243,247 ----
OutputStream dest = System.out;
if (!Utility.isEmpty(of)) {
! final File outFile = new File(of);
if (outFile.getParentFile() != null)
outFile.getParentFile().mkdirs();
***************
*** 253,257 ****
protected NamedObjectBuilder build() throws Exception {
! String sf = cmd.getOptionValue("i");
try {
SignedNamedObject subject;
--- 259,263 ----
protected NamedObjectBuilder build() throws Exception {
! final String sf = cmd.getOptionValue("i");
try {
SignedNamedObject subject;
***************
*** 260,264 ****
source = new FileInputStream(sf);
}
! Document doc = XMLTools.loadDocument(source);
return new NamedObjectBuilder(doc);
} catch (FileNotFoundException e) {
--- 266,270 ----
source = new FileInputStream(sf);
}
! final Document doc = XMLTools.loadDocument(source);
return new NamedObjectBuilder(doc);
} catch (FileNotFoundException e) {
***************
*** 274,278 ****
private Options createOptions() {
// create Options object
! Options options = new Options();
// add t option
--- 280,284 ----
private Options createOptions() {
// create Options object
! final Options options = new Options();
// add t option
***************
*** 290,299 ****
}
! protected void getLocalOptions(Options options) {
options.addOption("i", "inputfile", true, "specify Input File");
}
! protected CommandLine cmd;
! protected Options options;
public final static String keystore = System.getProperty("user.home") + "/.keystore";
protected final Signer sig;
--- 296,305 ----
}
! protected void getLocalOptions(final Options options) {
options.addOption("i", "inputfile", true, "specify Input File");
}
! protected final CommandLine cmd;
! protected final Options options;
public final static String keystore = System.getProperty("user.home") + "/.keystore";
protected final Signer sig;
Index: IdentityCreator.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/IdentityCreator.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** IdentityCreator.java 11 Nov 2003 21:18:43 -0000 1.5
--- IdentityCreator.java 21 Nov 2003 04:45:13 -0000 1.6
***************
*** 1,4 ****
--- 1,10 ----
/* $Id$
* $Log$
+ * Revision 1.6 2003/11/21 04:45:13 pelle
+ * EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
+ * Otherwise You will Finaliate.
+ * Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
+ * This should hopefully make everything more stable (and secure).
+ *
* Revision 1.5 2003/11/11 21:18:43 pelle
* Further vital reshuffling.
***************
*** 173,178 ****
* @version $Revision$
*/
! public class IdentityCreator extends CommandLineSigner {
! public IdentityCreator(String args[]) throws Exception {
super(args);
if (!(sig instanceof PublicKeySource))
--- 179,184 ----
* @version $Revision$
*/
! public final class IdentityCreator extends CommandLineSigner {
! public IdentityCreator(final String[] args) throws Exception {
super(args);
if (!(sig instanceof PublicKeySource))
***************
*** 180,185 ****
pksource = (PublicKeySource) sig;
identity = cmd.getOptionValue("n");
! String cachedirpath = System.getProperty("user.home") + "/.neuclear/cache";
! File cachedir = new File(cachedirpath);
if (!cachedir.exists())
cachedir.mkdirs();
--- 186,191 ----
pksource = (PublicKeySource) sig;
identity = cmd.getOptionValue("n");
! final String cachedirpath = System.getProperty("user.home") + "/.neuclear/cache";
! final File cachedir = new File(cachedirpath);
if (!cachedir.exists())
cachedir.mkdirs();
***************
*** 191,200 ****
}
! public NamedObjectBuilder build() throws Exception {
! String allow = Utility.denullString(cmd.getOptionValue("w"), identity);
! String defaultstore = Utility.denullString(cmd.getOptionValue("r"), NSResolver.NSROOTSTORE);
! String defaultsigner = Utility.denullString(cmd.getOptionValue("i"), "http://localhost:11870/signer");
! String defaultlogger = Utility.denullString(cmd.getOptionValue("l"), LogSender.LOGGER);
! String defaultreceiver = cmd.getOptionValue("b");
final PublicKey newkid = pksource.getPublicKey(allow);
if (newkid == null)
--- 197,206 ----
}
! public final NamedObjectBuilder build() throws Exception {
! final String allow = Utility.denullString(cmd.getOptionValue("w"), identity);
! final String defaultstore = Utility.denullString(cmd.getOptionValue("r"), NSResolver.NSROOTSTORE);
! final String defaultsigner = Utility.denullString(cmd.getOptionValue("i"), "http://localhost:11870/signer");
! 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)
***************
*** 204,210 ****
}
! public static void main(String args[]) {
try {
! IdentityCreator signer = new IdentityCreator(args);
signer.execute();
} catch (Exception e) {
--- 210,216 ----
}
! public static void main(final String[] args) {
try {
! final IdentityCreator signer = new IdentityCreator(args);
signer.execute();
} catch (Exception e) {
***************
*** 214,226 ****
}
! protected String getExtraHelp() {
return "[--name neu://neu/one --allow neuone]";
}
! protected boolean hasArguments() {
return (cmd.hasOption("n") && cmd.hasOption("b"));
}
! protected void getLocalOptions(Options options) {
options.addOption("n", "name", true, "specify name of new Identity");
options.addOption("w", "allow", true, "specify alias of owner of new namespace");
--- 220,232 ----
}
! protected final String getExtraHelp() {
return "[--name neu://neu/one --allow neuone]";
}
! protected final boolean hasArguments() {
return (cmd.hasOption("n") && cmd.hasOption("b"));
}
! protected final void getLocalOptions(final Options options) {
options.addOption("n", "name", true, "specify name of new Identity");
options.addOption("w", "allow", true, "specify alias of owner of new namespace");
|