|
From: <pe...@us...> - 2003-12-19 00:30:58
|
Update of /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone
In directory sc8-pr-cvs1:/tmp/cvs-serv18910/src/java/org/neuclear/signers/standalone
Modified Files:
StandaloneSigner.java StandaloneSigningServlet.java
Log Message:
Lots of usability changes through out all the passphrase agents and end user tools.
Index: StandaloneSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone/StandaloneSigner.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** StandaloneSigner.java 16 Dec 2003 23:16:15 -0000 1.3
--- StandaloneSigner.java 19 Dec 2003 00:30:55 -0000 1.4
***************
*** 8,13 ****
--- 8,16 ----
import org.mortbay.util.InetAddrPort;
import org.mortbay.util.MultiException;
+ import org.neuclear.commons.crypto.CryptoTools;
+ import org.neuclear.id.tools.commandline.IdentityCreator;
import java.io.IOException;
+ import java.io.File;
***************
*** 20,38 ****
public class StandaloneSigner {
public static void main(String args[]){
! try {
! Server server = new Server();
! server.addListener(new InetAddrPort("127.0.0.1",11870));
! HttpContext context = server.getContext("/");
! ServletHandler handler= new ServletHandler();
! handler.addServlet("/Signer","org.neuclear.signers.standalone.StandaloneSigningServlet");
! context.addHandler(handler);
! server.start();
! context.start();
! handler.start();
! handler.initializeServlets();
! } catch (Exception e) {
! e.printStackTrace(); //To change body of catch statement use Options | File Templates.
}
-
}
}
--- 23,50 ----
public class StandaloneSigner {
public static void main(String args[]){
! if (args.length>0) {
! IdentityCreator.main(args);
! return;
! }
! File keystore=new File(CryptoTools.DEFAULT_KEYSTORE);
! if (!keystore.exists()) {
! System.out.println("First you need to create an Identity. Use this tool with the following options.\n For more help go to http://neuclear.org/signer/bdg.html");
! IdentityCreator.main(args);
! } else {
! try {
! Server server = new Server();
! server.addListener(new InetAddrPort("127.0.0.1",11870));
! HttpContext context = server.getContext("/");
! ServletHandler handler= new ServletHandler();
! handler.addServlet("/Signer","org.neuclear.signers.standalone.StandaloneSigningServlet");
! context.addHandler(handler);
! server.start();
! context.start();
! handler.start();
! handler.initializeServlets();
! } catch (Exception e) {
! e.printStackTrace(); //To change body of catch statement use Options | File Templates.
! }
}
}
}
Index: StandaloneSigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-signer/src/java/org/neuclear/signers/standalone/StandaloneSigningServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StandaloneSigningServlet.java 16 Dec 2003 23:16:15 -0000 1.2
--- StandaloneSigningServlet.java 19 Dec 2003 00:30:55 -0000 1.3
***************
*** 4,8 ****
--- 4,12 ----
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.DefaultSigner;
+ import org.neuclear.commons.crypto.signers.InvalidPassphraseException;
import org.neuclear.commons.crypto.passphraseagents.GuiDialogAgent;
+ import org.neuclear.commons.crypto.passphraseagents.InteractiveAgent;
+ import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
+ import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
***************
*** 27,32 ****
*/
public class StandaloneSigningServlet extends SigningServlet {
! protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException, IOException {
! return new DefaultSigner(new GuiDialogAgent());
}
--- 31,44 ----
*/
public class StandaloneSigningServlet extends SigningServlet {
! public StandaloneSigningServlet() {
! this.agent = new GuiDialogAgent();
! }
!
! protected Signer createSigner(ServletConfig config) throws CryptoException {
! try {
! return new DefaultSigner(agent);
! } catch (InvalidPassphraseException e) {
! return createSigner(config);
! }
}
***************
*** 35,39 ****
}
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
! if(!request.getRemoteAddr().equals("127.0.0.1"))
((HttpServletResponse)response).sendError(500,"No external access allowed");
super.service(request, response);
--- 47,51 ----
}
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
! if(!request.getRemoteAddr().equals("127.0.0.2"))
((HttpServletResponse)response).sendError(500,"No external access allowed");
super.service(request, response);
***************
*** 46,48 ****
--- 58,62 ----
}
+ private final InteractiveAgent agent;
+
}
|