|
From: <pe...@us...> - 2003-11-19 23:34:43
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/senders In directory sc8-pr-cvs1:/tmp/cvs-serv12836/src/java/org/neuclear/senders Modified Files: LogSender.java Sender.java SmtpSender.java SoapSender.java Log Message: Signers now can generatekeys via the generateKey() method. Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. SignedNamedObject now contains the full xml which is returned with getEncoded() This means that it is now possible to further send on or process a SignedNamedObject, leaving NamedObjectBuilder for its original purposes of purely generating new Contracts. NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. Updated all major interfaces that used the old model to use the new model. Index: LogSender.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/senders/LogSender.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LogSender.java 11 Nov 2003 21:18:43 -0000 1.10 --- LogSender.java 19 Nov 2003 23:33:59 -0000 1.11 *************** *** 1,13 **** package org.neuclear.senders; - import org.neuclear.id.SignedNamedObject; - import org.neuclear.id.Named; - import org.neuclear.id.builders.NamedObjectBuilder; - import org.neuclear.id.resolver.NSResolver; - import org.neuclear.commons.time.TimeTools; - import org.neuclear.commons.crypto.Base64; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; ! import org.neuclear.xml.xmlsec.XMLSecurityException; import java.io.BufferedReader; --- 1,9 ---- package org.neuclear.senders; import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; ! import org.neuclear.commons.crypto.Base64; ! import org.neuclear.commons.time.TimeTools; ! import org.neuclear.id.SignedNamedObject; import java.io.BufferedReader; *************** *** 26,29 **** --- 22,34 ---- * $Id$ * $Log$ + * Revision 1.11 2003/11/19 23:33:59 pelle + * Signers now can generatekeys via the generateKey() method. + * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. + * SignedNamedObject now contains the full xml which is returned with getEncoded() + * This means that it is now possible to further send on or process a SignedNamedObject, leaving + * NamedObjectBuilder for its original purposes of purely generating new Contracts. + * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. + * Updated all major interfaces that used the old model to use the new model. + * * Revision 1.10 2003/11/11 21:18:43 pelle * Further vital reshuffling. *************** *** 31,54 **** * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * * Revision 1.9 2003/11/09 03:27:19 pelle * More house keeping and shuffling about mainly pay ! * * Revision 1.8 2003/10/21 22:31:13 pelle * Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense. * Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy. * Obviously had to perform many changes throughout the code to support these changes. ! * * Revision 1.7 2003/09/29 23:17:32 pelle * Changes to the senders. Now the senders only work with NamedObjectBuilders * which are the only NamedObject representations that contain full XML. ! * * Revision 1.6 2003/09/26 23:53:10 pelle * Changes mainly in receiver and related fun. * First real neuclear stuff in the payment package. Added TransferContract and AssetControllerReceiver. ! * * Revision 1.5 2003/09/26 00:22:07 pelle * Cleanups and final changes to code for refactoring of the Verifier and Reader part. ! * * Revision 1.4 2003/09/24 23:56:48 pelle * Refactoring nearly done. New model for creating signed objects. --- 36,59 ---- * org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well. * Did a bit of work on the Canonicalizer and changed a few other minor bits. ! * <p/> * Revision 1.9 2003/11/09 03:27:19 pelle * More house keeping and shuffling about mainly pay ! * <p/> * Revision 1.8 2003/10/21 22:31:13 pelle * Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense. * Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy. * Obviously had to perform many changes throughout the code to support these changes. ! * <p/> * Revision 1.7 2003/09/29 23:17:32 pelle * Changes to the senders. Now the senders only work with NamedObjectBuilders * which are the only NamedObject representations that contain full XML. ! * <p/> * Revision 1.6 2003/09/26 23:53:10 pelle * Changes mainly in receiver and related fun. * First real neuclear stuff in the payment package. Added TransferContract and AssetControllerReceiver. ! * <p/> * Revision 1.5 2003/09/26 00:22:07 pelle * Cleanups and final changes to code for refactoring of the Verifier and Reader part. ! * <p/> * Revision 1.4 2003/09/24 23:56:48 pelle * Refactoring nearly done. New model for creating signed objects. *************** *** 56,84 **** * Currently still uses dom4j but that has been refactored out that it * should now be very quick to implement a xmlpull implementation. ! * * A side benefit of this is that the API has been further simplified. I still have some work * todo with regards to cleaning up some of the outlying parts of the code. ! * * Revision 1.3 2003/09/23 19:16:28 pelle * Changed NameSpace to Identity. * To cause less confusion in the future. ! * * Revision 1.2 2003/09/22 19:24:02 pelle * More fixes throughout to problems caused by renaming. ! * * Revision 1.1.1.1 2003/09/19 14:41:29 pelle * First import into the neuclear project. This was originally under the SF neuclear * project. This marks a general major refactoring and renaming ahead. ! * * The new name for this code is NeuClear Identity and has the general package header of * org.neuclear.id * There are other areas within the current code which will be split out into other subprojects later on. * In particularly the signers will be completely seperated out as well as the contract types. ! * ! * * Revision 1.2 2003/02/16 00:23:05 pelle * LogSender now works and there is a corresponding server side cgi script to do the logging in * http://neuclear.org/logger/ Site is not yet up but will be soon. ! * * Revision 1.1 2003/02/14 21:10:34 pelle * The email sender works. The LogSender and the SoapSender should work but havent been tested yet. --- 61,89 ---- * Currently still uses dom4j but that has been refactored out that it * should now be very quick to implement a xmlpull implementation. ! * <p/> * A side benefit of this is that the API has been further simplified. I still have some work * todo with regards to cleaning up some of the outlying parts of the code. ! * <p/> * Revision 1.3 2003/09/23 19:16:28 pelle * Changed NameSpace to Identity. * To cause less confusion in the future. ! * <p/> * Revision 1.2 2003/09/22 19:24:02 pelle * More fixes throughout to problems caused by renaming. ! * <p/> * Revision 1.1.1.1 2003/09/19 14:41:29 pelle * First import into the neuclear project. This was originally under the SF neuclear * project. This marks a general major refactoring and renaming ahead. ! * <p/> * The new name for this code is NeuClear Identity and has the general package header of * org.neuclear.id * There are other areas within the current code which will be split out into other subprojects later on. * In particularly the signers will be completely seperated out as well as the contract types. ! * <p/> ! * <p/> * Revision 1.2 2003/02/16 00:23:05 pelle * LogSender now works and there is a corresponding server side cgi script to do the logging in * http://neuclear.org/logger/ Site is not yet up but will be soon. ! * <p/> * Revision 1.1 2003/02/14 21:10:34 pelle * The email sender works. The LogSender and the SoapSender should work but havent been tested yet. *************** *** 86,93 **** * The Identity object also has a new method send() which allows one to send a named object to the Identity's * default receiver. - * */ public class LogSender extends Sender { ! public SignedNamedObject send(String endpoint, NamedObjectBuilder obj) throws NeuClearException { try { String digest = URLEncoder.encode(Base64.encode(obj.getDigest()), "UTF-8"); --- 91,97 ---- * The Identity object also has a new method send() which allows one to send a named object to the Identity's * default receiver. */ public class LogSender extends Sender { ! public SignedNamedObject send(String endpoint, SignedNamedObject obj) throws NeuClearException { try { String digest = URLEncoder.encode(Base64.encode(obj.getDigest()), "UTF-8"); *************** *** 105,110 **** } catch (IOException e) { Utility.rethrowException(e); - } catch (XMLSecurityException e) { - Utility.rethrowException(e); } return null;// --- 109,112 ---- *************** *** 150,154 **** public static Timestamp getTimeStamp(SignedNamedObject obj) throws NeuClearException { ! return getTimeStamp(Utility.denullString(obj.getSignatory().getLogger(), LOGGER), obj.getDigest().getBytes()); } --- 152,156 ---- public static Timestamp getTimeStamp(SignedNamedObject obj) throws NeuClearException { ! return getTimeStamp(Utility.denullString(obj.getSignatory().getLogger(), LOGGER), obj.getEncoded().getBytes()); } Index: Sender.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/senders/Sender.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Sender.java 11 Nov 2003 21:18:43 -0000 1.10 --- Sender.java 19 Nov 2003 23:33:59 -0000 1.11 *************** *** 8,11 **** --- 8,20 ---- * $Id$ * $Log$ + * Revision 1.11 2003/11/19 23:33:59 pelle + * Signers now can generatekeys via the generateKey() method. + * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. + * SignedNamedObject now contains the full xml which is returned with getEncoded() + * This means that it is now possible to further send on or process a SignedNamedObject, leaving + * NamedObjectBuilder for its original purposes of purely generating new Contracts. + * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. + * Updated all major interfaces that used the old model to use the new model. + * * Revision 1.10 2003/11/11 21:18:43 pelle * Further vital reshuffling. *************** *** 54,58 **** import org.neuclear.commons.NeuClearException; import org.neuclear.id.SignedNamedObject; - import org.neuclear.id.builders.NamedObjectBuilder; import org.neuclear.xml.XMLException; --- 63,66 ---- *************** *** 62,68 **** public abstract class Sender { ! public abstract SignedNamedObject send(String endpoint, NamedObjectBuilder obj) throws NeuClearException, XMLException; ! public static SignedNamedObject quickSend(String endpoint, NamedObjectBuilder obj) throws NeuClearException { int protloc = endpoint.indexOf(":"); if (protloc < 0) --- 70,76 ---- public abstract class Sender { ! public abstract SignedNamedObject send(String endpoint, SignedNamedObject obj) throws NeuClearException, XMLException; ! public static SignedNamedObject quickSend(String endpoint, SignedNamedObject obj) throws NeuClearException { int protloc = endpoint.indexOf(":"); if (protloc < 0) Index: SmtpSender.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/senders/SmtpSender.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SmtpSender.java 11 Nov 2003 21:18:43 -0000 1.12 --- SmtpSender.java 19 Nov 2003 23:33:59 -0000 1.13 *************** *** 8,11 **** --- 8,20 ---- * $Id$ * $Log$ + * Revision 1.13 2003/11/19 23:33:59 pelle + * Signers now can generatekeys via the generateKey() method. + * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. + * SignedNamedObject now contains the full xml which is returned with getEncoded() + * This means that it is now possible to further send on or process a SignedNamedObject, leaving + * NamedObjectBuilder for its original purposes of purely generating new Contracts. + * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. + * Updated all major interfaces that used the old model to use the new model. + * * Revision 1.12 2003/11/11 21:18:43 pelle * Further vital reshuffling. *************** *** 91,98 **** import org.neuclear.commons.NeuClearException; - import org.neuclear.id.SignedNamedObject; - import org.neuclear.id.builders.NamedObjectBuilder; import org.neuclear.commons.Utility; ! import org.neuclear.xml.XMLException; import javax.mail.*; --- 100,105 ---- import org.neuclear.commons.NeuClearException; import org.neuclear.commons.Utility; ! import org.neuclear.id.SignedNamedObject; import javax.mail.*; *************** *** 105,109 **** public class SmtpSender extends Sender { ! public SignedNamedObject send(String endpoint, NamedObjectBuilder obj) throws NeuClearException { Properties props = System.getProperties(); if (endpoint.startsWith("mailto:")) --- 112,116 ---- public class SmtpSender extends Sender { ! public SignedNamedObject send(String endpoint, SignedNamedObject obj) throws NeuClearException { Properties props = System.getProperties(); if (endpoint.startsWith("mailto:")) *************** *** 136,140 **** multi.addBodyPart(body); BodyPart objpart = new MimeBodyPart(); ! objpart.setText(obj.asXML()); objpart.setHeader("Content-type", "application/nsdl"); multi.addBodyPart(objpart); --- 143,147 ---- multi.addBodyPart(body); BodyPart objpart = new MimeBodyPart(); ! objpart.setText(obj.getEncoded()); objpart.setHeader("Content-type", "application/nsdl"); multi.addBodyPart(objpart); *************** *** 148,154 **** } catch (MessagingException e) { e.printStackTrace(); //To change body of catch statement use Options | File Templates. - Utility.rethrowException(e); - } catch (XMLException e) { - e.printStackTrace(); Utility.rethrowException(e); } --- 155,158 ---- Index: SoapSender.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/senders/SoapSender.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** SoapSender.java 11 Nov 2003 21:18:43 -0000 1.11 --- SoapSender.java 19 Nov 2003 23:33:59 -0000 1.12 *************** *** 8,11 **** --- 8,20 ---- * $Id$ * $Log$ + * Revision 1.12 2003/11/19 23:33:59 pelle + * Signers now can generatekeys via the generateKey() method. + * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit. + * SignedNamedObject now contains the full xml which is returned with getEncoded() + * This means that it is now possible to further send on or process a SignedNamedObject, leaving + * NamedObjectBuilder for its original purposes of purely generating new Contracts. + * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it. + * Updated all major interfaces that used the old model to use the new model. + * * Revision 1.11 2003/11/11 21:18:43 pelle * Further vital reshuffling. *************** *** 86,90 **** import org.neuclear.commons.NeuClearException; import org.neuclear.id.SignedNamedObject; - import org.neuclear.id.builders.NamedObjectBuilder; import org.neuclear.id.verifier.VerifyingReader; import org.neuclear.xml.XMLException; --- 95,98 ---- *************** *** 93,98 **** public class SoapSender extends Sender { ! public SignedNamedObject send(String endpoint, NamedObjectBuilder obj) throws NeuClearException, XMLException { ! return VerifyingReader.getInstance().read(SOAPTools.soapRequest(endpoint, obj.getElement(), "/receive")); } --- 101,106 ---- public class SoapSender extends Sender { ! public SignedNamedObject send(String endpoint, SignedNamedObject obj) throws NeuClearException, XMLException { ! return VerifyingReader.getInstance().read(SOAPTools.soapRequest(endpoint, obj.getEncoded(), "/receive")); } |