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-10-23 22:06:03
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/verifier In directory sc8-pr-cvs1:/tmp/cvs-serv25582/src/test/org/neuclear/id/verifier Modified Files: VerificationTest.java Log Message: Moved some certificates to live status at http://repository.neuclear.org Updated NSTools.url2path to support neuids with @ signs. Index: VerificationTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/verifier/VerificationTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** VerificationTest.java 21 Oct 2003 22:31:14 -0000 1.4 --- VerificationTest.java 23 Oct 2003 22:02:36 -0000 1.5 *************** *** 3,11 **** import junit.framework.TestCase; import org.dom4j.DocumentException; import org.neuclear.id.InvalidIdentityException; import org.neuclear.id.SignedNamedObject; import org.neudist.crypto.CryptoTools; import org.neudist.xml.XMLException; - import org.neuclear.commons.NeuClearException; import java.io.*; --- 3,11 ---- import junit.framework.TestCase; import org.dom4j.DocumentException; + import org.neuclear.commons.NeuClearException; import org.neuclear.id.InvalidIdentityException; import org.neuclear.id.SignedNamedObject; import org.neudist.crypto.CryptoTools; import org.neudist.xml.XMLException; import java.io.*; *************** *** 31,34 **** --- 31,38 ---- $Id$ $Log$ + Revision 1.5 2003/10/23 22:02:36 pelle + Moved some certificates to live status at http://repository.neuclear.org + Updated NSTools.url2path to support neuids with @ signs. + Revision 1.4 2003/10/21 22:31:14 pelle Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense. *************** *** 51,55 **** /** - * * User: pelleb * Date: Sep 27, 2003 --- 55,58 ---- *************** *** 65,68 **** --- 68,75 ---- public void testSimple() throws IOException, DocumentException, NeuClearException, XMLException { + runDirectoryTest("src/testdata/simple", true); + } + + public void testSimpleSecond() throws IOException, DocumentException, NeuClearException, XMLException { runDirectoryTest("src/testdata/simple", true); } |
|
From: <pe...@us...> - 2003-10-23 22:06:03
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id In directory sc8-pr-cvs1:/tmp/cvs-serv25582/src/java/org/neuclear/id Modified Files: NSTools.java Log Message: Moved some certificates to live status at http://repository.neuclear.org Updated NSTools.url2path to support neuids with @ signs. Index: NSTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/NSTools.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** NSTools.java 22 Oct 2003 23:16:00 -0000 1.10 --- NSTools.java 23 Oct 2003 22:02:36 -0000 1.11 *************** *** 2,5 **** --- 2,9 ---- * $Id$ * $Log$ + * Revision 1.11 2003/10/23 22:02:36 pelle + * Moved some certificates to live status at http://repository.neuclear.org + * Updated NSTools.url2path to support neuids with @ signs. + * * Revision 1.10 2003/10/22 23:16:00 pelle * Cleaned up some unused stuff in NSTools *************** *** 218,221 **** --- 222,229 ---- public static String url2path(String name) { if (!Utility.isEmpty(name)) { + Matcher matcher = STRIP_URI_ARROBA.matcher(name); + if (matcher.matches()) { + return "/" + matcher.group(3) + "/@" + matcher.group(2) + Utility.denullString(matcher.group(4)); + } int loc = name.indexOf("://"); if (loc >= 0) *************** *** 239,242 **** --- 247,254 ---- private static final Pattern VALID = Pattern.compile(VALID_ID); + private static final String STRIP_URI_ARROBA_EX = "^(neu:\\/)?" + + "\\/(" + VALID_TOKEN + ")@(" + VALID_TOKEN + ")([\\/\\w.]*)$"; + + private static final Pattern STRIP_URI_ARROBA = Pattern.compile(STRIP_URI_ARROBA_EX); } |
|
From: <pe...@us...> - 2003-10-23 22:05:57
|
Update of /cvsroot/neuclear/neuclear-id In directory sc8-pr-cvs1:/tmp/cvs-serv25582 Modified Files: project.xml Log Message: Moved some certificates to live status at http://repository.neuclear.org Updated NSTools.url2path to support neuids with @ signs. Index: project.xml =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/project.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** project.xml 22 Oct 2003 22:12:34 -0000 1.7 --- project.xml 23 Oct 2003 22:02:37 -0000 1.8 *************** *** 76,79 **** --- 76,88 ---- </properties> </dependency> + <dependency> + <id>neuclear-commons</id> + <name>neuclear-commons</name> + <version>0.3-SNAPSHOT</version> + <properties> + <war.bundle.jar>true</war.bundle.jar> + </properties> + </dependency> + <dependency> <id>commons-collections</id> |
|
From: <pe...@us...> - 2003-10-03 23:48:59
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv32670/src/java/org/neuclear/receiver
Modified Files:
Receiver.java
Added Files:
RawReceiver.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
--- NEW FILE: RawReceiver.java ---
package org.neuclear.receiver;
/**
* Created by IntelliJ IDEA.
* User: pelleb
* Date: Oct 10, 2002
* Time: 11:24:59 PM
* To change this template use Options | File Templates.
* $Id: RawReceiver.java,v 1.1 2003/10/03 23:48:51 pelle Exp $
* $Log: RawReceiver.java,v $
* Revision 1.1 2003/10/03 23:48:51 pelle
* Did various security related updates in the pay package with regards to immutability of fields etc.
* PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
* private key of the Receiver.
* A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
* TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
* TransferRequests for signing.
* TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*
* Revision 1.5 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 PaymentReceiver.
*
* Revision 1.4 2003/09/24 23:56:48 pelle
* Refactoring nearly done. New model for creating signed objects.
* With view for supporting the xmlpull api shortly for performance reasons.
* 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:49 pelle
* First import into the neuclear project. This was originally under the SF neudist
* 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.3 2003/02/18 14:57:19 pelle
* Finished Cleaning up Receivers and Stores.
* Also updated nsdl.xsd xml schema with latest changes.
* The whole API is now very simple.
*
*/
import org.neuclear.id.InvalidIdentityException;
import org.neuclear.id.builders.NamedObjectBuilder;
/**
* <p>The RawReceiver interface is the base interface for almost all applications based on the NeuDist Framework.
* You simply implement this to process the different types of NamedObjects.</p>
* <p>For a fully fledged application SubClass ReceiverServlet to handle an instance of your Receiver.</p>
*/
public interface RawReceiver {
/**
* Add your main transaction processing logic within this method.
* Remember you must check the validity of the SignedNamedObject here. Until you do so
* you can not trust it.
* @param obj
* @throws UnsupportedTransaction
*/
void receive(NamedObjectBuilder obj) throws UnsupportedTransaction, InvalidIdentityException;
}
Index: Receiver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/receiver/Receiver.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Receiver.java 26 Sep 2003 23:53:10 -0000 1.5
--- Receiver.java 3 Oct 2003 23:48:51 -0000 1.6
***************
*** 9,12 ****
--- 9,21 ----
* $Id$
* $Log$
+ * Revision 1.6 2003/10/03 23:48:51 pelle
+ * Did various security related updates in the pay package with regards to immutability of fields etc.
+ * PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
+ * private key of the Receiver.
+ * A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
+ * TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
+ * TransferRequests for signing.
+ * TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
+ *
* Revision 1.5 2003/09/26 23:53:10 pelle
* Changes mainly in receiver and related fun.
***************
*** 61,64 ****
* @throws UnsupportedTransaction
*/
! void receive(SignedNamedObject obj) throws UnsupportedTransaction;
}
--- 70,73 ----
* @throws UnsupportedTransaction
*/
! org.neudist.xml.ElementProxy receive(SignedNamedObject obj) throws UnsupportedTransaction;
}
|
|
From: <pe...@us...> - 2003-10-03 23:48:59
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source
In directory sc8-pr-cvs1:/tmp/cvs-serv32670/src/java/org/neuclear/source
Modified Files:
CachedSource.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
Index: CachedSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source/CachedSource.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** CachedSource.java 24 Sep 2003 23:56:49 -0000 1.3
--- CachedSource.java 3 Oct 2003 23:48:51 -0000 1.4
***************
*** 3,6 ****
--- 3,15 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/10/03 23:48:51 pelle
+ * Did various security related updates in the pay package with regards to immutability of fields etc.
+ * PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
+ * private key of the Receiver.
+ * A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
+ * TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
+ * TransferRequests for signing.
+ * TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
+ *
* Revision 1.3 2003/09/24 23:56:49 pelle
* Refactoring nearly done. New model for creating signed objects.
***************
*** 38,46 ****
package org.neuclear.source;
- import org.apache.commons.collections.LRUMap;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neudist.utils.NeudistException;
import java.util.Map;
--- 47,55 ----
package org.neuclear.source;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neudist.utils.NeudistException;
+ import java.util.HashMap;
import java.util.Map;
***************
*** 52,56 ****
public CachedSource(Source src) {
this.src = src;
! cache = new LRUMap(CACHE_SIZE);
}
--- 61,65 ----
public CachedSource(Source src) {
this.src = src;
! cache = new HashMap(CACHE_SIZE);
}
|
|
From: <pe...@us...> - 2003-10-03 23:48:59
|
Update of /cvsroot/neuclear/neuclear-id/src/testdata/fakes In directory sc8-pr-cvs1:/tmp/cvs-serv32670/src/testdata/fakes Added Files: pelle.id Log Message: Did various security related updates in the pay package with regards to immutability of fields etc. PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the private key of the Receiver. A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes. TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating TransferRequests for signing. TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver. --- NEW FILE: pelle.id --- <neuid:Identity xmlns:neuid="http://neudist.org/neu/neuid" neuid:name="neu://pelle" neuid:repository="http://repository.neuclear.org" neuid:logger="mailto:pe...@ne..." neuid:signer="http://localhost:11870/signer" neuid:receiver="mailto:pe...@ne..." neuid:timestamp="2003-10-02T16:32:26,041EST"><neuid:allow><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:KeyValue><ds:RSAKeyValue><ds:Modulus> vwTDvwNmqoGlI+GFNzBTmGzYLwEimuPaLgeMCpX67ksEQ2bjIUSmlErC+fFKzkglAbgR5cGzwu8E1E45M9nutStyLmPNj6iYhZA8ZXp4l2lEk7EdYpbw2E224jvF5KiU3YfPxNHv8p6uVlBTi5JKtbXlAasrqR414JXG8bFFjHEIlN4WrkVBSIMKQTDn6GHr3rz4fUd19DDHhsPIQexGOtNWJXrndHJe6zb/y31NT27yAPHslVTVXyzsTv/3/iryEtaCnAY00czoI4pyH2xZNBteujkvo9Vky2MX44EtkHX4HnAPFFQIcX/xQT3uZTWrDiUCDSKBukundNSecPmcdQ== </ds:Modulus><ds:Exponent> AQAB </ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo></neuid:allow><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue> G1pZcaMyOWnKsF3MuXzSIQz18Nc= </ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue> Pav8INxasuE5Fox69PpzgkTL7h6u6mfNq6v2rbprwiUQkgo6xxZBm1Wfu4PhpX2nHq9TkGuWYgo+Hjjbuq/di5GJQt5cwQv5J5fiF9jYYdYAZYBMgov+5Rl4ZYjdtrZ9rA2wMZVMPagINqFVwuJWTZREqx8/+rCPboMJK9QKFfvcb1e1bEdFUvhiPkbgQy1GmgFuM+h7iggfiXlLuA+gG2dBHhdv0gXtyq3UEhEi5sKTo+wwDeb699lAhyLA6FUln2eAOhK1Dzja4J14M/ujVACZUIEQTD5CkJFW6vd1FSH7BFhknyFW3HDtA8Jp773mFjIRLTmYv/hnGueIyRtJYQ== </ds:SignatureValue></ds:Signature></neuid:Identity> |
|
From: <pe...@us...> - 2003-10-03 23:48:59
|
Update of /cvsroot/neuclear/neuclear-id/src/testdata/simple In directory sc8-pr-cvs1:/tmp/cvs-serv32670/src/testdata/simple Added Files: pelle.id root.id Log Message: Did various security related updates in the pay package with regards to immutability of fields etc. PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the private key of the Receiver. A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes. TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating TransferRequests for signing. TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver. --- NEW FILE: pelle.id --- <neuid:Identity xmlns:neuid="http://neudist.org/neu/neuid" neuid:name="neu://pelle" neuid:repository="http://repository.neuclear.org" neuid:logger="mailto:pe...@ne..." neuid:signer="http://localhost:11870/signer" neuid:receiver="mailto:pe...@ne..." neuid:timestamp="2003-10-02T16:31:32,927EST"><neuid:allow><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:KeyValue><ds:RSAKeyValue><ds:Modulus> vwTDvwNmqoGlI+GFNzBTmGzYLwEimuPaLgeMCpX67ksEQ2bjIUSmlErC+fFKzkglAbgR5cGzwu8E1E45M9nutStyLmPNj6iYhZA8ZXp4l2lEk7EdYpbw2E224jvF5KiU3YfPxNHv8p6uVlBTi5JKtbXlAasrqR414JXG8bFFjHEIlN4WrkVBSIMKQTDn6GHr3rz4fUd19DDHhsPIQexGOtNWJXrndHJe6zb/y31NT27yAPHslVTVXyzsTv/3/iryEtaCnAY00czoI4pyH2xZNBteujkvo9Vky2MX44EtkHX4HnAPFFQIcX/xQT3uZTWrDiUCDSKBukundNSecPmcdQ== </ds:Modulus><ds:Exponent> AQAB </ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo></neuid:allow><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue> Wc/HhkSftkj1iAOeL0Z9jxrkkGo= </ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue> BpwDBVtlA3RzwGKhLb8cV2Nl4LNS0AA6IgrpFS1oexWdvOc4BeFM11rZQFUHWXR6PoY/7FaHzlID2fRZHXi85xIErzJqa4/Xgzrv7TmiX9tGa1IhKsAkp5GpW0PYYUWLZKl9+utQtFBlsivN3gDr/zQFqrxu3MI3TVMT+FegWHUjec0l83vuUvY0WTCZ5SI/z6Sf65ols4NLYSfEqibv365oErWiKGHOj5kQeGI64kSV30rf5CbcO6dWnWHbpsrhJ8Ks/sJQbiqIqKsy7hHUOdMfE9s7wXF4qNxvy7R40tddp66juqshsW5UkVhrYpDSMuCPCHFeoNTquGusLYnwOQ== </ds:SignatureValue></ds:Signature></neuid:Identity> --- NEW FILE: root.id --- <neuid:Identity xmlns:neuid="http://neudist.org/neu/neuid" neuid:name="neu://" neuid:repository="http://repository.neuclear.org" neuid:logger="mailto:pe...@ne..." neuid:signer="http://localhost:11870/signer" neuid:receiver="mailto:pe...@ne..." neuid:timestamp="2003-10-02T16:18:16,985EST"><neuid:allow><ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:KeyValue><ds:RSAKeyValue><ds:Modulus> pu/UOt9AKPt9txz/1TyYseL0vMUZXDxpz3PboE3X7J6r1UbfC9b45eO9SlD1wP52nCkVd5qL0fMOQV4lxP0KiL0DwCPid99YCXEn8BU4hEKLV3gD930ieFDtRhgDk7tcFzAqd6ilhVr3NENSjLRmlXK30qPmLRnDqhmx+UC7hLikhT6eJjDBatiYK4ESr2R5x/udIaJTSsenVA2zs1h2FcKXYExxJrPQBm0AXxguVlhqy+ImSjFQUEH9WOpr3zGLtXtcgawxtdapS8nwxbY38JR0HPloOWkFTC6XyurKr7TcDSrzgAUmJRy52pUvsqFRFcHxljL+Flv5iQS8TciKBQ== </ds:Modulus><ds:Exponent> AQAB </ds:Exponent></ds:RSAKeyValue></ds:KeyValue></ds:KeyInfo></neuid:allow><ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"><ds:SignedInfo><ds:CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315"/><ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/><ds:Reference URI=""><ds:Transforms><ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/></ds:Transforms><ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/><ds:DigestValue> 8fRZ8VdOIzFEMMSYKMNiI2UKOKM= </ds:DigestValue></ds:Reference></ds:SignedInfo><ds:SignatureValue> oR8qFWxbKki+G9LeNuCY3g3ku+Yd90AqrgSoSUTblfproRBXTAAm+GOLVmQ6WoSSIHOLGsea1lAuZK+QNVNSUxp5KU1GmlDnnAGrSZgh20mj+Wb57D1AxZidcAG2Kf1CzK+z5il1gYKTV9/TVvkCpKgel1UMykg4yFmFyP6IfmQPg53XEmhBVt6lrZkS08p/NbaAA3IDgsSWtLx1TZN1JpnCpF8hT5N7apw7Q57d96+2d4NrWwnR3aA+DIFoxUGtiNzounF18L4EIsNdGTo6j7bJoowwWgZoPIL0cNU9mnkadEMO0U3EJffUWqtE30YmIkzFcdlG7NnAGKVrGK3Z3g== </ds:SignatureValue></ds:Signature></neuid:Identity> |
|
From: <pe...@us...> - 2003-10-03 23:48:36
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/receiver
In directory sc8-pr-cvs1:/tmp/cvs-serv32588/src/java/org/neuclear/pay/receiver
Modified Files:
PaymentReceiver.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
Index: PaymentReceiver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/receiver/PaymentReceiver.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PaymentReceiver.java 26 Sep 2003 23:51:32 -0000 1.1
--- PaymentReceiver.java 3 Oct 2003 23:48:29 -0000 1.2
***************
*** 8,14 ****
--- 8,18 ----
import org.neuclear.pay.*;
import org.neuclear.pay.contracts.TransferContract;
+ import org.neuclear.pay.contracts.builders.TransferReceiptBuilder;
import org.neuclear.receiver.Receiver;
import org.neuclear.receiver.UnsupportedTransaction;
import org.neudist.utils.NeudistException;
+ import org.neudist.xml.ElementProxy;
+
+ import java.security.PrivateKey;
/*
***************
*** 43,46 ****
--- 47,51 ----
this.proc = proc;
this.asset = asset;
+ this.signer = null;
}
***************
*** 50,54 ****
* @throws UnsupportedTransaction
*/
! public void receive(SignedNamedObject obj) throws UnsupportedTransaction {
if (obj instanceof TransferContract) {
TransferContract transfer = (TransferContract) obj;
--- 55,59 ----
* @throws UnsupportedTransaction
*/
! public final ElementProxy receive(SignedNamedObject obj) throws UnsupportedTransaction {
if (obj instanceof TransferContract) {
TransferContract transfer = (TransferContract) obj;
***************
*** 59,62 ****
--- 64,70 ----
Account to = proc.getAccount(transfer.getName());
PaymentReceipt receipt = from.pay(to, transfer.getAmount(), transfer.getTimeStamp(), "transfer");
+ TransferReceiptBuilder sigReceipt = new TransferReceiptBuilder(receipt);
+ sigReceipt.sign(signer);
+ return sigReceipt;
//TODO do something with receipt
} catch (UnknownBookException e) {
***************
*** 75,83 ****
e.printStackTrace();
}
} else
throw new UnsupportedTransaction(obj);
}
! private PaymentProcessor proc;
! private String asset;
}
--- 83,94 ----
e.printStackTrace();
}
+
} else
throw new UnsupportedTransaction(obj);
+ return null;
}
! private final PaymentProcessor proc;
! private final String asset;
! private PrivateKey signer;
}
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/contracts/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv32588/src/java/org/neuclear/pay/contracts/builders
Added Files:
TransferBuilder.java TransferReceiptBuilder.java
TransferRequestBuilder.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
--- NEW FILE: TransferBuilder.java ---
package org.neuclear.pay.contracts.builders;
import org.dom4j.Element;
import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.pay.contracts.TransferGlobals;
/*
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: TransferBuilder.java,v 1.1 2003/10/03 23:48:29 pelle Exp $
$Log: TransferBuilder.java,v $
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*/
/**
*
* User: pelleb
* Date: Oct 3, 2003
* Time: 3:13:27 PM
*/
public class TransferBuilder extends NamedObjectBuilder {
protected TransferBuilder(String tagname, String name, String asset, String toaccount, double amount) {
super(name, TransferGlobals.createQName(tagname));
Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "recipient", toaccount));
element.add(TransferGlobals.createAttribute(element, "asset", asset));
element.add(TransferGlobals.createAttribute(element, "amount", Double.toString(amount)));
}
}
--- NEW FILE: TransferReceiptBuilder.java ---
package org.neuclear.pay.contracts.builders;
import org.dom4j.Element;
import org.neuclear.pay.PaymentReceipt;
import org.neuclear.pay.contracts.TransferGlobals;
/*
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: TransferReceiptBuilder.java,v 1.1 2003/10/03 23:48:29 pelle Exp $
$Log: TransferReceiptBuilder.java,v $
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*/
/**
*
* User: pelleb
* Date: Oct 3, 2003
* Time: 6:28:26 PM
*/
public class TransferReceiptBuilder extends TransferBuilder {
public TransferReceiptBuilder(PaymentReceipt receipt) {
super(TransferGlobals.XFER_RCPT_TAGNAME,
receipt.getId(),
receipt.getProc().getIssuerAccount().getID(),
receipt.getTo().getID(),
receipt.getAmount());
Element element = getElement();
element.add(TransferGlobals.createAttribute(element, "from", receipt.getFrom().getID()));
}
}
--- NEW FILE: TransferRequestBuilder.java ---
package org.neuclear.pay.contracts.builders;
import org.neuclear.pay.contracts.TransferGlobals;
/*
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: TransferRequestBuilder.java,v 1.1 2003/10/03 23:48:29 pelle Exp $
$Log: TransferRequestBuilder.java,v $
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*/
/**
*
* User: pelleb
* Date: Oct 3, 2003
* Time: 6:26:13 PM
*/
public class TransferRequestBuilder extends TransferBuilder {
public TransferRequestBuilder(String name, String asset, String toaccount, double amount) {
super(TransferGlobals.XFER_TAGNAME, name, asset, toaccount, amount);
}
}
|
|
From: <pe...@us...> - 2003-10-03 23:48:36
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/contracts
In directory sc8-pr-cvs1:/tmp/cvs-serv32588/src/java/org/neuclear/pay/contracts
Modified Files:
TransferContract.java
Added Files:
TransferGlobals.java TransferReceipt.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
--- NEW FILE: TransferGlobals.java ---
package org.neuclear.pay.contracts;
import org.dom4j.*;
/*
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: TransferGlobals.java,v 1.1 2003/10/03 23:48:29 pelle Exp $
$Log: TransferGlobals.java,v $
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*/
/**
*
* User: pelleb
* Date: Oct 3, 2003
* Time: 3:55:06 PM
*/
public final class TransferGlobals {
private TransferGlobals() {
// Instantiation is not allowed
}
public static Namespace createXferNameSpace() {
return DocumentHelper.createNamespace(XFER_NSPREFIX, XFER_NSURI);
}
public static QName createQName(String name) {
return DocumentHelper.createQName(name, createXferNameSpace());
}
public static Attribute createAttribute(Element elem, String name, String value) {
return DocumentHelper.createAttribute(elem, createQName(name), value);
}
public static Element createElement(String name, String value) {
return DocumentHelper.createElement(createQName(name));
}
public static final String XFER_TAGNAME = "TransferRequest";
public static final String XFER_RCPT_TAGNAME = "TransferReceipt";
public static final String XFER_NSPREFIX = "xfer";
public static final String XFER_NSURI = "http://neudist.org/neu/xfer";
}
--- NEW FILE: TransferReceipt.java ---
package org.neuclear.pay.contracts;
/*
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: TransferReceipt.java,v 1.1 2003/10/03 23:48:29 pelle Exp $
$Log: TransferReceipt.java,v $
Revision 1.1 2003/10/03 23:48:29 pelle
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
*/
/**
*
* User: pelleb
* Date: Oct 3, 2003
* Time: 2:00:28 PM
*/
public class TransferReceipt {
}
Index: TransferContract.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/contracts/TransferContract.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TransferContract.java 26 Sep 2003 23:51:32 -0000 1.1
--- TransferContract.java 3 Oct 2003 23:48:29 -0000 1.2
***************
*** 5,8 ****
--- 5,9 ----
import org.neuclear.id.NamedObjectReader;
import org.neuclear.id.SignedNamedObject;
+ import org.neuclear.receiver.UnsupportedTransaction;
import org.neudist.utils.NeudistException;
***************
*** 43,61 ****
}
! public double getAmount() {
return amount;
}
! public String getAsset() {
return asset;
}
! public String getRecipient() {
return toaccount;
}
! private double amount;
! private String toaccount;
! private String asset;
public static class Reader implements NamedObjectReader {
--- 44,62 ----
}
! public final double getAmount() {
return amount;
}
! public final String getAsset() {
return asset;
}
! public final String getRecipient() {
return toaccount;
}
! private final double amount;
! private final String toaccount;
! private final String asset;
public static class Reader implements NamedObjectReader {
***************
*** 66,69 ****
--- 67,74 ----
*/
public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeudistException {
+ if (!(elem.getName().equals(TransferGlobals.XFER_TAGNAME) &&
+ elem.getNamespaceURI().equals(TransferGlobals.XFER_NSURI)))
+ throw new UnsupportedTransaction(null);
+
double amount = Double.parseDouble(elem.attributeValue("amount"));
String asset = elem.attributeValue("asset");
|
|
From: <pe...@us...> - 2003-10-03 23:48:35
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay
In directory sc8-pr-cvs1:/tmp/cvs-serv32588/src/java/org/neuclear/pay
Modified Files:
Account.java HeldPaymentReceipt.java HeldPaymentRequest.java
Issuer.java Payment.java PaymentProcessor.java
PaymentReceipt.java PaymentRequest.java
Log Message:
Did various security related updates in the pay package with regards to immutability of fields etc.
PaymentReceiver should now be operational. Real testing needs to be done including in particular setting the
private key of the Receiver.
A new class TransferGlobals contains usefull settings for making life easier in the other contract based classes.
TransferContract the signed contract is functional and has a matching TransferRequestBuilder class for programmatically creating
TransferRequests for signing.
TransferReceiptBuilder has been created for use by Payment processors. It is used in the PaymentReceiver.
Index: Account.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/Account.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Account.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- Account.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 14,72 ****
public class Account {
! private Book book;
! private PaymentProcessor proc;
! Account(PaymentProcessor proc,Book book) {
! this.book=book;
! this.proc=proc;
}
! public PaymentProcessor getProc() {
return proc;
}
! Book getBook() {
return book;
}
! public String getID() {
return book.getBookID();
}
! public double getBalance() throws LowlevelLedgerException {
return book.getBalance();
}
! public double getAvailableBalance() throws LowlevelLedgerException {
return book.getAvailableBalance();
}
! public double getBalance(Date time) throws LowlevelLedgerException {
return book.getBalance(time);
}
! public double getAvailableBalance(Date time) throws LowlevelLedgerException {
return book.getAvailableBalance(time);
}
! public String getDisplayName() {
return book.getDisplayName();
}
final public PaymentReceipt pay(Account to, double amount, Date valuedate, String comment) throws UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, LowlevelLedgerException, NegativePaymentException, InsufficientFundsException {
! if ( amount < 0 )
throw new NegativePaymentException(proc, amount);
! if ( getAvailableBalance(valuedate) - amount < 0 )
throw new InsufficientFundsException(proc, this, amount);
!
return proc.processPayment(new PaymentRequest(this, to, amount, valuedate, comment));
}
! final public HeldPaymentReceipt hold(Account to, double amount, Date valuedate,Date helduntil, String comment) throws UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, LowlevelLedgerException, NegativePaymentException, InsufficientFundsException {
! if ( amount < 0 )
throw new NegativePaymentException(proc, amount);
! if ( getAvailableBalance(valuedate) - amount < 0 )
throw new InsufficientFundsException(proc, this, amount);
! return proc.processHeldPayment(new HeldPaymentRequest(this, to, amount, valuedate,helduntil, comment));
}
}
--- 14,73 ----
public class Account {
! private final Book book;
! private final PaymentProcessor proc;
! Account(PaymentProcessor proc, Book book) {
! this.book = book;
! this.proc = proc;
}
! public final PaymentProcessor getProc() {
return proc;
}
! final Book getBook() {
return book;
}
! final public String getID() {
return book.getBookID();
}
! final public double getBalance() throws LowlevelLedgerException {
return book.getBalance();
}
! final public double getAvailableBalance() throws LowlevelLedgerException {
return book.getAvailableBalance();
}
! final public double getBalance(Date time) throws LowlevelLedgerException {
return book.getBalance(time);
}
! final public double getAvailableBalance(Date time) throws LowlevelLedgerException {
return book.getAvailableBalance(time);
}
! final public String getDisplayName() {
return book.getDisplayName();
}
final public PaymentReceipt pay(Account to, double amount, Date valuedate, String comment) throws UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, LowlevelLedgerException, NegativePaymentException, InsufficientFundsException {
! if (amount < 0)
throw new NegativePaymentException(proc, amount);
! if (getAvailableBalance(valuedate) - amount < 0)
throw new InsufficientFundsException(proc, this, amount);
!
return proc.processPayment(new PaymentRequest(this, to, amount, valuedate, comment));
}
!
! final public HeldPaymentReceipt hold(Account to, double amount, Date valuedate, Date helduntil, String comment) throws UnknownBookException, UnBalancedTransactionException, InvalidTransactionException, LowlevelLedgerException, NegativePaymentException, InsufficientFundsException {
! if (amount < 0)
throw new NegativePaymentException(proc, amount);
! if (getAvailableBalance(valuedate) - amount < 0)
throw new InsufficientFundsException(proc, this, amount);
! return proc.processHeldPayment(new HeldPaymentRequest(this, to, amount, valuedate, helduntil, comment));
}
}
Index: HeldPaymentReceipt.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/HeldPaymentReceipt.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HeldPaymentReceipt.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- HeldPaymentReceipt.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 1,8 ****
package org.neuclear.pay;
- import org.neuclear.ledger.UnBalancedTransactionException;
- import org.neuclear.ledger.InvalidTransactionException;
import org.neuclear.ledger.LowlevelLedgerException;
- import org.neuclear.ledger.UnknownBookException;
import java.util.Date;
--- 1,5 ----
***************
*** 15,19 ****
*/
public class HeldPaymentReceipt extends PaymentReceipt implements Held {
! public Date getHeldUntil() {
return req.getHeldUntil();
}
--- 12,16 ----
*/
public class HeldPaymentReceipt extends PaymentReceipt implements Held {
! public final Date getHeldUntil() {
return req.getHeldUntil();
}
***************
*** 21,35 ****
public HeldPaymentReceipt(PaymentProcessor proc, HeldPaymentRequest preq, String id) {
super(proc, preq, id);
! req=preq;
}
! public void cancel() throws LowlevelLedgerException, ExpiredHeldPaymentException {
getProc().processCancelHold(this);
}
- public PaymentReceipt complete(Date valueDate,double amount, String comment) throws LowlevelLedgerException, PaymentNotStartedException, ExpiredHeldPaymentException, PaymentLargerThanHeldException, NegativePaymentException {
! return getProc().processCompleteHold(this,valueDate,amount,comment);
}
! private HeldPaymentRequest req;
}
--- 18,34 ----
public HeldPaymentReceipt(PaymentProcessor proc, HeldPaymentRequest preq, String id) {
super(proc, preq, id);
! req = preq;
}
! public final void cancel() throws LowlevelLedgerException, ExpiredHeldPaymentException {
getProc().processCancelHold(this);
}
! public final PaymentReceipt complete(Date valueDate, double amount, String comment) throws LowlevelLedgerException, PaymentNotStartedException, ExpiredHeldPaymentException, PaymentLargerThanHeldException, NegativePaymentException {
!
! return getProc().processCompleteHold(this, valueDate, amount, comment);
}
!
! private final HeldPaymentRequest req;
}
Index: HeldPaymentRequest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/HeldPaymentRequest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** HeldPaymentRequest.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- HeldPaymentRequest.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 10,23 ****
*/
public class HeldPaymentRequest extends PaymentRequest implements Held {
! public HeldPaymentRequest(Account from, Account to, double amount, Date valuedate,Date helduntil, String comment) throws NegativePaymentException {
super(from, to, amount, valuedate, comment);
! this.helduntil=helduntil;
}
! public Date getHeldUntil() {
return helduntil;
}
! private Date helduntil;
}
--- 10,24 ----
*/
public class HeldPaymentRequest extends PaymentRequest implements Held {
! public HeldPaymentRequest(Account from, Account to, double amount, Date valuedate, Date helduntil, String comment) throws NegativePaymentException {
super(from, to, amount, valuedate, comment);
! this.helduntil = helduntil;
}
! public final Date getHeldUntil() {
return helduntil;
}
!
! private final Date helduntil;
}
Index: Issuer.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/Issuer.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Issuer.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- Issuer.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 12,28 ****
*/
public class Issuer extends Account {
! Issuer(PaymentProcessor proc,Book book) {
! super(proc,book);
}
! public PaymentReceipt fundAccount(Account recipient,double amount,Date valueDate) throws UnknownBookException, UnBalancedTransactionException, LowlevelLedgerException, InvalidTransactionException,NegativePaymentException {
! return getProc().processPayment(new PaymentRequest(this,recipient,amount,valueDate,"Funding"));
}
! public double getCirculationBalance(Date date) throws LowlevelLedgerException {
return -getBook().getBalance(date);
}
! public double getCirculationBalance() throws LowlevelLedgerException {
return getCirculationBalance(new Date());
}
--- 12,28 ----
*/
public class Issuer extends Account {
! Issuer(PaymentProcessor proc, Book book) {
! super(proc, book);
}
! final public PaymentReceipt fundAccount(Account recipient, double amount, Date valueDate) throws UnknownBookException, UnBalancedTransactionException, LowlevelLedgerException, InvalidTransactionException, NegativePaymentException {
! return getProc().processPayment(new PaymentRequest(this, recipient, amount, valueDate, "Funding"));
}
! final public double getCirculationBalance(Date date) throws LowlevelLedgerException {
return -getBook().getBalance(date);
}
! final public double getCirculationBalance() throws LowlevelLedgerException {
return getCirculationBalance(new Date());
}
Index: Payment.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/Payment.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** Payment.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- Payment.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 10,14 ****
public abstract class Payment {
! protected Payment() {
}
--- 10,14 ----
public abstract class Payment {
! Payment() {
}
Index: PaymentProcessor.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/PaymentProcessor.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PaymentProcessor.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- PaymentProcessor.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 94,98 ****
}
! public Issuer getIssuerAccount() throws UnknownBookException, LowlevelLedgerException {
return issuerAccount;
}
--- 94,98 ----
}
! public Issuer getIssuerAccount() {
return issuerAccount;
}
***************
*** 131,136 ****
}
*/
! private Ledger ledger;
! private Issuer issuerAccount;
! private String title;
}
--- 131,136 ----
}
*/
! private final Ledger ledger;
! private final Issuer issuerAccount;
! private final String title;
}
Index: PaymentReceipt.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/PaymentReceipt.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PaymentReceipt.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- PaymentReceipt.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 10,44 ****
*/
public class PaymentReceipt extends Payment {
! private PaymentRequest preq;
! private String id;
! private PaymentProcessor proc;
! PaymentReceipt(PaymentProcessor proc,PaymentRequest preq,String id) {
! this.preq=preq;
! this.id=id;
! this.proc=proc;
}
! public double getAmount() {
return preq.getAmount();
}
! public Date getValuedate() {
return preq.getValuedate();
}
! public Account getTo() {
return preq.getTo();
}
! public Account getFrom() {
return preq.getFrom();
}
! public PaymentProcessor getProc() {
return proc;
}
! public String getId() {
return id;
}
--- 10,45 ----
*/
public class PaymentReceipt extends Payment {
! private final PaymentRequest preq;
! private final String id;
! private final PaymentProcessor proc;
! PaymentReceipt(PaymentProcessor proc, PaymentRequest preq, String id) {
! this.preq = preq;
! this.id = id;
! this.proc = proc;
}
! public final double getAmount() {
return preq.getAmount();
}
! public final Date getValuedate() {
return preq.getValuedate();
}
! public final Account getTo() {
return preq.getTo();
}
! public final Account getFrom() {
return preq.getFrom();
}
! public final PaymentProcessor getProc() {
return proc;
}
!
! public final String getId() {
return id;
}
Index: PaymentRequest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/PaymentRequest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** PaymentRequest.java 20 Sep 2003 23:12:40 -0000 1.1.1.1
--- PaymentRequest.java 3 Oct 2003 23:48:30 -0000 1.2
***************
*** 10,46 ****
*/
public class PaymentRequest extends Payment {
! private double amount;
! private Date valuedate;
! private Account to;
! private Account from;
! private String comment = "";
! public PaymentRequest( Account from, Account to, double amount, Date valuedate, String comment ) throws NegativePaymentException{
! if (amount<0)
throw new NegativePaymentException(from.getProc(), amount);
! this.from=from;
! this.to=to;
! this.amount=amount;
! this.valuedate=valuedate;
! this.comment = comment;
}
! public double getAmount() {
return amount;
}
! public Date getValuedate() {
return valuedate;
}
! public Account getTo() {
return to;
}
! public Account getFrom() {
return from;
}
!
! public String getComment() {
return comment;
}
--- 10,46 ----
*/
public class PaymentRequest extends Payment {
! private final double amount;
! private final Date valuedate;
! private final Account to;
! private final Account from;
! private final String comment;
! public PaymentRequest(Account from, Account to, double amount, Date valuedate, String comment) throws NegativePaymentException {
! if (amount < 0)
throw new NegativePaymentException(from.getProc(), amount);
! this.from = from;
! this.to = to;
! this.amount = amount;
! this.valuedate = valuedate;
! this.comment = (comment != null) ? comment : "";
}
! public final double getAmount() {
return amount;
}
! public final Date getValuedate() {
return valuedate;
}
! public final Account getTo() {
return to;
}
! public final Account getFrom() {
return from;
}
!
! public final String getComment() {
return comment;
}
|
|
From: <pe...@us...> - 2003-10-03 20:08:45
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/contracts/builders In directory sc8-pr-cvs1:/tmp/cvs-serv27999/src/java/org/neuclear/pay/contracts/builders Log Message: Directory /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/pay/contracts/builders added to the repository |
|
From: <pe...@us...> - 2003-10-02 23:29:15
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/java/org/neuclear/store/servlet
Modified Files:
StorageServlet.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: StorageServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/servlet/StorageServlet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** StorageServlet.java 22 Sep 2003 19:24:02 -0000 1.2
--- StorageServlet.java 2 Oct 2003 23:29:03 -0000 1.3
***************
*** 9,21 ****
package org.neuclear.store.servlet;
! import org.neuclear.receiver.ReceiverServlet;
import org.neuclear.store.FileStore;
import org.neuclear.store.Store;
import org.neudist.utils.Utility;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
! public class StorageServlet extends ReceiverServlet {
public void init(ServletConfig config) throws ServletException {
System.out.println("NEUDIST: Initialising StorageServlet");
--- 9,25 ----
package org.neuclear.store.servlet;
! import org.dom4j.DocumentHelper;
! import org.dom4j.Element;
! import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.store.FileStore;
import org.neuclear.store.Store;
import org.neudist.utils.Utility;
+ import org.neudist.xml.soap.SOAPException;
+ import org.neudist.xml.soap.SOAPServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
! public class StorageServlet extends SOAPServlet {
public void init(ServletConfig config) throws ServletException {
System.out.println("NEUDIST: Initialising StorageServlet");
***************
*** 24,30 ****
System.out.println("NEUDIST: Setting up store at: " + storePath);
store = new FileStore(storePath);
- setReceiver(store);
- }
private Store getStore() {
--- 28,33 ----
System.out.println("NEUDIST: Setting up store at: " + storePath);
store = new FileStore(storePath);
+ }
private Store getStore() {
***************
*** 33,36 ****
--- 36,50 ----
private Store store;
+
+ protected Element handleSOAPRequest(Element request, String soapAction) throws SOAPException {
+ try {
+ store.receive(new NamedObjectBuilder(request));
+ } catch (Exception e) {
+ Element error = DocumentHelper.createElement("Error");
+ error.setText(e.getMessage());
+ return error;
+ }
+ return request;
+ }
}
|
|
From: <pe...@us...> - 2003-10-02 23:29:14
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/test/org/neuclear/id
Modified Files:
NameSpaceTest.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: NameSpaceTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/NameSpaceTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** NameSpaceTest.java 29 Sep 2003 23:17:32 -0000 1.4
--- NameSpaceTest.java 2 Oct 2003 23:29:03 -0000 1.5
***************
*** 2,5 ****
--- 2,11 ----
$Id$
$Log$
+ Revision 1.5 2003/10/02 23:29:03 pelle
+ Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ Cleaned up much of the tests and they all pass now.
+ The FileStoreTests need to be rethought out, by adding a test key.
+
Revision 1.4 2003/09/29 23:17:32 pelle
Changes to the senders. Now the senders only work with NamedObjectBuilders
***************
*** 120,135 ****
package org.neuclear.id;
! import junit.framework.Test;
import junit.framework.TestCase;
- import junit.framework.TestSuite;
- import org.neuclear.store.Store;
- import org.neudist.utils.NeudistException;
- import org.neudist.utils.Utility;
- import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
! import java.security.*;
! import java.security.interfaces.RSAPrivateKey;
--- 126,137 ----
package org.neuclear.id;
!
import junit.framework.TestCase;
import java.io.FileNotFoundException;
import java.io.IOException;
! import java.security.GeneralSecurityException;
! import java.security.KeyPair;
! import java.security.PrivateKey;
***************
*** 137,141 ****
* @author Pelle Braendgaard
*/
! public class NameSpaceTest extends TestCase {
public NameSpaceTest(String string) {
--- 139,143 ----
* @author Pelle Braendgaard
*/
! public class NameSpaceTest extends TestCase {
public NameSpaceTest(String string) {
***************
*** 164,169 ****
* </ul>
*/
! protected void setUp() throws FileNotFoundException,GeneralSecurityException, IOException {
try {
//SignatureAlgorithm.providerInit();
--- 166,172 ----
* </ul>
*/
! protected void setUp() throws FileNotFoundException, GeneralSecurityException, IOException {
+ /*
try {
//SignatureAlgorithm.providerInit();
***************
*** 197,215 ****
// Utility.handleException(e);
}
}
! protected void tearDown() {
}
-
- private static void sleepabit() {
- try {
- Thread.currentThread().sleep(1000);
- } catch (InterruptedException e) {
- ; // You are a bad boy Pelle
- }
-
- }
KeyPair root;
--- 200,211 ----
// Utility.handleException(e);
}
+ */
}
! public void testGetRoot() {
! assertNotNull(Identity.NEUROOT);
}
KeyPair root;
|
|
From: <pe...@us...> - 2003-10-02 23:29:14
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/test/org/neuclear/store
Modified Files:
AbstractStoreTest.java EncryptedFileStoreTest.java
FileStoreTest.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: AbstractStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/AbstractStoreTest.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** AbstractStoreTest.java 24 Sep 2003 23:56:49 -0000 1.4
--- AbstractStoreTest.java 2 Oct 2003 23:29:03 -0000 1.5
***************
*** 2,5 ****
--- 2,11 ----
$Id$
$Log$
+ Revision 1.5 2003/10/02 23:29:03 pelle
+ Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ Cleaned up much of the tests and they all pass now.
+ The FileStoreTests need to be rethought out, by adding a test key.
+
Revision 1.4 2003/09/24 23:56:49 pelle
Refactoring nearly done. New model for creating signed objects.
***************
*** 100,103 ****
--- 106,110 ----
import junit.framework.TestCase;
import org.neuclear.id.InvalidIdentityException;
+ import org.neuclear.id.builders.IdentityBuilder;
import org.neudist.utils.NeudistException;
***************
*** 114,118 ****
public AbstractStoreTest(String name) throws GeneralSecurityException {
super(name);
! setUp();
}
--- 121,126 ----
public AbstractStoreTest(String name) throws GeneralSecurityException {
super(name);
! store = getStoreInstance();
! generateKeys();
}
***************
*** 121,129 ****
public abstract Store getStoreInstance();
- protected void setUp() throws GeneralSecurityException {
- store = getStoreInstance();
- generateKeys();
- }
-
protected static synchronized void generateKeys() throws GeneralSecurityException {
if (kg == null) {
--- 129,132 ----
***************
*** 147,172 ****
public void testStore() throws NeudistException, InvalidIdentityException {
System.out.println("\nTesting " + this.getClass().getName());
! // System.out.println("Storing "+rootName);
! // store.receive(new Identity(rootName,root,root.getPublic()));
! // System.out.println("Storing "+bobName);
! // store.receive(new Identity(bobName,root,bob.getPublic()));
! // System.out.println("Storing "+bobAliceName);
! // store.receive(new Identity(bobAliceName,bob,alice.getPublic()));
! // System.out.println("Storing "+eveName);
! // store.receive(new Identity(eveName,root,eve.getPublic()));
! // System.out.println("Fetching "+rootName);
! // SignedNamedObject nobj1=store.fetch(rootName);
! // assertEquals(NSTools.normalizeNameURI(rootName),nobj1.getName());
! // System.out.println("Fetching "+bobName);
! // SignedNamedObject nobj2=store.fetch(bobName);
! // assertEquals(NSTools.normalizeNameURI(bobName),nobj2.getName());
! //
! // System.out.println("Fetching "+bobAliceName);
! // SignedNamedObject nobj3=store.fetch(bobAliceName);
! // assertEquals(NSTools.normalizeNameURI(bobAliceName),nobj3.getName());
! //
! // System.out.println("Fetching "+eveName);
! // SignedNamedObject nobj4=store.fetch(eveName);
! // assertEquals(NSTools.normalizeNameURI(eveName),nobj4.getName());
}
--- 150,177 ----
public void testStore() throws NeudistException, InvalidIdentityException {
System.out.println("\nTesting " + this.getClass().getName());
! System.out.println("Storing " + rootName);
! store.receive(new IdentityBuilder(rootName, root.getPrivate(), root.getPublic()));
! System.out.println("Storing " + bobName);
! store.receive(new IdentityBuilder(bobName, root.getPrivate(), bob.getPublic()));
! System.out.println("Storing " + bobAliceName);
! store.receive(new IdentityBuilder(bobAliceName, bob.getPrivate(), alice.getPublic()));
! System.out.println("Storing " + eveName);
! store.receive(new IdentityBuilder(eveName, root.getPrivate(), eve.getPublic()));
! /* TODO: To complete this part I need to have a parent testkey in a keystore that is signed by root.
! System.out.println("Fetching "+rootName);
! SignedNamedObject nobj1=store.fetch(rootName);
! assertEquals(NSTools.normalizeNameURI(rootName),nobj1.getName());
! System.out.println("Fetching "+bobName);
! SignedNamedObject nobj2=store.fetch(bobName);
! assertEquals(NSTools.normalizeNameURI(bobName),nobj2.getName());
!
! System.out.println("Fetching "+bobAliceName);
! SignedNamedObject nobj3=store.fetch(bobAliceName);
! assertEquals(NSTools.normalizeNameURI(bobAliceName),nobj3.getName());
!
! System.out.println("Fetching "+eveName);
! SignedNamedObject nobj4=store.fetch(eveName);
! assertEquals(NSTools.normalizeNameURI(eveName),nobj4.getName());
! */
}
Index: EncryptedFileStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/EncryptedFileStoreTest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** EncryptedFileStoreTest.java 19 Sep 2003 14:41:54 -0000 1.1.1.1
--- EncryptedFileStoreTest.java 2 Oct 2003 23:29:03 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.1.1.1 2003/09/19 14:41:54 pelle
* First import into the neuclear project. This was originally under the SF neudist
***************
*** 34,69 ****
package org.neuclear.store;
- import junit.framework.Test;
- import junit.framework.TestSuite;
-
import java.security.GeneralSecurityException;
! public class EncryptedFileStoreTest extends AbstractStoreTest{
public EncryptedFileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
- public static void main (String[] args) {
- try {
- AbstractStoreTest test=new EncryptedFileStoreTest("Encrypted Test");
- test.setUp();
- test.testStore();
- } catch (Exception e) {
- // if (e instanceof NeudistException) {
- // ((NeudistException)e).getParcel().printStackTrace();
- // } else
- e.printStackTrace();
-
- }
- // junit.textui.TestRunner.run (suite());
- }
/**
*/
public Store getStoreInstance() {
! return new EncryptedFileStore("/home/java/projects/neuclear/build/tests/efs");
}
- public static Test suite() {
- return new TestSuite(EncryptedFileStoreTest.class);
- }
}
--- 40,55 ----
package org.neuclear.store;
import java.security.GeneralSecurityException;
! public class EncryptedFileStoreTest extends AbstractStoreTest {
public EncryptedFileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
/**
*/
public Store getStoreInstance() {
! return new EncryptedFileStore("target/neuclear/tests/efs");
}
}
Index: FileStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/store/FileStoreTest.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** FileStoreTest.java 19 Sep 2003 14:41:56 -0000 1.1.1.1
--- FileStoreTest.java 2 Oct 2003 23:29:03 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.1.1.1 2003/09/19 14:41:56 pelle
* First import into the neuclear project. This was originally under the SF neudist
***************
*** 37,76 ****
package org.neuclear.store;
- import junit.framework.Test;
- import junit.framework.TestSuite;
-
import java.security.GeneralSecurityException;
! public class FileStoreTest extends AbstractStoreTest{
! public FileStoreTest() throws GeneralSecurityException {
! super("FileStoreTest");
! }
public FileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
- public static void main (String[] args) {
- try {
- AbstractStoreTest test=new FileStoreTest();
- test.setUp();
- test.testStore();
- } catch (Exception e) {
- // if (e instanceof NeudistException) {
- // ((NeudistException)e).getParcel().printStackTrace();
- // } else
- e.printStackTrace();
-
- }
-
- // junit.textui.TestRunner.run (suite());
- }
/**
*/
public Store getStoreInstance() {
! return new FileStore("/home/java/projects/neuclear/build/tests/fs");
}
- public static Test suite() {
- return new TestSuite(FileStoreTest.class);
- }
}
--- 43,58 ----
package org.neuclear.store;
import java.security.GeneralSecurityException;
! public class FileStoreTest extends AbstractStoreTest {
public FileStoreTest(String name) throws GeneralSecurityException {
super(name);
}
/**
*/
public Store getStoreInstance() {
! return new FileStore("target/neuclear/tests/fs");
}
}
|
|
From: <pe...@us...> - 2003-10-02 23:29:14
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/java/org/neuclear/store
Modified Files:
FileStore.java Store.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: FileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/FileStore.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** FileStore.java 26 Sep 2003 00:22:07 -0000 1.5
--- FileStore.java 2 Oct 2003 23:29:03 -0000 1.6
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.6 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.5 2003/09/26 00:22:07 pelle
* Cleanups and final changes to code for refactoring of the Verifier and Reader part.
***************
*** 120,128 ****
//import org.neuclear.id.NSDLObject;
- import org.dom4j.Document;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
import org.neudist.utils.NeudistException;
- import org.neudist.xml.XMLTools;
import java.io.File;
--- 126,134 ----
//import org.neuclear.id.NSDLObject;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
+ import org.neuclear.id.builders.NamedObjectBuilder;
+ import org.neuclear.id.verifier.VerifyingReader;
import org.neudist.utils.NeudistException;
import java.io.File;
***************
*** 142,146 ****
}
! protected void rawStore(SignedNamedObject obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
--- 148,152 ----
}
! protected void rawStore(NamedObjectBuilder obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
***************
*** 154,158 ****
// }
! protected SignedNamedObject fetch(String name) throws NeudistException {
String inputFilename = base + getFileName(NSTools.normalizeNameURI(name));
System.out.println("Loading from: " + inputFilename);
--- 160,164 ----
// }
! SignedNamedObject fetch(String name) throws NeudistException {
String inputFilename = base + getFileName(NSTools.normalizeNameURI(name));
System.out.println("Loading from: " + inputFilename);
***************
*** 161,177 ****
return null;
- SignedNamedObject ns = null;
try {
! Document doc = XMLTools.loadDocument(new FileInputStream(fin));
! //TODO Find alternative ns = NamedObjectFactory.createNamedObject(doc);
! // System.out.println("NEUDIST: Fetched SignedNamedObject tag:"+rootName.getName()+" URI:"+rootName.getNamespaceURI());
! // } catch (ParserConfigurationException e) {
! // Utility.rethrowException(e);
} catch (FileNotFoundException e) {
e.printStackTrace();
! // Utility.rethrowException(e);
}
-
- return ns;
}
--- 167,176 ----
return null;
try {
! return VerifyingReader.getInstance().read(new FileInputStream(fin));
} catch (FileNotFoundException e) {
e.printStackTrace();
! return null;
}
}
***************
*** 186,190 ****
}
! protected static String getFileName(SignedNamedObject obj) throws NeudistException {
return getFileName(obj.getName());
// if (! (obj instanceof Identity))
--- 185,189 ----
}
! protected static String getFileName(NamedObjectBuilder obj) throws NeudistException {
return getFileName(obj.getName());
// if (! (obj instanceof Identity))
Index: Store.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/Store.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Store.java 26 Sep 2003 23:53:10 -0000 1.6
--- Store.java 2 Oct 2003 23:29:03 -0000 1.7
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.7 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.6 2003/09/26 23:53:10 pelle
* Changes mainly in receiver and related fun.
***************
*** 134,145 ****
package org.neuclear.store;
import org.neuclear.id.SignedNamedObject;
! import org.neuclear.receiver.Receiver;
! import org.neuclear.receiver.UnsupportedTransaction;
import org.neudist.utils.NeudistException;
import java.io.IOException;
! abstract public class Store implements Receiver {
//protected Store(Store store)
--- 140,154 ----
package org.neuclear.store;
+ import org.neuclear.id.InvalidIdentityException;
import org.neuclear.id.SignedNamedObject;
! import org.neuclear.id.builders.NamedObjectBuilder;
! import org.neuclear.receiver.RawReceiver;
import org.neudist.utils.NeudistException;
+ import org.neudist.xml.xmlsec.XMLSecurityException;
import java.io.IOException;
! abstract public class Store implements RawReceiver {
!
//protected Store(Store store)
***************
*** 148,167 ****
* This handles the Identity checking on the object.
*/
! public final void receive(SignedNamedObject obj) throws UnsupportedTransaction {
try {
// Dont allow overwrites
//TODO: Implement versioning
- // if (fetch(obj.getName())!=null)
- // throw new InvalidIdentityException("The name: "+obj.getName()+" already exists");
rawStore(obj);
!
if (next != null)
next.receive(obj);
} catch (IOException e) {
e.printStackTrace();
! } catch (NeudistException e) {
e.printStackTrace();
}
// if (e instanceof InvalidIdentityException)
--- 157,180 ----
* This handles the Identity checking on the object.
*/
! public final void receive(NamedObjectBuilder obj) throws InvalidIdentityException {
try {
// Dont allow overwrites
//TODO: Implement versioning
+ // if (obj.verifySignature(obj.getParent().getPublicKey()))
rawStore(obj);
! // else
! // throw new InvalidIdentityException("INVALID Signature");
if (next != null)
next.receive(obj);
+
} catch (IOException e) {
e.printStackTrace();
! } catch (XMLSecurityException e) {
e.printStackTrace();
+ } catch (NeudistException e) {
+ if (e instanceof InvalidIdentityException)
+ throw (InvalidIdentityException) e;
}
// if (e instanceof InvalidIdentityException)
***************
*** 177,184 ****
* Override this for each specific Store type
*/
! protected void rawStore(SignedNamedObject obj) throws IOException, NeudistException {
;
}
! private Receiver next;
}
--- 190,199 ----
* Override this for each specific Store type
*/
! protected void rawStore(NamedObjectBuilder obj) throws IOException, NeudistException {
;
}
! private RawReceiver next;
!
! abstract SignedNamedObject fetch(String name) throws NeudistException;
}
|
|
From: <pe...@us...> - 2003-10-02 23:29:13
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/java/org/neuclear/id/builders
Modified Files:
IdentityBuilder.java NamedObjectBuilder.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: IdentityBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/IdentityBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IdentityBuilder.java 1 Oct 2003 19:08:30 -0000 1.2
--- IdentityBuilder.java 2 Oct 2003 23:29:03 -0000 1.3
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.2 2003/10/01 19:08:30 pelle
* Changed XML Format. Now NameSpace has been modified to Identity also the
***************
*** 144,147 ****
--- 150,154 ----
import org.neudist.xml.xmlsec.XMLSecTools;
+ import java.security.PrivateKey;
import java.security.PublicKey;
***************
*** 185,188 ****
--- 192,200 ----
public IdentityBuilder(String name, PublicKey allow) throws NeudistException {
this(name, allow, null);
+ }
+
+ public IdentityBuilder(String name, PrivateKey signer, PublicKey allow) throws NeudistException {
+ this(name, allow);
+ sign(signer);
}
Index: NamedObjectBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/NamedObjectBuilder.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NamedObjectBuilder.java 1 Oct 2003 19:08:30 -0000 1.3
--- NamedObjectBuilder.java 2 Oct 2003 23:29:03 -0000 1.4
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/10/02 23:29:03 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.3 2003/10/01 19:08:30 pelle
* Changed XML Format. Now NameSpace has been modified to Identity also the
***************
*** 334,338 ****
public final void log() throws NeudistException {
Identity ns = getParent();
! Sender.quickSend(ns.getLogger(), this);
}
--- 340,345 ----
public final void log() throws NeudistException {
Identity ns = getParent();
! if (ns != null && ns.getLogger() != null)
! Sender.quickSend(ns.getLogger(), this);
}
|
|
From: <pe...@us...> - 2003-10-02 23:29:13
|
Update of /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/verifier In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/test/org/neuclear/id/verifier Modified Files: VerificationTest.java Log Message: Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key. VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it. Cleaned up much of the tests and they all pass now. The FileStoreTests need to be rethought out, by adding a test key. Index: VerificationTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/test/org/neuclear/id/verifier/VerificationTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** VerificationTest.java 30 Sep 2003 23:25:15 -0000 1.2 --- VerificationTest.java 2 Oct 2003 23:29:03 -0000 1.3 *************** *** 3,13 **** import junit.framework.TestCase; import org.dom4j.DocumentException; ! import org.dom4j.Document; ! import org.dom4j.io.SAXReader; ! import org.neudist.utils.NeudistException; ! import org.neudist.utils.RegexFileNameFilter; ! import org.neudist.xml.xmlsec.XMLSecTools; ! import org.neudist.crypto.CryptoTools; import org.neuclear.id.SignedNamedObject; import java.io.*; --- 3,10 ---- import junit.framework.TestCase; import org.dom4j.DocumentException; ! import org.neuclear.id.InvalidIdentityException; import org.neuclear.id.SignedNamedObject; + import org.neudist.crypto.CryptoTools; + import org.neudist.utils.NeudistException; import java.io.*; *************** *** 33,36 **** --- 30,39 ---- $Id$ $Log$ + Revision 1.3 2003/10/02 23:29:03 pelle + Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key. + VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it. + Cleaned up much of the tests and they all pass now. + The FileStoreTests need to be rethought out, by adding a test key. + Revision 1.2 2003/09/30 23:25:15 pelle Added new JCE Provider and java Certificate implementation for NeuClear Identity. *************** *** 52,63 **** super(string); CryptoTools.ensureProvider(); ! reader=VerifyingReader.getInstance(); } public void testSimple() throws IOException, DocumentException, NeudistException { ! runDirectoryTest("src/testdata/simple"); } ! public void runDirectoryTest(String path) throws DocumentException, IOException, FileNotFoundException, NeudistException { ! File dir=new File(path); if (!dir.exists()) { System.out.println("Doesnt exist"); --- 55,71 ---- super(string); CryptoTools.ensureProvider(); ! reader = VerifyingReader.getInstance(); } + public void testSimple() throws IOException, DocumentException, NeudistException { ! runDirectoryTest("src/testdata/simple", true); } ! public void testFakes() throws IOException, DocumentException, NeudistException { ! runDirectoryTest("src/testdata/fakes", false); ! } ! ! public void runDirectoryTest(String path, boolean wantValid) throws DocumentException, IOException, FileNotFoundException, NeudistException { ! File dir = new File(path); if (!dir.exists()) { System.out.println("Doesnt exist"); *************** *** 65,86 **** } FilenameFilter filter; ! filter=new FilenameFilter(){ public boolean accept(File dirf, String name) { ! return name.endsWith(".neu"); } }; ! File xmlfiles[]=dir.listFiles(filter); ! System.out.println("There are "+xmlfiles.length+" files in the directory"); for (int i = 0; i < xmlfiles.length; i++) { File xmlfile = xmlfiles[i]; ! System.out.print("Testing file: "+xmlfile.getName()+"... "); try { ! SignedNamedObject obj=reader.read(new FileInputStream(xmlfile)); ! System.out.println("Name : "+obj.getName()+" VERIFIED"); ! } catch (Exception e) { ! System.out.println("ERROR "+e.getMessage()); ! assertTrue(false); } } --- 73,96 ---- } FilenameFilter filter; ! filter = new FilenameFilter() { public boolean accept(File dirf, String name) { ! return name.endsWith(".id"); } }; ! File xmlfiles[] = dir.listFiles(filter); ! System.out.println("There are " + xmlfiles.length + " files in the directory"); for (int i = 0; i < xmlfiles.length; i++) { File xmlfile = xmlfiles[i]; ! System.out.print("Testing file: " + xmlfile.getName() + "... "); try { ! SignedNamedObject obj = reader.read(new FileInputStream(xmlfile)); ! System.out.println("Name : " + obj.getName() + " VERIFIED"); ! assertTrue(wantValid); ! ! } catch (InvalidIdentityException e) { ! System.out.println("INVALID " + e.getMessage()); ! assertTrue(!wantValid); } } |
|
From: <pe...@us...> - 2003-10-02 23:29:12
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv24957/src/java/org/neuclear/id
Modified Files:
Identity.java
Log Message:
Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
Cleaned up much of the tests and they all pass now.
The FileStoreTests need to be rethought out, by adding a test key.
Index: Identity.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Identity.java 1 Oct 2003 19:08:31 -0000 1.6
--- Identity.java 2 Oct 2003 23:29:02 -0000 1.7
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.7 2003/10/02 23:29:02 pelle
+ * Updated Root Key. This will be the root key for the remainder of the beta period. With version 1.0 I will update it with a new key.
+ * VerifyingTest works now and also does a pass for fake ones. Will have to think of better ways of making fake Identities to break it.
+ * Cleaned up much of the tests and they all pass now.
+ * The FileStoreTests need to be rethought out, by adding a test key.
+ *
* Revision 1.6 2003/10/01 19:08:31 pelle
* Changed XML Format. Now NameSpace has been modified to Identity also the
***************
*** 187,191 ****
public final class Identity extends SignedNamedObject {
! private static final String NSROOTPKMOD = "AKbv1DrfQCj7fbcc/9U8mLHi9LzFGVw8ac9z26BN1+yeq9VG3wvW+OXjvUpQ9cD+dpwpFXeai9Hz DkFeJcT9Coi9A8Aj4nffWAlxJ/AVOIRCi1d4A/d9InhQ7UYYA5O7XBcwKneopYVa9zRDUoy0ZpVy t9Kj5i0Zw6oZsflAu4S4pIU+niYwwWrYmCuBEq9kecf7nSGiU0rHp1QNs7NYdhXCl2BMcSaz0AZt AF8YLlZYasviJkoxUFBB/Vjqa98xi7V7XIGsMbXWqUvJ8MW2N/CUdBz5aDlpBUwul8rqyq+03A0q 84AFJiUcudqVL7KhURXB8ZYy/hZb+YkEvE3IigU=";
private static final String NSROOTPKEXP = "AQAB";
private static PublicKey nsrootpk;
--- 193,198 ----
public final class Identity extends SignedNamedObject {
! private static final String NSROOTPKMOD = "pu/UOt9AKPt9txz/1TyYseL0vMUZXDxpz3PboE3X7J6r1UbfC9b45eO9SlD1wP52nCkVd5qL0fMOQV4lxP0KiL0DwCPid99YCXEn8BU4hEKLV3gD930ieFDtRhgDk7tcFzAqd6ilhVr3NENSjLRmlXK30qPmLRnDqhmx+UC7hLikhT6eJjDBatiYK4ESr2R5x/udIaJTSsenVA2zs1h2FcKXYExxJrPQBm0AXxguVlhqy+ImSjFQUEH9WOpr3zGLtXtcgawxtdapS8nwxbY38JR0HPloOWkFTC6XyurKr7TcDSrzgAUmJRy52pUvsqFRFcHxljL+Flv5iQS8TciKBQ==";
! //private static final String NSROOTPKMOD = "AKbv1DrfQCj7fbcc/9U8mLHi9LzFGVw8ac9z26BN1+yeq9VG3wvW+OXjvUpQ9cD+dpwpFXeai9Hz DkFeJcT9Coi9A8Aj4nffWAlxJ/AVOIRCi1d4A/d9InhQ7UYYA5O7XBcwKneopYVa9zRDUoy0ZpVy t9Kj5i0Zw6oZsflAu4S4pIU+niYwwWrYmCuBEq9kecf7nSGiU0rHp1QNs7NYdhXCl2BMcSaz0AZt AF8YLlZYasviJkoxUFBB/Vjqa98xi7V7XIGsMbXWqUvJ8MW2N/CUdBz5aDlpBUwul8rqyq+03A0q 84AFJiUcudqVL7KhURXB8ZYy/hZb+YkEvE3IigU=";
private static final String NSROOTPKEXP = "AQAB";
private static PublicKey nsrootpk;
|
|
From: <pe...@us...> - 2003-10-02 23:12:18
|
Update of /cvsroot/neuclear/neuclear-id/src/testdata/fakes In directory sc8-pr-cvs1:/tmp/cvs-serv22191/src/testdata/fakes Log Message: Directory /cvsroot/neuclear/neuclear-id/src/testdata/fakes added to the repository |
|
From: <pe...@us...> - 2003-10-01 19:08:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv19838/src/java/org/neuclear/id
Modified Files:
Identity.java NSTools.java SignedNamedObject.java
Removed Files:
NSCommandLine.java
Log Message:
Changed XML Format. Now NameSpace has been modified to Identity also the
xml namespace prefix nsdl has been changed to neuid.
The standard constants for using these have been moved into NSTools.
The NamedObjectBuilder can also now take an Element, such as an unsigned template.
Index: Identity.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Identity.java 1 Oct 2003 17:05:37 -0000 1.5
--- Identity.java 1 Oct 2003 19:08:31 -0000 1.6
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.6 2003/10/01 19:08:31 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.5 2003/10/01 17:05:37 pelle
* Moved the NeuClearCertificate class to be an inner class of Identity.
***************
*** 164,167 ****
--- 170,177 ----
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
+ import org.neuclear.id.builders.NamedObjectBuilder;
+ import org.neuclear.id.resolver.NSResolver;
+ import org.neuclear.senders.Sender;
+ import org.neudist.crypto.CryptoTools;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
***************
*** 169,177 ****
import org.neudist.xml.xmlsec.XMLSecTools;
import org.neudist.xml.xmlsec.XMLSecurityException;
- import org.neudist.crypto.CryptoTools;
- import org.neudist.crypto.CryptoException;
- import org.neuclear.senders.Sender;
- import org.neuclear.id.resolver.NSResolver;
- import org.neuclear.id.builders.NamedObjectBuilder;
import java.security.*;
--- 179,182 ----
***************
*** 179,184 ****
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
- import java.util.Iterator;
- import java.util.List;
import java.sql.Timestamp;
--- 184,187 ----
***************
*** 209,215 ****
-
-
-
public String getRepository() {
return repository;
--- 212,215 ----
***************
*** 240,249 ****
}
! public PublicKey getPublicKey(){
return pub;
}
public Certificate getCertificate() {
return new NeuClearCertificate();
}
private final String repository;
private final String signer;
--- 240,251 ----
}
! public PublicKey getPublicKey() {
return pub;
}
+
public Certificate getCertificate() {
return new NeuClearCertificate();
}
+
private final String repository;
private final String signer;
***************
*** 256,262 ****
try {
! PublicKey rootpk=CryptoTools.createPK(NSROOTPKMOD, NSROOTPKEXP);
! return new Identity("neu://",null,new Timestamp(0),null,NSResolver.NSROOTSTORE,
! null,null,null,rootpk);
} catch (NeudistException e) {
e.printStackTrace();
--- 258,264 ----
try {
! PublicKey rootpk = CryptoTools.createPK(NSROOTPKMOD, NSROOTPKEXP);
! return new Identity("neu://", null, new Timestamp(0), null, NSResolver.NSROOTSTORE,
! null, null, null, rootpk);
} catch (NeudistException e) {
e.printStackTrace();
***************
*** 267,271 ****
}
! public static final Identity NEUROOT=createRootIdentity();
--- 269,273 ----
}
! public static final Identity NEUROOT = createRootIdentity();
***************
*** 318,326 ****
return pub;
}
public String toString() {
! return getName();
}
}
//TODO I dont like this being public
public final static class Reader implements NamedObjectReader {
--- 320,330 ----
return pub;
}
+
public String toString() {
! return getName();
}
}
+
//TODO I dont like this being public
public final static class Reader implements NamedObjectReader {
***************
*** 331,343 ****
*/
public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeudistException {
! String repository=elem.attributeValue(DocumentHelper.createQName("store",SignedNamedObject.NS_NSDL));
! String signer=elem.attributeValue(DocumentHelper.createQName("signer",SignedNamedObject.NS_NSDL));
! String logger=elem.attributeValue(DocumentHelper.createQName("logger",SignedNamedObject.NS_NSDL));
! String receiver=elem.attributeValue(DocumentHelper.createQName("receiver",SignedNamedObject.NS_NSDL));
! Element allowElement=elem.element(DocumentHelper.createQName("allow",SignedNamedObject.NS_NSDL));
! KeyInfo ki=new KeyInfo(allowElement.element(XMLSecTools.createQName("KeyInfo")));
! PublicKey pub=ki.getPublicKey();
! return new Identity(name,signatory,timestamp,digest,repository,signer,logger,receiver,pub);
}
--- 335,347 ----
*/
public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeudistException {
! String repository = elem.attributeValue(DocumentHelper.createQName("store", NSTools.NS_NEUID));
! String signer = elem.attributeValue(DocumentHelper.createQName("signer", NSTools.NS_NEUID));
! String logger = elem.attributeValue(DocumentHelper.createQName("logger", NSTools.NS_NEUID));
! String receiver = elem.attributeValue(DocumentHelper.createQName("receiver", NSTools.NS_NEUID));
! Element allowElement = elem.element(DocumentHelper.createQName("allow", NSTools.NS_NEUID));
! KeyInfo ki = new KeyInfo(allowElement.element(XMLSecTools.createQName("KeyInfo")));
! PublicKey pub = ki.getPublicKey();
! return new Identity(name, signatory, timestamp, digest, repository, signer, logger, receiver, pub);
}
Index: NSTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/NSTools.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** NSTools.java 26 Sep 2003 00:22:06 -0000 1.5
--- NSTools.java 1 Oct 2003 19:08:31 -0000 1.6
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.6 2003/10/01 19:08:31 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.5 2003/09/26 00:22:06 pelle
* Cleanups and final changes to code for refactoring of the Verifier and Reader part.
***************
*** 104,111 ****
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
import org.neudist.crypto.CryptoTools;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
- import org.neuclear.id.resolver.NSResolver;
import java.util.Random;
--- 110,119 ----
import org.apache.regexp.RE;
import org.apache.regexp.RESyntaxException;
+ import org.dom4j.DocumentHelper;
+ import org.dom4j.Namespace;
+ import org.neuclear.id.resolver.NSResolver;
import org.neudist.crypto.CryptoTools;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
import java.util.Random;
***************
*** 223,225 ****
--- 231,238 ----
}
}
+
+ public static final String NEUID_URI = "http://neudist.org/neu/neuid";
+ public static final Namespace NS_NEUID = DocumentHelper.createNamespace("neuid", NEUID_URI);
+
+ public static final String NEUID_PREFIX = "neuid:";
}
Index: SignedNamedObject.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedObject.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SignedNamedObject.java 1 Oct 2003 17:05:37 -0000 1.4
--- SignedNamedObject.java 1 Oct 2003 19:08:31 -0000 1.5
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.5 2003/10/01 19:08:31 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.4 2003/10/01 17:05:37 pelle
* Moved the NeuClearCertificate class to be an inner class of Identity.
***************
*** 151,157 ****
package org.neuclear.id;
- import org.dom4j.DocumentHelper;
import org.dom4j.Element;
- import org.dom4j.Namespace;
import org.neudist.utils.NeudistException;
--- 157,161 ----
***************
*** 163,171 ****
public class SignedNamedObject implements SignedObject, Named {
! protected SignedNamedObject(String name, Identity signer,Timestamp timestamp,String digest) throws NeudistException {
! this.name=NSTools.normalizeNameURI(name);
! this.signer=signer;
! this.timestamp=timestamp;
! this.digest=digest;
}
--- 167,175 ----
public class SignedNamedObject implements SignedObject, Named {
! protected SignedNamedObject(String name, Identity signer, Timestamp timestamp, String digest) throws NeudistException {
! this.name = NSTools.normalizeNameURI(name);
! this.signer = signer;
! this.timestamp = timestamp;
! this.digest = digest;
}
***************
*** 182,186 ****
* @return Parent Name
*/
! public String getLocalName() {
String fullName = getName();
int i = fullName.lastIndexOf('/');
--- 186,190 ----
* @return Parent Name
*/
! public String getLocalName() {
String fullName = getName();
int i = fullName.lastIndexOf('/');
***************
*** 189,193 ****
-
public Timestamp getTimeStamp() throws NeudistException {
return timestamp;
--- 193,196 ----
***************
*** 210,213 ****
--- 213,217 ----
return digest;
}
+
private final String name;
private final Identity signer;
***************
*** 223,234 ****
public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeudistException {
! return new SignedNamedObject(name,signatory,timestamp,digest);
}
}
- public static final String NSDL_NAMESPACE="http://neudist.org/neu/nsdl";
- public static final Namespace NS_NSDL=DocumentHelper.createNamespace("nsdl",NSDL_NAMESPACE);
-
- public static final String NSDL_PREFIX="nsdl:";
}
--- 227,234 ----
public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeudistException {
! return new SignedNamedObject(name, signatory, timestamp, digest);
}
}
}
--- NSCommandLine.java DELETED ---
|
|
From: <pe...@us...> - 2003-10-01 19:08:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv19838/src/java/org/neuclear/id/builders
Modified Files:
IdentityBuilder.java NamedObjectBuilder.java
TargetReference.java
Log Message:
Changed XML Format. Now NameSpace has been modified to Identity also the
xml namespace prefix nsdl has been changed to neuid.
The standard constants for using these have been moved into NSTools.
The NamedObjectBuilder can also now take an Element, such as an unsigned template.
Index: IdentityBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/IdentityBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** IdentityBuilder.java 27 Sep 2003 19:23:11 -0000 1.1
--- IdentityBuilder.java 1 Oct 2003 19:08:30 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/01 19:08:30 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.1 2003/09/27 19:23:11 pelle
* Added Builders to create named objects from scratch.
***************
*** 132,186 ****
import org.dom4j.Element;
import org.dom4j.QName;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
- import org.neudist.xml.xmlsec.KeyInfo;
import org.neudist.xml.xmlsec.XMLSecTools;
import java.security.PublicKey;
- import java.util.Iterator;
- import java.util.List;
! public final class IdentityBuilder extends NamedObjectBuilder {
! /**
! * This constructor should be used by subclasses of NameSpace. It creates a Standard NameSpace document, but doesn't sign it.
! * The signing should be done as the last step of the constructor of the subclass.
! * @param name The Name of NameSpace
! * @param allow PublicKey allowed to sign in here
! * @param repository URL of Default Store for NameSpace. (Note. A NameSpace object is stored in the default repository of it's parent namespace)
! * @param signer URL of default interactive signing service for namespace. If null it doesnt allow interactive signing
! * @param receiver URL of default receiver for namespace
! * @throws NeudistException
! */
! public IdentityBuilder(String name,PublicKey allow,String repository,String signer,String logger,String receiver) throws NeudistException {
! super(name,"NameSpace");
! Element root=getElement();
! // We have meaningful defaults for the following two
! root.addAttribute(DocumentHelper.createQName("repository",NamedObjectBuilder.NS_NSDL),repository);
! root.addAttribute(DocumentHelper.createQName("logger",NamedObjectBuilder.NS_NSDL),receiver);
! if (!Utility.isEmpty(signer))
! root.addAttribute(DocumentHelper.createQName("signer",NamedObjectBuilder.NS_NSDL),signer);
! if (!Utility.isEmpty(receiver))
! root.addAttribute(DocumentHelper.createQName("receiver",NamedObjectBuilder.NS_NSDL),receiver);
! if (allow!=null) {
! QName allowName=DocumentHelper.createQName("allow",NamedObjectBuilder.NS_NSDL);
! Element pub=root.addElement(allowName);
! pub.add(XMLSecTools.createKeyInfo(allow));
! }
}
! public IdentityBuilder(String name,PublicKey allow,String repository) throws NeudistException {
! this(name,allow,repository,null,null,null);
}
- public IdentityBuilder(String name,PublicKey allow) throws NeudistException {
- this(name,allow,null);
- }
public String getTagName() {
! return "NameSpace";
}
}
--- 138,202 ----
import org.dom4j.Element;
import org.dom4j.QName;
+ import org.neuclear.id.Identity;
+ import org.neuclear.id.NSTools;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
import org.neudist.xml.xmlsec.XMLSecTools;
import java.security.PublicKey;
! public final class IdentityBuilder extends NamedObjectBuilder {
! /**
! * This constructor should be used by subclasses of NameSpace. It creates a Standard NameSpace document, but doesn't sign it.
! * The signing should be done as the last step of the constructor of the subclass.
! * @param name The Name of NameSpace
! * @param allow PublicKey allowed to sign in here
! * @param repository URL of Default Store for NameSpace. (Note. A NameSpace object is stored in the default repository of it's parent namespace)
! * @param signer URL of default interactive signing service for namespace. If null it doesnt allow interactive signing
! * @param receiver URL of default receiver for namespace
! * @throws NeudistException
! */
! public IdentityBuilder(String name, PublicKey allow, String repository, String signer, String logger, String receiver) throws NeudistException {
! super(name, "Identity");
! Element root = getElement();
! // We have meaningful defaults for the following two
! root.addAttribute(DocumentHelper.createQName("repository", NSTools.NS_NEUID), repository);
! root.addAttribute(DocumentHelper.createQName("logger", NSTools.NS_NEUID), receiver);
! if (!Utility.isEmpty(signer))
! root.addAttribute(DocumentHelper.createQName("signer", NSTools.NS_NEUID), signer);
! if (!Utility.isEmpty(receiver))
! root.addAttribute(DocumentHelper.createQName("receiver", NSTools.NS_NEUID), receiver);
! if (allow != null) {
! QName allowName = DocumentHelper.createQName("allow", NSTools.NS_NEUID);
! Element pub = root.addElement(allowName);
! pub.add(XMLSecTools.createKeyInfo(allow));
}
+ }
! public IdentityBuilder(String name, PublicKey allow, String repository) throws NeudistException {
! this(name, allow, repository, null, null, null);
! }
!
! public IdentityBuilder(String name, PublicKey allow) throws NeudistException {
! this(name, allow, null);
}
public String getTagName() {
! return "Identity";
! }
!
! public static void main(String args[]) {
! System.out.println("Test Building NeuClear Identities");
! try {
! NamedObjectBuilder id = new IdentityBuilder("neu://", Identity.NEUROOT.getPublicKey());
! System.out.println(new String(id.canonicalize()));
! } catch (NeudistException e) {
! e.printStackTrace();
! }
}
}
Index: NamedObjectBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/NamedObjectBuilder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** NamedObjectBuilder.java 1 Oct 2003 17:05:37 -0000 1.2
--- NamedObjectBuilder.java 1 Oct 2003 19:08:30 -0000 1.3
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/10/01 19:08:30 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.2 2003/10/01 17:05:37 pelle
* Moved the NeuClearCertificate class to be an inner class of Identity.
***************
*** 122,125 ****
--- 128,136 ----
import org.dom4j.*;
+ import org.neuclear.id.Identity;
+ import org.neuclear.id.NSTools;
+ import org.neuclear.id.Named;
+ import org.neuclear.id.resolver.NSResolver;
+ import org.neuclear.senders.Sender;
import org.neuclear.time.TimeTools;
import org.neudist.utils.NeudistException;
***************
*** 130,138 ****
import org.neudist.xml.xmlsec.XMLSecTools;
import org.neudist.xml.xmlsec.XMLSecurityException;
- import org.neuclear.id.Named;
- import org.neuclear.id.NSTools;
- import org.neuclear.id.Identity;
- import org.neuclear.id.resolver.NSResolver;
- import org.neuclear.senders.Sender;
import java.sql.Timestamp;
--- 141,144 ----
***************
*** 140,148 ****
import java.util.LinkedList;
import java.util.List;
/**
* This simple wrapper takes most of the contents of a NamedObject and puts it into a Serializable form that can be signed.
*/
! public abstract class NamedObjectBuilder extends SignedElement implements Named {
! public NamedObjectBuilder(String name,String tagName, String prefix, String nsURI) {
super(tagName, prefix, nsURI);
createDocument();
--- 146,155 ----
import java.util.LinkedList;
import java.util.List;
+
/**
* This simple wrapper takes most of the contents of a NamedObject and puts it into a Serializable form that can be signed.
*/
! public class NamedObjectBuilder extends SignedElement implements Named {
! public NamedObjectBuilder(String name, String tagName, String prefix, String nsURI) {
super(tagName, prefix, nsURI);
createDocument();
***************
*** 150,165 ****
}
! public NamedObjectBuilder(String name,String tagName, Namespace ns) {
super(tagName, ns);
createDocument();
setName(name);
}
! public NamedObjectBuilder(String name,String tagName) {
! super(tagName,NamedObjectBuilder.NS_NSDL);
createDocument();
setName(name);
}
! public NamedObjectBuilder(String name,QName qname) {
super(qname);
createDocument();
--- 157,173 ----
}
! public NamedObjectBuilder(String name, String tagName, Namespace ns) {
super(tagName, ns);
createDocument();
setName(name);
}
!
! public NamedObjectBuilder(String name, String tagName) {
! super(tagName, NSTools.NS_NEUID);
createDocument();
setName(name);
}
! public NamedObjectBuilder(String name, QName qname) {
super(qname);
createDocument();
***************
*** 167,170 ****
--- 175,192 ----
}
+ public NamedObjectBuilder(Element elem) throws XMLSecurityException {
+ super(elem);
+ //TODO Load targets
+ }
+
+ public String getTagName() {
+ if (getElement() == null)
+ return "Object";
+ return getElement().getName();
+ }
+
+ public NamedObjectBuilder(Document doc) throws XMLSecurityException {
+ super(doc.getRootElement());
+ }
/**
***************
*** 184,212 ****
* @return Parent Name
*/
! public String getLocalName() {
! String fullName=getName();
! int i=fullName.lastIndexOf('/');
! return fullName.substring(i+1);
}
private void setName(String name) {
! getElement().addAttribute(getNameAttrQName(),name);
}
private static QName getNameAttrQName() {
! return DocumentHelper.createQName("name",NamedObjectBuilder.NS_NSDL);
}
private void createDocument() {
! Element elem=getElement();
! if(elem.getDocument()==null) {
! Document doc=DocumentHelper.createDocument(elem);
}
}
/**
* @return the URI of the object. In this case the same as getName();
*/
public final String getURI() throws XMLSecurityException {
! return getName();
}
--- 206,236 ----
* @return Parent Name
*/
! public String getLocalName() {
! String fullName = getName();
! int i = fullName.lastIndexOf('/');
! return fullName.substring(i + 1);
}
private void setName(String name) {
! getElement().addAttribute(getNameAttrQName(), name);
}
private static QName getNameAttrQName() {
! return DocumentHelper.createQName("name", NSTools.NS_NEUID);
}
+
private void createDocument() {
! Element elem = getElement();
! if (elem.getDocument() == null) {
! Document doc = DocumentHelper.createDocument(elem);
}
}
+
/**
* @return the URI of the object. In this case the same as getName();
*/
public final String getURI() throws XMLSecurityException {
! return getName();
}
***************
*** 215,223 ****
*/
public Namespace getNS() {
! return NamedObjectBuilder.NS_NSDL;
}
protected void addElement(NamedObjectBuilder child) throws XMLException {
! addElement((AbstractElementProxy)child);
}
--- 239,247 ----
*/
public Namespace getNS() {
! return NSTools.NS_NEUID;
}
protected void addElement(NamedObjectBuilder child) throws XMLException {
! addElement((AbstractElementProxy) child);
}
***************
*** 226,233 ****
* Sign NamedObject using given PrivateKey. This also adds a timestamp to the root element prior to signing
*/
! protected final void preSign() throws XMLSecurityException{
// We need to timestamp it before we sign it
! getElement().addAttribute(DocumentHelper.createQName("timestamp",NamedObjectBuilder.NS_NSDL),TimeTools.createTimeStamp());
! }
/**
--- 250,257 ----
* Sign NamedObject using given PrivateKey. This also adds a timestamp to the root element prior to signing
*/
! protected final void preSign() throws XMLSecurityException {
// We need to timestamp it before we sign it
! getElement().addAttribute(DocumentHelper.createQName("timestamp", NSTools.NS_NEUID), TimeTools.createTimeStamp());
! }
/**
***************
*** 249,269 ****
*/
public void addTarget(TargetReference target) throws NeudistException {
! if (target==null)
return;
! QName targetsQN=DocumentHelper.createQName("Targets",NamedObjectBuilder.NS_NSDL);
! Element targetsElem=getElement().element(targetsQN);
! if (targetsElem==null){
! targetsElem=DocumentHelper.createElement(targetsQN);
getElement().add(targetsElem);
}
! targetsElem.add(target.getElement());
! targetList().add(target);
}
private synchronized List targetList() {
! if (targets==null)
! targets=new LinkedList();
return targets;
}
/**
* Lists the targets within an object
--- 273,294 ----
*/
public void addTarget(TargetReference target) throws NeudistException {
! if (target == null)
return;
! QName targetsQN = DocumentHelper.createQName("Targets", NSTools.NS_NEUID);
! Element targetsElem = getElement().element(targetsQN);
! if (targetsElem == null) {
! targetsElem = DocumentHelper.createElement(targetsQN);
getElement().add(targetsElem);
}
! targetsElem.add(target.getElement());
! targetList().add(target);
}
private synchronized List targetList() {
! if (targets == null)
! targets = new LinkedList();
return targets;
}
+
/**
* Lists the targets within an object
***************
*** 277,289 ****
* Sends copy of object to all targets within
*/
! public void sendObject() throws NeudistException{
! System.out.println("NEUDIST: Sending Object "+getName());
if (this.isSigned()) {
! Iterator iter=listTargets();
! while(iter.hasNext()) {
! TargetReference tg=((TargetReference)iter.next());
tg.send();
! System.out.println("NEUDIST: Sent to "+tg.getHref());
}
--- 302,314 ----
* Sends copy of object to all targets within
*/
! public void sendObject() throws NeudistException {
! System.out.println("NEUDIST: Sending Object " + getName());
if (this.isSigned()) {
! Iterator iter = listTargets();
! while (iter.hasNext()) {
! TargetReference tg = ((TargetReference) iter.next());
tg.send();
! System.out.println("NEUDIST: Sent to " + tg.getHref());
}
***************
*** 293,298 ****
public Timestamp getTimeStamp() throws NeudistException {
! String timeString=getElement().attributeValue(DocumentHelper.createQName("timestamp",NamedObjectBuilder.NS_NSDL));
! if (isSigned()&&!Utility.isEmpty(timeString)){
try {
return TimeTools.parseTimeStamp(timeString);
--- 318,323 ----
public Timestamp getTimeStamp() throws NeudistException {
! String timeString = getElement().attributeValue(DocumentHelper.createQName("timestamp", NSTools.NS_NEUID));
! if (isSigned() && !Utility.isEmpty(timeString)) {
try {
return TimeTools.parseTimeStamp(timeString);
***************
*** 306,325 ****
}
public final void log() throws NeudistException {
Identity ns = getParent();
! Sender.quickSend(ns.getLogger(),this);
}
public Identity getParent() throws NeudistException {
! Identity ns=NSResolver.resolveIdentity(NSTools.getParentNSURI(getName()));
! return ns;
}
private List targets;
- public static final String NSDL_NAMESPACE="http://neudist.org/neu/nsdl";
- public static final Namespace NS_NSDL=DocumentHelper.createNamespace("nsdl",NamedObjectBuilder.NSDL_NAMESPACE);
-
- public static final String NSDL_PREFIX="nsdl:";
}
--- 331,346 ----
}
+
public final void log() throws NeudistException {
Identity ns = getParent();
! Sender.quickSend(ns.getLogger(), this);
}
public Identity getParent() throws NeudistException {
! return NSResolver.resolveIdentity(NSTools.getParentNSURI(getName()));
}
private List targets;
}
Index: TargetReference.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/TargetReference.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TargetReference.java 27 Sep 2003 19:23:11 -0000 1.1
--- TargetReference.java 1 Oct 2003 19:08:30 -0000 1.2
***************
*** 2,5 ****
--- 2,11 ----
* $Id$
* $Log$
+ * Revision 1.2 2003/10/01 19:08:30 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.1 2003/09/27 19:23:11 pelle
* Added Builders to create named objects from scratch.
***************
*** 41,76 ****
import org.dom4j.Element;
import org.dom4j.Namespace;
! //import org.neudist.ns.NamedObject;
import org.neuclear.senders.Sender;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
import org.neudist.xml.AbstractElementProxy;
- import org.neuclear.senders.Sender;
public class TargetReference extends AbstractElementProxy {
! public TargetReference(NamedObjectBuilder obj, Element elem) throws NeudistException{
super(elem);
if (!elem.getName().equals(TAG_NAME))
throw new NeudistException("Element is not a <Target/> Element");
! owner=obj;
}
! public TargetReference(NamedObjectBuilder obj,String href,String type) {
! super(DocumentHelper.createQName(TAG_NAME,NamedObjectBuilder.NS_NSDL));
if (!Utility.isEmpty(href))
! getElement().addAttribute(DocumentHelper.createQName("href",NamedObjectBuilder.NS_NSDL),href);
if (!Utility.isEmpty(type))
! getElement().addAttribute(DocumentHelper.createQName("type",NamedObjectBuilder.NS_NSDL),type);
! owner=obj;
! }
public String getHref() {
! return getElement().attributeValue(DocumentHelper.createQName("href",NamedObjectBuilder.NS_NSDL));
}
public String getType() {
! return getElement().attributeValue(DocumentHelper.createQName("type",NamedObjectBuilder.NS_NSDL));
}
! private static final String TAG_NAME="Target";
public String getTagName() {
--- 47,82 ----
import org.dom4j.Element;
import org.dom4j.Namespace;
! import org.neuclear.id.NSTools;
import org.neuclear.senders.Sender;
import org.neudist.utils.NeudistException;
import org.neudist.utils.Utility;
import org.neudist.xml.AbstractElementProxy;
public class TargetReference extends AbstractElementProxy {
! public TargetReference(NamedObjectBuilder obj, Element elem) throws NeudistException {
super(elem);
if (!elem.getName().equals(TAG_NAME))
throw new NeudistException("Element is not a <Target/> Element");
! owner = obj;
}
! public TargetReference(NamedObjectBuilder obj, String href, String type) {
! super(DocumentHelper.createQName(TAG_NAME, NSTools.NS_NEUID));
if (!Utility.isEmpty(href))
! getElement().addAttribute(DocumentHelper.createQName("href", NSTools.NS_NEUID), href);
if (!Utility.isEmpty(type))
! getElement().addAttribute(DocumentHelper.createQName("type", NSTools.NS_NEUID), type);
! owner = obj;
! }
public String getHref() {
! return getElement().attributeValue(DocumentHelper.createQName("href", NSTools.NS_NEUID));
}
+
public String getType() {
! return getElement().attributeValue(DocumentHelper.createQName("type", NSTools.NS_NEUID));
}
! private static final String TAG_NAME = "Target";
public String getTagName() {
***************
*** 79,86 ****
public Namespace getNS() {
! return NamedObjectBuilder.NS_NSDL;
}
public void send() throws NeudistException {
! Sender.quickSend(getHref(),owner);
}
--- 85,93 ----
public Namespace getNS() {
! return NSTools.NS_NEUID;
}
+
public void send() throws NeudistException {
! Sender.quickSend(getHref(), owner);
}
|
|
From: <pe...@us...> - 2003-10-01 19:08:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline
In directory sc8-pr-cvs1:/tmp/cvs-serv19838/src/java/org/neuclear/signers/commandline
Modified Files:
CommandLineSigner.java
Log Message:
Changed XML Format. Now NameSpace has been modified to Identity also the
xml namespace prefix nsdl has been changed to neuid.
The standard constants for using these have been moved into NSTools.
The NamedObjectBuilder can also now take an Element, such as an unsigned template.
Index: CommandLineSigner.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/signers/commandline/CommandLineSigner.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** CommandLineSigner.java 26 Sep 2003 00:22:07 -0000 1.5
--- CommandLineSigner.java 1 Oct 2003 19:08:31 -0000 1.6
***************
*** 1,4 ****
--- 1,10 ----
/* $Id$
* $Log$
+ * Revision 1.6 2003/10/01 19:08:31 pelle
+ * Changed XML Format. Now NameSpace has been modified to Identity also the
+ * xml namespace prefix nsdl has been changed to neuid.
+ * The standard constants for using these have been moved into NSTools.
+ * The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+ *
* Revision 1.5 2003/09/26 00:22:07 pelle
* Cleanups and final changes to code for refactoring of the Verifier and Reader part.
***************
*** 121,127 ****
import org.dom4j.Document;
import org.neuclear.id.NSTools;
- import org.neuclear.id.Identity;
import org.neuclear.id.SignedNamedObject;
!
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.senders.LogSender;
--- 127,133 ----
import org.dom4j.Document;
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
! import org.neuclear.id.builders.IdentityBuilder;
! import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.senders.LogSender;
***************
*** 147,151 ****
CryptoTools.ensureProvider();
String keystore = System.getProperty("user.home") + "/.keystore";
! /*
try {
--- 153,157 ----
CryptoTools.ensureProvider();
String keystore = System.getProperty("user.home") + "/.keystore";
!
try {
***************
*** 195,199 ****
}
}
! SignedNamedObject subject;
if (!doCreate) {
subject = loadNamedObject(sf);
--- 201,205 ----
}
}
! NamedObjectBuilder subject;
if (!doCreate) {
subject = loadNamedObject(sf);
***************
*** 209,213 ****
} else
newkid = ks.getCertificate(alias).getPublicKey(); //Self Sign
! subject = new Identity(namespace, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver);
}
--- 215,219 ----
} else
newkid = ks.getCertificate(alias).getPublicKey(); //Self Sign
! subject = new IdentityBuilder(namespace, newkid, defaultstore, defaultsigner, defaultlogger, defaultreceiver);
}
***************
*** 239,248 ****
e.printStackTrace(System.err);
}
- */
}
- /*
! private static SignedNamedObject loadNamedObject(String sf) throws FileNotFoundException, NeudistException {
SignedNamedObject subject;
InputStream source = System.in;
--- 245,252 ----
e.printStackTrace(System.err);
}
}
! private static NamedObjectBuilder loadNamedObject(String sf) throws FileNotFoundException, NeudistException {
SignedNamedObject subject;
InputStream source = System.in;
***************
*** 251,258 ****
}
Document doc = XMLTools.loadDocument(source);
! subject = NamedObjectFactory.createNamedObject(doc);
! return subject;
}
- */
private static Options createOptions() {
--- 255,260 ----
}
Document doc = XMLTools.loadDocument(source);
! return new NamedObjectBuilder(doc);
}
private static Options createOptions() {
|
|
From: <pe...@us...> - 2003-10-01 19:08:37
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/verifier
In directory sc8-pr-cvs1:/tmp/cvs-serv19838/src/java/org/neuclear/id/verifier
Modified Files:
VerifyingReader.java
Log Message:
Changed XML Format. Now NameSpace has been modified to Identity also the
xml namespace prefix nsdl has been changed to neuid.
The standard constants for using these have been moved into NSTools.
The NamedObjectBuilder can also now take an Element, such as an unsigned template.
Index: VerifyingReader.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/verifier/VerifyingReader.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** VerifyingReader.java 1 Oct 2003 17:05:38 -0000 1.2
--- VerifyingReader.java 1 Oct 2003 19:08:31 -0000 1.3
***************
*** 1,25 ****
package org.neuclear.id.verifier;
! import org.neudist.xml.xmlsec.SignedElement;
! import org.neudist.xml.xmlsec.XMLSecurityException;
! import org.neudist.xml.xmlsec.XMLSecTools;
! import org.neudist.xml.XMLTools;
! import org.neudist.xml.XMLException;
! import org.neudist.utils.NeudistException;
! import org.neudist.crypto.CryptoTools;
! import org.dom4j.Namespace;
import org.dom4j.Element;
import org.dom4j.QName;
- import org.dom4j.DocumentHelper;
import org.neuclear.id.*;
import org.neuclear.id.resolver.NSResolver;
- import org.neuclear.id.cache.NSCache;
import org.neuclear.time.TimeTools;
- import java.security.PublicKey;
import java.io.InputStream;
! import java.util.Map;
! import java.util.HashMap;
import java.sql.Timestamp;
/*
--- 1,20 ----
package org.neuclear.id.verifier;
! import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
import org.neuclear.id.*;
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.time.TimeTools;
+ import org.neudist.crypto.CryptoTools;
+ import org.neudist.utils.NeudistException;
+ import org.neudist.xml.XMLTools;
+ import org.neudist.xml.xmlsec.XMLSecTools;
import java.io.InputStream;
! import java.security.PublicKey;
import java.sql.Timestamp;
+ import java.util.HashMap;
+ import java.util.Map;
/*
***************
*** 43,46 ****
--- 38,47 ----
$Id$
$Log$
+ Revision 1.3 2003/10/01 19:08:31 pelle
+ Changed XML Format. Now NameSpace has been modified to Identity also the
+ xml namespace prefix nsdl has been changed to neuid.
+ The standard constants for using these have been moved into NSTools.
+ The NamedObjectBuilder can also now take an Element, such as an unsigned template.
+
Revision 1.2 2003/10/01 17:05:38 pelle
Moved the NeuClearCertificate class to be an inner class of Identity.
***************
*** 64,71 ****
*/
public class VerifyingReader {
! private VerifyingReader(){
! readers=new HashMap();
! readers.put("Identity",new Identity.Reader());
! defaultReader=new SignedNamedObject.Reader();
}
--- 65,72 ----
*/
public class VerifyingReader {
! private VerifyingReader() {
! readers = new HashMap();
! readers.put("Identity", new Identity.Reader());
! defaultReader = new SignedNamedObject.Reader();
}
***************
*** 73,76 ****
--- 74,78 ----
return new VerifyingReader();
}
+
/**
* Read Object from input stream.
***************
*** 81,109 ****
*/
public SignedNamedObject read(InputStream is) throws NeudistException {
! Element elem=XMLTools.loadDocument(is).getRootElement();
! String name=NSTools.normalizeNameURI(elem.attributeValue(getNameAttrQName()));
! String signatoryName=NSTools.getParentNSURI(name);
! PublicKey pubs[]=null;
! Identity signatory=NSResolver.resolveIdentity(signatoryName);
! if (XMLSecTools.verifySignature(elem,signatory.getPublicKey())) {
//I should be able to get this from within. This is just a quick hack.
! String digest=new String(CryptoTools.digest(XMLSecTools.canonicalize(elem)));
! Timestamp timestamp=TimeTools.parseTimeStamp(elem.attributeValue("timestamp"));
! return resolveReader(elem).read(elem,name,signatory, digest,timestamp);
} else
! throw new InvalidIdentityException(name+" isnt valid");
}
! private NamedObjectReader resolveReader(Element elem){
! NamedObjectReader reader=(NamedObjectReader) readers.get(elem.getName());
! if (reader==null)
! reader=defaultReader;
return reader;
}
! private static QName getNameAttrQName() {
! return DocumentHelper.createQName("name",SignedNamedObject.NS_NSDL);
}
private Map readers;
private NamedObjectReader defaultReader;
--- 83,112 ----
*/
public SignedNamedObject read(InputStream is) throws NeudistException {
! Element elem = XMLTools.loadDocument(is).getRootElement();
! String name = NSTools.normalizeNameURI(elem.attributeValue(getNameAttrQName()));
! String signatoryName = NSTools.getParentNSURI(name);
! PublicKey pubs[] = null;
! Identity signatory = NSResolver.resolveIdentity(signatoryName);
! if (XMLSecTools.verifySignature(elem, signatory.getPublicKey())) {
//I should be able to get this from within. This is just a quick hack.
! String digest = new String(CryptoTools.digest(XMLSecTools.canonicalize(elem)));
! Timestamp timestamp = TimeTools.parseTimeStamp(elem.attributeValue("timestamp"));
! return resolveReader(elem).read(elem, name, signatory, digest, timestamp);
} else
! throw new InvalidIdentityException(name + " isnt valid");
}
! private NamedObjectReader resolveReader(Element elem) {
! NamedObjectReader reader = (NamedObjectReader) readers.get(elem.getName());
! if (reader == null)
! reader = defaultReader;
return reader;
}
! private static QName getNameAttrQName() {
! return DocumentHelper.createQName("name", NSTools.NS_NEUID);
}
+
private Map readers;
private NamedObjectReader defaultReader;
|
|
From: <bug...@ve...> - 2003-10-01 18:06:59
|
The following issue has been updated:
Updater: Pelle Braendgaard (mailto:pe...@ve...)
Date: Wed, 1 Oct 2003 1:06 PM
Changes:
description changed from It might be usefull to create a version of neuclear-id in the future that is fully compatible with Sun JCE's <a href="http://java.sun.com/j2se/1.4.2/docs/guide/security/certpath/CertPathProgGuide.html">Certificate and CertificatePath framework</a>
Why? Mainly because it would allow easier integration within existing pki code, the main interesting one for me being codesigning.
Why not? The API is bloated and I dont think very easy to work with. It isnt very appropriate either for Server or J2ME based apps due to its bloat.
---------------------------------------------------------------------
For a full history of the issue, see:
http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=NEU-6&page=history
---------------------------------------------------------------------
View the issue:
http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=NEU-6
Here is an overview of the issue:
---------------------------------------------------------------------
Key: NEU-6
Summary: Fully create JCE implementation of Certificate Infrastructure
Type: New Feature
Status: Assigned
Priority: Major
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Identity
Fix Fors:
1.0
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Wed, 1 Oct 2003 12:58 PM
Updated: Wed, 1 Oct 2003 1:06 PM
Description:
It might be usefull to create a version of neuclear-id in the future that is fully compatible with Sun JCE's Certificate and CertificatePath framework: http://java.sun.com/j2se/1.4.2/docs/guide/security/certpath/CertPathProgGuide.html
Why? Mainly because it would allow easier integration within existing pki code, the main interesting one for me being codesigning.
Why not? The API is bloated and I dont think very easy to work with. It isnt very appropriate either for Server or J2ME based apps due to its bloat.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://devone.veraxpay.com:9090/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|