Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap In directory sc8-pr-cvs1:/tmp/cvs-serv10728/src/java/org/neuclear/xml/soap Modified Files: SOAPException.java SOAPServlet.java SOAPTools.java XMLInputStreamServlet.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: SOAPException.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPException.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SOAPException.java 11 Nov 2003 16:33:23 -0000 1.1.1.1 --- SOAPException.java 21 Nov 2003 04:44:30 -0000 1.2 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/21 04:44:30 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.1.1 2003/11/11 16:33:23 pelle * Moved over from neudist.org *************** *** 20,33 **** import org.neuclear.xml.XMLException; ! public class SOAPException extends XMLException{ ! public SOAPException(String message) { super(message); } ! public SOAPException(Throwable t) { super(t); } ! public SOAPException(String message, Throwable t) { super(message, t); } --- 26,39 ---- import org.neuclear.xml.XMLException; ! public final class SOAPException extends XMLException{ ! public SOAPException(final String message) { super(message); } ! public SOAPException(final Throwable t) { super(t); } ! public SOAPException(final String message, final Throwable t) { super(message, t); } Index: SOAPServlet.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPServlet.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SOAPServlet.java 11 Nov 2003 16:33:22 -0000 1.1.1.1 --- SOAPServlet.java 21 Nov 2003 04:44:30 -0000 1.2 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/21 04:44:30 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.1.1 2003/11/11 16:33:22 pelle * Moved over from neudist.org *************** *** 83,95 **** protected abstract Element handleSOAPRequest(Element request, String soapAction) throws SOAPException; ! protected void handleInputStream(InputStream is, HttpServletRequest request, HttpServletResponse response) throws IOException { try { ! SAXReader reader = new SAXReader(); ! Document doc = reader.read(is); System.out.println("RECEIVED:" + doc.asXML()); System.out.println("NEUDIST: SOAP Post Request to " + this.getClass().getName()); ! Element bodyElement = doc.getRootElement().element(DocumentHelper.createQName("Body", DocumentHelper.createNamespace("SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/"))); //TODO: Check for null ! Element requestElement = (Element) bodyElement.elements().get(0); if (requestElement == null) { System.out.println("NEUDIST: SOAP Request was invalid"); --- 89,101 ---- protected abstract Element handleSOAPRequest(Element request, String soapAction) throws SOAPException; ! protected final void handleInputStream(final InputStream is, final HttpServletRequest request, final HttpServletResponse response) throws IOException { try { ! final SAXReader reader = new SAXReader(); ! final Document doc = reader.read(is); System.out.println("RECEIVED:" + doc.asXML()); System.out.println("NEUDIST: SOAP Post Request to " + this.getClass().getName()); ! final Element bodyElement = doc.getRootElement().element(DocumentHelper.createQName("Body", DocumentHelper.createNamespace("SOAP-ENV", "http://schemas.xmlsoap.org/soap/envelope/"))); //TODO: Check for null ! final Element requestElement = (Element) bodyElement.elements().get(0); if (requestElement == null) { System.out.println("NEUDIST: SOAP Request was invalid"); *************** *** 109,116 **** DocumentHelper.createDocument(respElement); response.setContentType("text/xml"); ! OutputStream out = response.getOutputStream(); ! XMLWriter writer = new XMLWriter(out, OutputFormat.createCompactFormat()); writer.write(respElement); out.close(); --- 115,122 ---- DocumentHelper.createDocument(respElement); response.setContentType("text/xml"); ! final OutputStream out = response.getOutputStream(); ! final XMLWriter writer = new XMLWriter(out, OutputFormat.createCompactFormat()); writer.write(respElement); out.close(); Index: SOAPTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPTools.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SOAPTools.java 19 Nov 2003 23:33:16 -0000 1.2 --- SOAPTools.java 21 Nov 2003 04:44:30 -0000 1.3 *************** *** 1,4 **** --- 1,10 ---- /* $Id$ * $Log$ + * Revision 1.3 2003/11/21 04:44:30 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.2 2003/11/19 23:33:16 pelle * Signers now can generatekeys via the generateKey() method. *************** *** 111,118 **** import java.net.URLConnection; ! public class SOAPTools { ! public static Element soapRequestElement(String endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequestElement(new URL(endpoint), request, soapAction); --- 117,124 ---- import java.net.URLConnection; ! public final class SOAPTools { ! public static Element soapRequestElement(final String endpoint, final Element request, final String soapAction) throws NeuClearException { try { return soapRequestElement(new URL(endpoint), request, soapAction); *************** *** 122,126 **** } ! public static InputStream soapRequest(String endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); --- 128,132 ---- } ! public static InputStream soapRequest(final String endpoint, final String request, final String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); *************** *** 130,134 **** } ! public static Element soapRequestElement(URL endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequestElement(endpoint.openConnection(), request, soapAction); --- 136,140 ---- } ! public static Element soapRequestElement(final URL endpoint, final Element request, final String soapAction) throws NeuClearException { try { return soapRequestElement(endpoint.openConnection(), request, soapAction); *************** *** 139,143 **** } ! public static InputStream soapRequest(URL endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); --- 145,149 ---- } ! public static InputStream soapRequest(final URL endpoint, final String request, final String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); *************** *** 147,155 **** } ! public static InputStream soapRequest(URLConnection conn, Element request, String soapAction) throws NeuClearException { return soapRequest(conn, request.asXML(), soapAction); } ! public static InputStream soapRequest(URLConnection conn, String request, String soapAction) throws NeuClearException { try { //Set Headers --- 153,161 ---- } ! public static InputStream soapRequest(final URLConnection conn, final Element request, final String soapAction) throws NeuClearException { return soapRequest(conn, request.asXML(), soapAction); } ! public static InputStream soapRequest(final URLConnection conn, final String request, final String soapAction) throws NeuClearException { try { //Set Headers *************** *** 161,165 **** ((HttpURLConnection) conn).setRequestProperty("SOAPAction", soapAction); } ! OutputStream out = conn.getOutputStream(); out.write(SOAP_START); out.write(request.getBytes()); --- 167,171 ---- ((HttpURLConnection) conn).setRequestProperty("SOAPAction", soapAction); } ! final OutputStream out = conn.getOutputStream(); out.write(SOAP_START); out.write(request.getBytes()); *************** *** 172,187 **** } ! public static Element soapRequestElement(URLConnection conn, Element request, String soapAction) throws NeuClearException, IOException { try { ! BufferedReader in = new BufferedReader( new InputStreamReader( soapRequest(conn, request, soapAction) )); ! SAXReader reader = new SAXReader(); ! Document document = reader.read(in); in.close(); ! Element envelope = document.getRootElement(); if (envelope.getName().equals("Envelope")) { ! Element body = (Element) envelope.elements().get(0); if (body != null) { return (Element) body.elements().get(0); --- 178,193 ---- } ! public static Element soapRequestElement(final URLConnection conn, final Element request, final String soapAction) throws NeuClearException, IOException { try { ! final BufferedReader in = new BufferedReader( new InputStreamReader( soapRequest(conn, request, soapAction) )); ! final SAXReader reader = new SAXReader(); ! final Document document = reader.read(in); in.close(); ! final Element envelope = document.getRootElement(); if (envelope.getName().equals("Envelope")) { ! final Element body = (Element) envelope.elements().get(0); if (body != null) { return (Element) body.elements().get(0); Index: XMLInputStreamServlet.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/XMLInputStreamServlet.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** XMLInputStreamServlet.java 11 Nov 2003 16:33:23 -0000 1.1.1.1 --- XMLInputStreamServlet.java 21 Nov 2003 04:44:30 -0000 1.2 *************** *** 29,32 **** --- 29,38 ---- $Id$ $Log$ + Revision 1.2 2003/11/21 04:44:30 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.1.1 2003/11/11 16:33:23 pelle Moved over from neudist.org *************** *** 49,55 **** */ public abstract class XMLInputStreamServlet extends HttpServlet { ! protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); ! PrintWriter out = response.getWriter(); out.println("<html><head><title>SOAP Servlet</title></head><body>"); out.println("<h3>"); --- 55,61 ---- */ public abstract class XMLInputStreamServlet extends HttpServlet { ! protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); ! final PrintWriter out = response.getWriter(); out.println("<html><head><title>SOAP Servlet</title></head><body>"); out.println("<h3>"); *************** *** 63,69 **** } ! protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (request.getContentType().equals("text/xml")) { ! InputStream is = request.getInputStream(); handleInputStream(is, request, response); } --- 69,75 ---- } ! protected void doPost(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { if (request.getContentType().equals("text/xml")) { ! final InputStream is = request.getInputStream(); handleInputStream(is, request, response); } |