Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv502/src/java/org/neuclear/passphraseagents
Modified Files:
CommandLineAgent.java GuiDialogAgent.java PassPhraseAgent.java
Added Files:
AskAtStartupAgent.java InteractiveAgent.java
StoredPassphraseAgent.java
Log Message:
The IdentityCreator now fully works with the new Signer architecture.
--- NEW FILE: AskAtStartupAgent.java ---
package org.neuclear.passphraseagents;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: AskAtStartupAgent.java,v 1.1 2003/10/31 23:58:53 pelle Exp $
$Log: AskAtStartupAgent.java,v $
Revision 1.1 2003/10/31 23:58:53 pelle
The IdentityCreator now fully works with the new Signer architecture.
*/
/**
* User: pelleb
* Date: Oct 30, 2003
* Time: 5:09:36 PM
*/
public class AskAtStartupAgent implements PassPhraseAgent {
public AskAtStartupAgent(InteractiveAgent agent, String name) {
this.name = name;
this.passphrase = agent.getPassPhrase(name);
}
/**
* Retrieve the PassPhrase for a given name/alias
*
* @param name
* @return
*/
public char[] getPassPhrase(String name) {
if (name.equals(this.name))
return passphrase;
else
return new char[0];
}
private final String name;
private final char[] passphrase;
}
--- NEW FILE: InteractiveAgent.java ---
package org.neuclear.passphraseagents;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: InteractiveAgent.java,v 1.1 2003/10/31 23:58:53 pelle Exp $
$Log: InteractiveAgent.java,v $
Revision 1.1 2003/10/31 23:58:53 pelle
The IdentityCreator now fully works with the new Signer architecture.
*/
/**
* Marker interface to mark interactive PassPhraseAgents.
* User: pelleb
* Date: Oct 30, 2003
* Time: 5:13:49 PM
*/
public interface InteractiveAgent extends PassPhraseAgent {
}
--- NEW FILE: StoredPassphraseAgent.java ---
package org.neuclear.passphraseagents;
/*
NeuClear Distributed Transaction Clearing Platform
(C) 2003 Pelle Braendgaard
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
$Id: StoredPassphraseAgent.java,v 1.1 2003/10/31 23:58:53 pelle Exp $
$Log: StoredPassphraseAgent.java,v $
Revision 1.1 2003/10/31 23:58:53 pelle
The IdentityCreator now fully works with the new Signer architecture.
*/
/**
* This agent contains one passphrase which is read at startup
* from the configuration files.
* This should never be used for any kind of production server usage.
* User: pelleb
* Date: Oct 30, 2003
* Time: 5:01:14 PM
*/
public class StoredPassphraseAgent implements PassPhraseAgent {
public StoredPassphraseAgent(String name, String passphrase) {
this.name = name;
this.passphrase = passphrase.toCharArray();
System.out.println("StoredPassphraseAgent started.\nDO NOT USE FOR PRODUCTION SERVERS");
}
public char[] getPassPhrase(String name) {
if (name.equals(this.name))
return passphrase;
else
return new char[0];
}
private final String name;
private final char[] passphrase;
}
Index: CommandLineAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/passphraseagents/CommandLineAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CommandLineAgent.java 29 Oct 2003 21:16:27 -0000 1.1
--- CommandLineAgent.java 31 Oct 2003 23:58:53 -0000 1.2
***************
*** 25,28 ****
--- 25,31 ----
$Id$
$Log$
+ Revision 1.2 2003/10/31 23:58:53 pelle
+ The IdentityCreator now fully works with the new Signer architecture.
+
Revision 1.1 2003/10/29 21:16:27 pelle
Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
***************
*** 39,43 ****
* Time: 11:53:29 AM
*/
! public class CommandLineAgent implements PassPhraseAgent {
public char[] getPassPhrase(String name) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
--- 42,46 ----
* Time: 11:53:29 AM
*/
! public class CommandLineAgent implements InteractiveAgent {
public char[] getPassPhrase(String name) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
Index: GuiDialogAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/passphraseagents/GuiDialogAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GuiDialogAgent.java 29 Oct 2003 21:16:27 -0000 1.1
--- GuiDialogAgent.java 31 Oct 2003 23:58:53 -0000 1.2
***************
*** 25,28 ****
--- 25,31 ----
$Id$
$Log$
+ Revision 1.2 2003/10/31 23:58:53 pelle
+ The IdentityCreator now fully works with the new Signer architecture.
+
Revision 1.1 2003/10/29 21:16:27 pelle
Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
***************
*** 43,47 ****
* Time: 5:49:14 PM
*/
! public final class GuiDialogAgent implements PassPhraseAgent {
public GuiDialogAgent() {
frame = new Frame("Please Enter Passphrase...");
--- 46,50 ----
* Time: 5:49:14 PM
*/
! public final class GuiDialogAgent implements InteractiveAgent {
public GuiDialogAgent() {
frame = new Frame("Please Enter Passphrase...");
***************
*** 70,76 ****
canvas.setSize(50, 50);
text.add(canvas);
- System.out.println("Added image");
} catch (InterruptedException ex) {
! System.out.println("Couldn't load Image");
}
--- 73,78 ----
canvas.setSize(50, 50);
text.add(canvas);
} catch (InterruptedException ex) {
! ;//System.out.println("Couldn't load Image");
}
***************
*** 132,137 ****
public static void main(String args[]) {
PassPhraseAgent dia = new GuiDialogAgent();
! System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
! System.out.println("Getting passphrase... " + dia.getPassPhrase("neu://pelle@test"));
System.exit(0);
--- 134,139 ----
public static void main(String args[]) {
PassPhraseAgent dia = new GuiDialogAgent();
! System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
! System.out.println("Getting passphrase... " + new String(dia.getPassPhrase("neu://pelle@test")));
System.exit(0);
Index: PassPhraseAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/passphraseagents/PassPhraseAgent.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PassPhraseAgent.java 29 Oct 2003 21:16:27 -0000 1.1
--- PassPhraseAgent.java 31 Oct 2003 23:58:53 -0000 1.2
***************
*** 2,6 ****
-
/*
NeuClear Distributed Transaction Clearing Platform
--- 2,5 ----
***************
*** 23,26 ****
--- 22,28 ----
$Id$
$Log$
+ Revision 1.2 2003/10/31 23:58:53 pelle
+ The IdentityCreator now fully works with the new Signer architecture.
+
Revision 1.1 2003/10/29 21:16:27 pelle
Refactored the whole signing process. Now we have an interface called Signer which is the old SignerStore.
***************
*** 40,43 ****
--- 42,52 ----
*/
public interface PassPhraseAgent {
+
+ /**
+ * Retrieve the PassPhrase for a given name/alias
+ *
+ * @param name
+ * @return
+ */
char[] getPassPhrase(String name);
}
|