You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <pe...@us...> - 2003-12-14 20:53:07
|
Update of /cvsroot/neuclear/neuclear-id
In directory sc8-pr-cvs1:/tmp/cvs-serv18638
Modified Files:
project.xml
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: project.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/project.xml,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** project.xml 12 Dec 2003 21:37:08 -0000 1.22
--- project.xml 14 Dec 2003 20:53:04 -0000 1.23
***************
*** 4,8 ****
<name>NeuClear Identity Framework</name>
<id>neuclear-id</id>
! <currentVersion>0.8</currentVersion>
<inceptionYear>2002</inceptionYear>
<package>org.neuclear</package>
--- 4,8 ----
<name>NeuClear Identity Framework</name>
<id>neuclear-id</id>
! <currentVersion>0.8.1-SNAPSHOT</currentVersion>
<inceptionYear>2002</inceptionYear>
<package>org.neuclear</package>
***************
*** 80,84 ****
<id>neuclear-commons</id>
<name>neuclear-commons</name>
! <version>0.5</version>
<properties>
<war.bundle>true</war.bundle>
--- 80,84 ----
<id>neuclear-commons</id>
<name>neuclear-commons</name>
! <version>0.5.1-SNAPSHOT</version>
<properties>
<war.bundle>true</war.bundle>
***************
*** 110,113 ****
--- 110,116 ----
<id>jline</id>
<version>0.8.1</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
</dependency>
<dependency>
|
|
From: <pe...@us...> - 2003-12-14 20:53:07
|
Update of /cvsroot/neuclear/neuclear-id/src/webapp/WEB-INF
In directory sc8-pr-cvs1:/tmp/cvs-serv18638/src/webapp/WEB-INF
Modified Files:
web.xml
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: web.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/webapp/WEB-INF/web.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** web.xml 12 Dec 2003 23:45:41 -0000 1.6
--- web.xml 14 Dec 2003 20:53:04 -0000 1.7
***************
*** 5,11 ****
<web-app>
! <display-name>NeuDist WebApp</display-name>
<description>
! Storage System for Named Objects in Neubia
</description>
<filter>
--- 5,11 ----
<web-app>
! <display-name>NeuClear WebApp</display-name>
<description>
! Demo NeuClear Web app
</description>
<filter>
***************
*** 25,38 ****
<servlet-class>org.neuclear.signers.servlet.SigningServlet</servlet-class>
<init-param>
! <param-name>keystore</param-name>
! <param-value>/WEB-INF/testkeys.ks</param-value>
</init-param>
<init-param>
! <param-name>keystore.password</param-name>
! <param-value>neuclear</param-value>
</init-param>
<init-param>
! <param-name>title</param-name>
! <param-value>NeuClear Local Signer</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
--- 25,38 ----
<servlet-class>org.neuclear.signers.servlet.SigningServlet</servlet-class>
<init-param>
! <param-name>title</param-name>
! <param-value>NeuClear Local Signer</param-value>
</init-param>
<init-param>
! <param-name>keeppassphrase</param-name>
! <param-value>1</param-value>
</init-param>
<init-param>
! <param-name>passphraseagent</param-name>
! <param-value>gui</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
***************
*** 57,60 ****
--- 57,72 ----
<param-name>serviceid</param-name>
<param-value>neu://test</param-value>
+ </init-param>
+ <init-param>
+ <param-name>keystore</param-name>
+ <param-value></param-value>
+ </init-param>
+ <init-param>
+ <param-name>keeppassphrase</param-name>
+ <param-value>1</param-value>
+ </init-param>
+ <init-param>
+ <param-name>passphraseagent</param-name>
+ <param-value>gui</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
|
|
From: <pe...@us...> - 2003-12-14 20:53:07
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv18638/src/java/org/neuclear/signers/servlet
Modified Files:
DemoSigningServlet.java SigningServlet.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: DemoSigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/DemoSigningServlet.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** DemoSigningServlet.java 12 Dec 2003 19:28:03 -0000 1.13
--- DemoSigningServlet.java 14 Dec 2003 20:53:04 -0000 1.14
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.14 2003/12/14 20:53:04 pelle
+ * Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
+ * Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
+ * Init parameters in web.xml
+ * Updated SQLContext to use ThreadLocal
+ * Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
+ * Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
+ * configuration parameters in web.xml
+ *
* Revision 1.13 2003/12/12 19:28:03 pelle
* All the Cactus tests now for signing servlet.
***************
*** 163,166 ****
--- 172,176 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent;
+ import org.neuclear.commons.crypto.passphraseagents.ServletPassPhraseAgent;
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.TestCaseSigner;
***************
*** 175,203 ****
import java.security.GeneralSecurityException;
! public final class DemoSigningServlet extends SigningServlet implements PassPhraseAgent, SingleThreadModel {
protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException {
! passphrase = "neuclear";
! return new TestCaseSigner(this);
}
! protected synchronized void handleInputStream(InputStream is, HttpServletRequest request, HttpServletResponse response) throws IOException, NeuClearException, XMLException {
! passphrase = request.getParameter("passphrase");
super.handleInputStream(is, request, response);
! passphrase = null;
! }
!
! /**
! * Retrieve the PassPhrase for a given name/alias
! *
! * @param name
! * @return
! */
! public final char[] getPassPhrase(final String name) {
! if (passphrase == null)
! return null;
! return passphrase.toCharArray();
}
!
! private String passphrase;// Single Thread Model hack
}
--- 185,205 ----
import java.security.GeneralSecurityException;
! public final class DemoSigningServlet extends SigningServlet {
! public DemoSigningServlet(){
! agent=new ServletPassPhraseAgent();
! }
protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException {
! agent.set("neuclear");
! final TestCaseSigner signerd = new TestCaseSigner(agent);
! agent.clear();
! return signerd;
}
! protected void handleInputStream(InputStream is, HttpServletRequest request, HttpServletResponse response) throws IOException, NeuClearException, XMLException {
! agent.setRequest(request);
super.handleInputStream(is, request, response);
! agent.clear();
}
! private final ServletPassPhraseAgent agent;
}
Index: SigningServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/servlet/SigningServlet.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** SigningServlet.java 12 Dec 2003 19:28:03 -0000 1.20
--- SigningServlet.java 14 Dec 2003 20:53:04 -0000 1.21
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.21 2003/12/14 20:53:04 pelle
+ * Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
+ * Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
+ * Init parameters in web.xml
+ * Updated SQLContext to use ThreadLocal
+ * Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
+ * Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
+ * configuration parameters in web.xml
+ *
* Revision 1.20 2003/12/12 19:28:03 pelle
* All the Cactus tests now for signing servlet.
***************
*** 211,218 ****
import org.neuclear.commons.crypto.Base64;
import org.neuclear.commons.crypto.passphraseagents.GuiDialogAgent;
! import org.neuclear.commons.crypto.signers.DefaultSigner;
! import org.neuclear.commons.crypto.signers.InvalidPassphraseException;
! import org.neuclear.commons.crypto.signers.NonExistingSignerException;
! import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.servlets.ServletTools;
import org.neuclear.id.InvalidNamedObjectException;
--- 220,224 ----
import org.neuclear.commons.crypto.Base64;
import org.neuclear.commons.crypto.passphraseagents.GuiDialogAgent;
! import org.neuclear.commons.crypto.signers.*;
import org.neuclear.commons.servlets.ServletTools;
import org.neuclear.id.InvalidNamedObjectException;
***************
*** 233,236 ****
--- 239,243 ----
import java.io.InputStream;
import java.io.PrintWriter;
+ import java.io.FileNotFoundException;
import java.security.GeneralSecurityException;
***************
*** 256,260 ****
protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException, IOException {
! return new DefaultSigner(new GuiDialogAgent());
}
--- 263,267 ----
protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException, IOException {
! return ServletSignerFactory.getInstance().createSigner(config);
}
|
|
From: <pe...@us...> - 2003-12-14 20:53:07
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv18638/src/java/org/neuclear/receiver
Modified Files:
ReceiverServlet.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: ReceiverServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver/ReceiverServlet.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ReceiverServlet.java 12 Dec 2003 15:12:50 -0000 1.13
--- ReceiverServlet.java 14 Dec 2003 20:53:04 -0000 1.14
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.14 2003/12/14 20:53:04 pelle
+ * Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
+ * Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
+ * Init parameters in web.xml
+ * Updated SQLContext to use ThreadLocal
+ * Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
+ * Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
+ * configuration parameters in web.xml
+ *
* Revision 1.13 2003/12/12 15:12:50 pelle
* The ReceiverServletTest now passes.
***************
*** 107,110 ****
--- 116,121 ----
import org.dom4j.Element;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.crypto.signers.Signer;
+ import org.neuclear.commons.crypto.signers.ServletSignerFactory;
import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.verifier.VerifyingReader;
***************
*** 120,127 ****
--- 131,148 ----
import java.io.InputStream;
import java.io.PrintWriter;
+ import java.security.GeneralSecurityException;
public class ReceiverServlet extends XMLInputStreamServlet {
public void init(final ServletConfig config) throws ServletException {
super.init(config);
+ try {
+ signer=createSigner(config);
+ } catch (GeneralSecurityException e) {
+ e.printStackTrace(); //To change body of catch statement use Options | File Templates.
+ } catch (NeuClearException e) {
+ e.printStackTrace(); //To change body of catch statement use Options | File Templates.
+ } catch (IOException e) {
+ e.printStackTrace(); //To change body of catch statement use Options | File Templates.
+ }
}
***************
*** 155,159 ****
}
! public final void setReceiver(final Receiver receiver) {
this.receiver = receiver;
}
--- 176,180 ----
}
! protected final void setReceiver(final Receiver receiver) {
this.receiver = receiver;
}
***************
*** 162,167 ****
--- 183,195 ----
return receiver;
}
+ public Signer getSigner(){
+ return signer;
+ }
+ protected Signer createSigner(ServletConfig config) throws GeneralSecurityException, NeuClearException, IOException {
+ return ServletSignerFactory.getInstance().createSigner(config);
+ }
private Receiver receiver;
+ private Signer signer;
private static final Element OK = DocumentHelper.createElement("Status");
|
|
From: <pe...@us...> - 2003-12-14 20:53:07
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/auth
In directory sc8-pr-cvs1:/tmp/cvs-serv18638/src/java/org/neuclear/auth
Modified Files:
AuthenticationServlet.java
Added Files:
DemoAuthenticationServlet.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
--- NEW FILE: DemoAuthenticationServlet.java ---
package org.neuclear.auth;
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.TestCaseSigner;
import org.neuclear.commons.NeuClearException;
import javax.servlet.ServletConfig;
import java.io.FileNotFoundException;
import java.security.GeneralSecurityException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 12, 2003
* Time: 9:17:38 PM
* To change this template use Options | File Templates.
*/
public class DemoAuthenticationServlet extends AuthenticationServlet{
protected Signer createSigner(ServletConfig config) throws FileNotFoundException, GeneralSecurityException, NeuClearException {
return new TestCaseSigner();
}
}
Index: AuthenticationServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/auth/AuthenticationServlet.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** AuthenticationServlet.java 12 Dec 2003 21:13:16 -0000 1.8
--- AuthenticationServlet.java 14 Dec 2003 20:53:04 -0000 1.9
***************
*** 3,8 ****
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
! import org.neuclear.commons.crypto.signers.Signer;
! import org.neuclear.commons.crypto.signers.TestCaseSigner;
import org.neuclear.commons.servlets.ServletTools;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
--- 3,9 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
! import org.neuclear.commons.crypto.signers.*;
! import org.neuclear.commons.crypto.passphraseagents.*;
! import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.commons.servlets.ServletTools;
import org.neuclear.id.builders.AuthenticationTicketBuilder;
***************
*** 21,24 ****
--- 22,26 ----
import java.io.IOException;
import java.io.PrintWriter;
+ import java.io.FileNotFoundException;
import java.security.GeneralSecurityException;
***************
*** 43,48 ****
$Id$
$Log$
! Revision 1.8 2003/12/12 21:13:16 pelle
! I have now done manual testing of the SigningServlet et al and am happy releasing it to 0.8
Revision 1.7 2003/12/10 23:58:51 pelle
--- 45,56 ----
$Id$
$Log$
! Revision 1.9 2003/12/14 20:53:04 pelle
! Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
! Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
! Init parameters in web.xml
! Updated SQLContext to use ThreadLocal
! Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
! Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
! configuration parameters in web.xml
Revision 1.7 2003/12/10 23:58:51 pelle
***************
*** 86,90 ****
* Time: 2:04:31 PM
*/
! public final class AuthenticationServlet extends HttpServlet {
public final void init(final ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
--- 94,98 ----
* Time: 2:04:31 PM
*/
! public class AuthenticationServlet extends HttpServlet {
public final void init(final ServletConfig servletConfig) throws ServletException {
super.init(servletConfig);
***************
*** 93,105 ****
try {
! signer = new TestCaseSigner();
} catch (NeuClearException e) {
throw new ServletException(e);
} catch (GeneralSecurityException e) {
throw new ServletException(e);
}
}
!
protected final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
--- 101,117 ----
try {
! signer = createSigner(servletConfig);
} catch (NeuClearException e) {
throw new ServletException(e);
} catch (GeneralSecurityException e) {
throw new ServletException(e);
+ } catch (FileNotFoundException e) {
+ throw new ServletException(e);
}
}
! protected Signer createSigner(ServletConfig config) throws FileNotFoundException, GeneralSecurityException, NeuClearException {
! return ServletSignerFactory.getInstance().createSigner(config);
! }
protected final void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
***************
*** 143,147 ****
out.print(NSResolver.resolveIdentity(userns).getSigner());
out.write("\" method=\"POST\">\n ");
! out.write("<input name=\"neuclear-request\" value=\"");
out.print(XMLSecTools.encodeElementBase64(sigreq));
out.write("\" type=\"hidden\">\n ");
--- 155,159 ----
out.print(NSResolver.resolveIdentity(userns).getSigner());
out.write("\" method=\"POST\">\n ");
! out.write("<input name=\"base64xml\" value=\"");
out.print(XMLSecTools.encodeElementBase64(sigreq));
out.write("\" type=\"hidden\">\n ");
|
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons
In directory sc8-pr-cvs1:/tmp/cvs-serv18566
Modified Files:
project.xml
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: project.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/project.xml,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** project.xml 11 Dec 2003 23:56:28 -0000 1.16
--- project.xml 14 Dec 2003 20:52:55 -0000 1.17
***************
*** 4,8 ****
<name>NeuClear Commons</name>
<id>neuclear-commons</id>
! <currentVersion>0.5</currentVersion>
<inceptionYear>2003</inceptionYear>
<package>org.neuclear.commons</package>
--- 4,8 ----
<name>NeuClear Commons</name>
<id>neuclear-commons</id>
! <currentVersion>0.5.1-SNAPSHOT</currentVersion>
<inceptionYear>2003</inceptionYear>
<package>org.neuclear.commons</package>
|
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons/src/webapp/WEB-INF
In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/webapp/WEB-INF
Added Files:
web.xml
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
--- NEW FILE: web.xml ---
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<display-name>NeuClear Commons</display-name>
<description>
NeuClear Commons
</description>
</web-app>
|
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/test-cactus/org/neuclear/commons/crypto/signers
Added Files:
ServletSignerFactoryTest.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
--- NEW FILE: ServletSignerFactoryTest.java ---
package org.neuclear.commons.crypto.signers;
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
import org.neuclear.commons.NeuClearException;
import javax.servlet.ServletException;
import java.security.GeneralSecurityException;
import java.io.IOException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 14, 2003
* Time: 12:56:31 PM
* To change this template use Options | File Templates.
*/
public class ServletSignerFactoryTest extends ServletTestCase {
public ServletSignerFactoryTest(String string) throws GeneralSecurityException, NeuClearException {
super(string);
}
public void beginConfigDemo(WebRequest theRequest) throws GeneralSecurityException, NeuClearException {
theRequest.setURL("http://users.neuclear.org", "/test", "/Receiver",
null, null);
}
public void testConfigDemo() throws ServletException, IOException, GeneralSecurityException, NeuClearException {
config.setInitParameter("keystore","test");
config.setInitParameter("passphraseagent","servlet");
Signer signer=ServletSignerFactory.getInstance().createSigner(config);
assertTrue(signer instanceof TestCaseSigner);
assertEquals(signer, ServletSignerFactory.getInstance().createSigner(config));
}
public void beginConfigDefault(WebRequest theRequest) throws GeneralSecurityException, NeuClearException {
theRequest.setURL("http://users.neuclear.org", "/test", "/Receiver",
null, null);
}
public void testConfigDefault() throws ServletException, IOException, GeneralSecurityException, NeuClearException {
config.setInitParameter("keystore","");
config.setInitParameter("passphraseagent","gui");
Signer signer=ServletSignerFactory.getInstance().createSigner(config);
assertTrue(signer instanceof DefaultSigner);
assertEquals(signer, ServletSignerFactory.getInstance().createSigner(config));
}
}
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/test-cactus/org/neuclear/commons/crypto/passphraseagents
Added Files:
MockPassphraseServlet.java ServletPassPhraseAgentTest.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
--- NEW FILE: MockPassphraseServlet.java ---
package org.neuclear.commons.crypto.passphraseagents;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import java.io.IOException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 14, 2003
* Time: 2:06:29 PM
* To change this template use Options | File Templates.
*/
public class MockPassphraseServlet extends HttpServlet implements PassPhraseAgent{
public MockPassphraseServlet() {
this.agent = new ServletPassPhraseAgent();
}
protected void service(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException {
agent.setRequest(httpServletRequest);
}
public char[] getPassPhrase(String name) {
return agent.getPassPhrase(name); //To change body of implemented methods use Options | File Templates.
}
private ServletPassPhraseAgent agent;
}
--- NEW FILE: ServletPassPhraseAgentTest.java ---
package org.neuclear.commons.crypto.passphraseagents;
import org.apache.cactus.ServletTestCase;
import org.apache.cactus.WebRequest;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.signers.Signer;
import org.neuclear.commons.crypto.signers.ServletSignerFactory;
import org.neuclear.commons.crypto.signers.TestCaseSigner;
import javax.servlet.ServletException;
import java.security.GeneralSecurityException;
import java.io.IOException;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Dec 14, 2003
* Time: 2:04:24 PM
* To change this template use Options | File Templates.
*/
public class ServletPassPhraseAgentTest extends ServletTestCase {
public void beginGetPassphrase(WebRequest theRequest) throws GeneralSecurityException, NeuClearException {
theRequest.setURL("http://users.neuclear.org", "/test", "/Receiver",
null, null);
theRequest.addParameter("passphrase","test");
}
public void testGetPassphrase() throws ServletException, IOException, GeneralSecurityException, NeuClearException {
MockPassphraseServlet servlet=new MockPassphraseServlet();
servlet.init(config);
servlet.service(request,response);
assertNotNull(servlet.getPassPhrase("bla"));
assertEquals("test",new String(servlet.getPassPhrase("bla")));
}
public void beginNoPassphrase(WebRequest theRequest) throws GeneralSecurityException, NeuClearException {
theRequest.setURL("http://users.neuclear.org", "/test", "/Receiver",
null, null);
}
public void testNoPassphrase() throws ServletException, IOException, GeneralSecurityException, NeuClearException {
MockPassphraseServlet servlet=new MockPassphraseServlet();
servlet.init(config);
servlet.service(request,response);
assertNull(servlet.getPassPhrase("bla"));
}
}
|
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/test/org/neuclear/commons Removed Files: ThreadMapTest.java Log Message: Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer. Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets Init parameters in web.xml Updated SQLContext to use ThreadLocal Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above. Added use of the new features in neuclear-commons to the servilets within neuclear-id and added configuration parameters in web.xml --- ThreadMapTest.java DELETED --- |
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/java/org/neuclear/commons Removed Files: ThreadMap.java Log Message: Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer. Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets Init parameters in web.xml Updated SQLContext to use ThreadLocal Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above. Added use of the new features in neuclear-commons to the servilets within neuclear-id and added configuration parameters in web.xml --- ThreadMap.java DELETED --- |
|
From: <pe...@us...> - 2003-12-14 20:52:58
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/java/org/neuclear/commons/crypto/signers Modified Files: JCESigner.java TestCaseSigner.java Added Files: ServletSignerFactory.java Log Message: Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer. Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets Init parameters in web.xml Updated SQLContext to use ThreadLocal Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above. Added use of the new features in neuclear-commons to the servilets within neuclear-id and added configuration parameters in web.xml --- NEW FILE: ServletSignerFactory.java --- package org.neuclear.commons.crypto.signers; import org.neuclear.commons.Utility; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.crypto.CryptoTools; import org.neuclear.commons.crypto.passphraseagents.*; import javax.servlet.ServletConfig; import java.util.HashMap; import java.util.Map; import java.util.Collection; import java.util.Collections; import java.io.FileNotFoundException; import java.security.GeneralSecurityException; /** * Used to create Signers from servlet configuration parameters. It keeps a cache of Signers with similar parameters. Thus * if you have several Servlets with the same keystore parameters they will use the same instance of Signer<p> * The Configuration parameters are as follows: * <table border="2"><tr><th>parameter name</th><th>parameter value</th></tr> * <tr><td>keystore</td><td>The location of the JCE KeyStore. Defaults to the file .keystore in the users home directory * If you specify <tt>test</tt> the built in Test keystore will be used.</td></tr> * <tr><td>serviceid</td><td>The main service ID of the service. Ie. neu://superbux.com/ecurrency. This is only required (and used) * if you set <tt>keeppassphrase</tt> (see below)</td></tr> * <tr><td>passphraseagent</td><td>The type of passphraseagent to use. Valid options are <tt>servlet</tt>, * <tt>gui</tt> and <tt>console</tt>(default)</td></tr> * <tr><td>keeppassphrase</td><td>This asks for the service passphrase once at startup and remembers it through the lifetime of the servlet</td></tr> * </table> * <p> * To use the factory. Do as follows within your servlets init() method: * <code>Signer signer=ServletSignerFactory.getInstance().createSigner(config);</code> * * @see PassPhraseAgent * @see Signer */ public final class ServletSignerFactory { private ServletSignerFactory() { map=Collections.synchronizedMap(new HashMap()); } public synchronized Signer createSigner(ServletConfig config) throws FileNotFoundException, GeneralSecurityException, NeuClearException { final String keystore=config.getInitParameter("keystore"); final String keeppassphrase=config.getInitParameter("keeppassphrase"); final String agenttype=config.getInitParameter("passphraseagent"); final String serviceid = config.getInitParameter("serviceid"); final String hash = getConfigHash(keystore, keeppassphrase, agenttype,serviceid); if (map.containsKey(hash)) return (Signer)map.get(hash); final InteractiveAgent coreagent=getAgent(agenttype); final PassPhraseAgent agent=(!Utility.isEmpty(keeppassphrase)&&keeppassphrase.equals("1"))?(PassPhraseAgent)new AskAtStartupAgent(coreagent,serviceid):coreagent; // If keystore is "test" setup the TestCaseSigner otherwise use the JCESigner final Signer signer=createSigner(keystore, agent); map.put(hash,signer); return signer; } private JCESigner createSigner(final String keystore, final PassPhraseAgent agent) throws GeneralSecurityException, NeuClearException, FileNotFoundException { if (!Utility.isEmpty(keystore)){ if (keystore.toLowerCase().equals("test")) return new TestCaseSigner(agent); if (!keystore.toLowerCase().equals("default")) return new JCESigner(keystore,"jks", "SUN",agent); } return new DefaultSigner(agent); } private InteractiveAgent getAgent(final String agenttype) { if (!Utility.isEmpty(agenttype)){ if (agenttype.toLowerCase().equals("gui")) return new GuiDialogAgent(); if (agenttype.toLowerCase().equals("servlet")) return new ServletPassPhraseAgent(); } return new CommandLineAgent(); //The default DialogAgent } private static final String getConfigHash(final String keystore, final String keeppassphrase, final String agenttype,final String serviceid) { return new String(CryptoTools.digest((keystore+keeppassphrase+agenttype).getBytes())); } public synchronized static ServletSignerFactory getInstance(){ if (instance==null) instance=new ServletSignerFactory(); return instance; } private static ServletSignerFactory instance; final private Map map; } Index: JCESigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/JCESigner.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JCESigner.java 10 Dec 2003 23:55:45 -0000 1.9 --- JCESigner.java 14 Dec 2003 20:52:54 -0000 1.10 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.10 2003/12/14 20:52:54 pelle + * Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer. + * Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets + * Init parameters in web.xml + * Updated SQLContext to use ThreadLocal + * Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above. + * Added use of the new features in neuclear-commons to the servilets within neuclear-id and added + * configuration parameters in web.xml + * * Revision 1.9 2003/12/10 23:55:45 pelle * Did some cleaning up in the builders *************** *** 135,147 **** --- 144,205 ---- public class JCESigner implements org.neuclear.commons.crypto.signers.Signer, PublicKeySource { + /** + * Constructs a JCESigner with the agent providing the keystore passphrase. + * @param filename + * @param type + * @param provider + * @param agent + * @throws NeuClearException + * @throws GeneralSecurityException + * @throws FileNotFoundException + */ public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException, GeneralSecurityException, FileNotFoundException { this(filename, new FileInputStream(new File(filename)), type, provider, agent); } + /** + * Constructs a JCESigner providing a initial passphrase in the parameters. + * @param filename + * @param type + * @param provider + * @param agent + * @param initialpassphrase + * @throws NeuClearException + * @throws GeneralSecurityException + * @throws FileNotFoundException + */ + public JCESigner(final String filename, final String type, final String provider, final PassPhraseAgent agent,final char[] initialpassphrase) throws NeuClearException, GeneralSecurityException, FileNotFoundException { + this(filename, new FileInputStream(new File(filename)), type, provider, agent,initialpassphrase); + } + /** + * Constructs a JCESigner using the agent to provide the initial passphrase + * @param name + * @param in + * @param type + * @param provider + * @param agent + * @throws NeuClearException + */ protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent) throws NeuClearException { this(loadKeyStore(provider, type, in, agent, name), agent); } + /** + * Constructs a JCESigner using the provided Initial passphrase to load the keystore + * @param name + * @param in + * @param type + * @param provider + * @param agent + * @param initpassphrase + * @throws NeuClearException + */ + protected JCESigner(final String name, final InputStream in, final String type, final String provider, final PassPhraseAgent agent, final char[] initpassphrase) throws NeuClearException { + this(loadKeyStore(provider, type, in, initpassphrase), agent); + } private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final PassPhraseAgent agent, final String name) throws NeuClearException { + return loadKeyStore(provider,type,in,agent.getPassPhrase("Keystore password for: "+name)); + } + private static KeyStore loadKeyStore(final String provider, final String type, final InputStream in, final char[] passphrase) throws NeuClearException { try { KeyStore ki = null; *************** *** 150,154 **** else ki = KeyStore.getInstance(type, provider); ! ki.load(in, agent.getPassPhrase("KeyStore Passphrase for" + name)); // System.out.println("Successfully loaded JCESigner: " + name + " type: " + ki.getType() + " size: " + ki.size()); return ki; --- 208,212 ---- else ki = KeyStore.getInstance(type, provider); ! ki.load(in, passphrase); // System.out.println("Successfully loaded JCESigner: " + name + " type: " + ki.getType() + " size: " + ki.size()); return ki; Index: TestCaseSigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/TestCaseSigner.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TestCaseSigner.java 22 Nov 2003 00:22:52 -0000 1.7 --- TestCaseSigner.java 14 Dec 2003 20:52:54 -0000 1.8 *************** *** 29,32 **** --- 29,41 ---- $Id$ $Log$ + Revision 1.8 2003/12/14 20:52:54 pelle + Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer. + Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets + Init parameters in web.xml + Updated SQLContext to use ThreadLocal + Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above. + Added use of the new features in neuclear-commons to the servilets within neuclear-id and added + configuration parameters in web.xml + Revision 1.7 2003/11/22 00:22:52 pelle All unit tests in commons, id and xmlsec now work. *************** *** 104,108 **** in, "jks", "SUN", ! agent ); } --- 113,118 ---- in, "jks", "SUN", ! agent, ! "neuclear".toCharArray() ); } |
|
From: <pe...@us...> - 2003-12-14 20:52:57
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql
In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/java/org/neuclear/commons/sql
Modified Files:
SQLContext.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
Index: SQLContext.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/sql/SQLContext.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SQLContext.java 1 Dec 2003 15:44:53 -0000 1.1
--- SQLContext.java 14 Dec 2003 20:52:54 -0000 1.2
***************
*** 27,30 ****
--- 27,39 ----
$Id$
$Log$
+ Revision 1.2 2003/12/14 20:52:54 pelle
+ Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
+ Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
+ Init parameters in web.xml
+ Updated SQLContext to use ThreadLocal
+ Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
+ Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
+ configuration parameters in web.xml
+
Revision 1.1 2003/12/01 15:44:53 pelle
Added XAConnectionSources and Transaction capability through jotm.
***************
*** 37,44 ****
* The threads connection can be specifically closed with close()
*/
! public class SQLContext implements ConnectionSource{
public SQLContext(ConnectionSource source) {
this.source = source;
- this.map=new HashMap();
}
--- 46,52 ----
* The threads connection can be specifically closed with close()
*/
! public class SQLContext extends ThreadLocal implements ConnectionSource{
public SQLContext(ConnectionSource source) {
this.source = source;
}
***************
*** 50,59 ****
*/
public Connection getConnection() throws SQLException, IOException {
! Connection con= (Connection)map.get(Thread.currentThread());
! if (con==null||con.isClosed()){
! con=source.getConnection();
! map.put(Thread.currentThread(),con);
! }
! return con;
}
/**
--- 58,62 ----
*/
public Connection getConnection() throws SQLException, IOException {
! return (Connection)get();
}
/**
***************
*** 61,72 ****
* @throws SQLException
*/
! public void close() throws SQLException {
! Connection con= (Connection)map.get(Thread.currentThread());
! if (con!=null||!con.isClosed())
! map.remove(Thread.currentThread());
! con.close();
}
private final ConnectionSource source;
! private final Map map;
}
--- 64,82 ----
* @throws SQLException
*/
! public void close() throws SQLException, IOException {
! getConnection().close();
! set(null);
}
private final ConnectionSource source;
!
! protected Object initialValue() {
! try {
! return source.getConnection(); //To change body of overriden methods use Options | File Templates.
! } catch (SQLException e) {
! throw new org.neuclear.commons.LowLevelException(e);
! } catch (IOException e) {
! throw new org.neuclear.commons.LowLevelException(e);
! }
! }
}
|
|
From: <pe...@us...> - 2003-12-14 20:52:57
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents
In directory sc8-pr-cvs1:/tmp/cvs-serv18566/src/java/org/neuclear/commons/crypto/passphraseagents
Modified Files:
GuiDialogAgent.java
Added Files:
ServletPassPhraseAgent.java
Log Message:
Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
Init parameters in web.xml
Updated SQLContext to use ThreadLocal
Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
configuration parameters in web.xml
--- NEW FILE: ServletPassPhraseAgent.java ---
package org.neuclear.commons.crypto.passphraseagents;
import javax.servlet.http.HttpServletRequest;
/**
* PassPhraseAgent for use in server environments.
* You set the passphrase first by passing it a servlet request. It fetches the passphrase from the paramater "passphrase"<p>
* <b>WARNING</b> The sequence of events is very important for the safe usage of this. The following is an example within a
* standard <tt>doPost()</tt> method.
* <ol>
* <li><tt>agent.setRequest(request); // Set the request</tt>
* <li><tt>signer.sign(data);// Sign some data</tt>
* <li><tt>agent.clear();// The moment we have used the passphrase we have to clear it</tt>
* </ol>
* Note, the above assumes that a <tt>Signer</tt> with the name signer was initialised in <tt>init()</tt> with a
* <tt>ServletPassPhraseAgent</tt> called <tt>agent</tt>.
* @see org.neuclear.commons.crypto.signers.Signer
*/
public class ServletPassPhraseAgent extends ThreadLocal implements InteractiveAgent {
/**
* Set the passphrase from the request object.
* @param request
*/
public void setRequest(HttpServletRequest request){
set(request.getParameter("passphrase"));
}
/**
* Gets the passphrase if set or null
* @param name
* @return
*/
public char[] getPassPhrase(String name) {
return (get()==null?null:((String)get()).toCharArray());
}
/**
* Clears the passphrase. (Important, you have to manually call this at the end of the request code, or better yet
* immediately after using your Signer).
*/
public void clear(){
set(null);
}
}
Index: GuiDialogAgent.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/passphraseagents/GuiDialogAgent.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GuiDialogAgent.java 21 Nov 2003 04:43:41 -0000 1.2
--- GuiDialogAgent.java 14 Dec 2003 20:52:54 -0000 1.3
***************
*** 25,28 ****
--- 25,37 ----
$Id$
$Log$
+ Revision 1.3 2003/12/14 20:52:54 pelle
+ Added ServletPassPhraseAgent which uses ThreadLocal to transfer the passphrase to the signer.
+ Added ServletSignerFactory, which builds Signers for use within servlets based on parameters in the Servlets
+ Init parameters in web.xml
+ Updated SQLContext to use ThreadLocal
+ Added jakarta cactus unit tests to neuclear-commons to test the 2 new features above.
+ Added use of the new features in neuclear-commons to the servilets within neuclear-id and added
+ configuration parameters in web.xml
+
Revision 1.2 2003/11/21 04:43:41 pelle
EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 130,134 ****
public char[] getPassPhrase(final String name) {
! synchronized (passphrase) {
passphrase.setText("");
nameLabel.setText(name);
--- 139,143 ----
public char[] getPassPhrase(final String name) {
! synchronized (passphrase) {//We dont want multiple agents popping up at the same time
passphrase.setText("");
nameLabel.setText(name);
|
|
From: <pe...@us...> - 2003-12-14 18:43:42
|
Update of /cvsroot/neuclear/neuclear-commons/src/webapp/WEB-INF In directory sc8-pr-cvs1:/tmp/cvs-serv25844/src/webapp/WEB-INF Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/webapp/WEB-INF added to the repository |
|
From: <pe...@us...> - 2003-12-14 18:43:23
|
Update of /cvsroot/neuclear/neuclear-commons/src/webapp In directory sc8-pr-cvs1:/tmp/cvs-serv25797/src/webapp Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/webapp added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:58:31
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/passphraseagents In directory sc8-pr-cvs1:/tmp/cvs-serv17388/src/test-cactus/org/neuclear/commons/crypto/passphraseagents Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/passphraseagents added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:57:49
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/signers In directory sc8-pr-cvs1:/tmp/cvs-serv17249/src/test-cactus/org/neuclear/commons/crypto/signers Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto/signers added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:57:44
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto In directory sc8-pr-cvs1:/tmp/cvs-serv17217/src/test-cactus/org/neuclear/commons/crypto Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons/crypto added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:57:40
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons In directory sc8-pr-cvs1:/tmp/cvs-serv17197/src/test-cactus/org/neuclear/commons Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear/commons added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:57:35
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear In directory sc8-pr-cvs1:/tmp/cvs-serv17186/src/test-cactus/org/neuclear Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org/neuclear added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:57:30
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus/org In directory sc8-pr-cvs1:/tmp/cvs-serv17169/src/test-cactus/org Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus/org added to the repository |
|
From: <pe...@us...> - 2003-12-14 17:56:41
|
Update of /cvsroot/neuclear/neuclear-commons/src/test-cactus In directory sc8-pr-cvs1:/tmp/cvs-serv17028/src/test-cactus Log Message: Directory /cvsroot/neuclear/neuclear-commons/src/test-cactus added to the repository |
|
From: <pe...@us...> - 2003-12-12 23:58:19
|
Update of /cvsroot/neuclear/neuclear-xmlsig/xdocs/images In directory sc8-pr-cvs1:/tmp/cvs-serv11329/xdocs/images Added Files: logo.gif Log Message: Added missing logo to docs --- NEW FILE: logo.gif --- (This appears to be a binary file; contents omitted.) |
|
From: <pe...@us...> - 2003-12-12 23:54:31
|
Update of /cvsroot/neuclear/neuclear-xmlsig/xdocs/images In directory sc8-pr-cvs1:/tmp/cvs-serv10675/xdocs/images Log Message: Directory /cvsroot/neuclear/neuclear-xmlsig/xdocs/images added to the repository |