Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv1620/src/java/org/neuclear/id
Modified Files:
NSTools.java SignedNamedCore.java
Added Files:
InvalidNamedObjectException.java
Removed Files:
InvalidNamedObject.java
Log Message:
Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
--- NEW FILE: InvalidNamedObjectException.java ---
/*
* $Id: InvalidNamedObjectException.java,v 1.1 2003/12/11 23:57:29 pelle Exp $
* $Log: InvalidNamedObjectException.java,v $
* Revision 1.1 2003/12/11 23:57:29 pelle
* Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
* Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
*
* Revision 1.3 2003/12/10 23:58:51 pelle
* Did some cleaning up in the builders
* Fixed some stuff in IdentityCreator
* New maven goal to create executable jarapp
* We are close to 0.8 final of ID, 0.11 final of XMLSIG and 0.5 of commons.
* Will release shortly.
*
* Revision 1.2 2003/11/21 04:45:13 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
* Otherwise You will Finaliate.
* Anything that can be final has been made final throughout everyting. We've used IDEA's Inspector tool to find all instance of variables that could be final.
* This should hopefully make everything more stable (and secure).
*
* Revision 1.1 2003/11/15 01:58:16 pelle
* More work all around on web applications.
*
* Revision 1.4 2003/11/11 21:18:43 pelle
* Further vital reshuffling.
* org.neudist.crypto.* and org.neudist.utils.* have been moved to respective areas under org.neuclear.commons
* org.neuclear.signers.* as well as org.neuclear.passphraseagents have been moved under org.neuclear.commons.crypto as well.
* Did a bit of work on the Canonicalizer and changed a few other minor bits.
*
* Revision 1.3 2003/10/21 22:31:13 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
* Unhooked the XMLException in the xmlsig library from NeuClearException to make all of its exceptions an independent hierarchy.
* Obviously had to perform many changes throughout the code to support these changes.
*
* Revision 1.2 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.1 2003/09/23 19:16:27 pelle
* Changed NameSpace to Identity.
* To cause less confusion in the future.
*
* Revision 1.2 2003/09/22 19:24:01 pelle
* More fixes throughout to problems caused by renaming.
*
* Revision 1.1.1.1 2003/09/19 14:40:55 pelle
* First import into the neuclear project. This was originally under the SF neuclear
* project. This marks a general major refactoring and renaming ahead.
*
* The new name for this code is NeuClear Identity and has the general package header of
* org.neuclear.id
* There are other areas within the current code which will be split out into other subprojects later on.
* In particularly the signers will be completely seperated out as well as the contract types.
*
*
* Revision 1.3 2003/02/14 21:10:26 pelle
* The email sender works. The LogSender and the SoapSender should work but havent been tested yet.
* The SignedNamedObject has a new log() method that logs it's contents at it's parent Identity's logger.
* The Identity object also has a new method receive() which allows one to receive a named object to the Identity's
* default receiver.
*
* Revision 1.2 2003/02/14 05:10:12 pelle
* New Source model is implemented.
* It doesnt quite verify things correctly yet. I'm not yet sure why.
* CommandLineSigner is simplified to make it easier to use.
*
* Revision 1.1.1.1 2002/09/18 10:55:39 pelle
* First release in new CVS structure.
* Also first public release.
* This implemnts simple named objects.
* - Identity Objects
* - NSAuth Objects
*
* Storage systems
* - In Memory Storage
* - Clear text file based storage
* - Encrypted File Storage (with SHA256 digested filenames)
* - CachedStorage
* - SoapStorage
*
* Simple SOAP client/server
* - Simple Single method call SOAP client, for arbitrary dom4j based requests
* - Simple Abstract SOAP Servlet for implementing http based SOAP Servers
*
* Simple XML-Signature Implementation
* - Based on dom4j
* - SHA-RSA only
* - Very simple (likely imperfect) highspeed canonicalizer
* - Zero support for X509 (We dont like that anyway)
* - Super Simple
*
*
* Revision 1.1.1.1 2002/05/29 10:02:20 pelle
* Lets try one more time. This is the first rev of the next gen of Neudist
*
*
*/
package org.neuclear.id;
import org.neuclear.commons.NeuClearException;
public final class InvalidNamedObjectException extends NeuClearException {
public InvalidNamedObjectException(final String msg) {
super(msg);
}
}
Index: NSTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/NSTools.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** NSTools.java 11 Dec 2003 16:16:14 -0000 1.19
--- NSTools.java 11 Dec 2003 23:57:29 -0000 1.20
***************
*** 2,5 ****
--- 2,9 ----
* $Id$
* $Log$
+ * Revision 1.20 2003/12/11 23:57:29 pelle
+ * Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
+ * Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
+ *
* Revision 1.19 2003/12/11 16:16:14 pelle
* Some changes to make the xml a bit more readable.
***************
*** 176,180 ****
import org.neuclear.commons.Utility;
import org.neuclear.commons.crypto.CryptoTools;
- import org.neuclear.xml.XMLTools;
import java.util.regex.Matcher;
--- 180,183 ----
***************
*** 193,200 ****
*/
public static String normalizeNameURI(String name) throws NeuClearException {
if (!name.startsWith("neu://"))
name = "neu:/" + name;
if (!isValidName(name))
! throw new InvalidNamedObject("Name: '" + name + "' is not valid");
return name;
}
--- 196,205 ----
*/
public static String normalizeNameURI(String name) throws NeuClearException {
+ if (name == null)
+ return "neu://";
if (!name.startsWith("neu://"))
name = "neu:/" + name;
if (!isValidName(name))
! throw new InvalidNamedObjectException("Name: '" + name + "' is not valid");
return name;
}
***************
*** 252,256 ****
public static String getSignatoryURI(final String uri) throws NeuClearException {
if (!isValidName(uri))
! throw new InvalidNamedObject("Invalid Neu ID: " + uri);
final int bang = uri.indexOf('!');
--- 257,261 ----
public static String getSignatoryURI(final String uri) throws NeuClearException {
if (!isValidName(uri))
! throw new InvalidNamedObjectException("Invalid Neu ID: " + uri);
final int bang = uri.indexOf('!');
***************
*** 280,284 ****
public static String getLocalName(final String uri) throws NeuClearException {
if (!isValidName(uri))
! throw new InvalidNamedObject("Invalid Neu ID: " + uri);
final int bang = uri.indexOf('!');
--- 285,289 ----
public static String getLocalName(final String uri) throws NeuClearException {
if (!isValidName(uri))
! throw new InvalidNamedObjectException("Invalid Neu ID: " + uri);
final int bang = uri.indexOf('!');
***************
*** 354,360 ****
* @param name NEU Name URI
* @return Path
! * @throws InvalidNamedObject If the URI is invalid
*/
! public static String name2path(final String name) throws InvalidNamedObject {
if (!Utility.isEmpty(name)) {
final Matcher matcher = STRIP_URI_ARROBA.matcher(name);
--- 359,365 ----
* @param name NEU Name URI
* @return Path
! * @throws InvalidNamedObjectException If the URI is invalid
*/
! public static String name2path(final String name) throws InvalidNamedObjectException {
if (!Utility.isEmpty(name)) {
final Matcher matcher = STRIP_URI_ARROBA.matcher(name);
***************
*** 363,367 ****
}
}
! throw new InvalidNamedObject("Invalid NEU ID: " + name);
}
--- 368,372 ----
}
}
! throw new InvalidNamedObjectException("Invalid NEU ID: " + name);
}
***************
*** 386,403 ****
* <br><b>Important</b>
* It does not verify if it has been signed.
! * @param node
! * @return
*/
public static boolean isNamedObject(Node node) {
! if (node==null) return false;
! Element elem=null;
if (node instanceof Document)
! elem=((Document)node).getRootElement();
else if (node instanceof Element)
! elem=(Element)node;
else
return false;
! return !Utility.isEmpty(elem.attributeValue(DocumentHelper.createQName("name",NS_NEUID)));
}
--- 391,409 ----
* <br><b>Important</b>
* It does not verify if it has been signed.
! *
! * @param node
! * @return
*/
public static boolean isNamedObject(Node node) {
! if (node == null) return false;
! Element elem = null;
if (node instanceof Document)
! elem = ((Document) node).getRootElement();
else if (node instanceof Element)
! elem = (Element) node;
else
return false;
! return !Utility.isEmpty(elem.attributeValue(DocumentHelper.createQName("name", NS_NEUID)));
}
Index: SignedNamedCore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedCore.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SignedNamedCore.java 10 Dec 2003 23:58:51 -0000 1.5
--- SignedNamedCore.java 11 Dec 2003 23:57:29 -0000 1.6
***************
*** 2,5 ****
--- 2,9 ----
* $Id$
* $Log$
+ * Revision 1.6 2003/12/11 23:57:29 pelle
+ * Trying to test the ReceiverServlet with cactus. Still no luck. Need to return a ElementProxy of some sort.
+ * Cleaned up some missing fluff in the ElementProxy interface. getTagName(), getQName() and getNameSpace() have been killed.
+ *
* Revision 1.5 2003/12/10 23:58:51 pelle
* Did some cleaning up in the builders
***************
*** 281,285 ****
return new SignedNamedCore(name, signatory, timestamp, new String(XMLSecTools.canonicalize(elem)));
} else
! throw new InvalidNamedObject(name + " isnt valid");
}
--- 285,289 ----
return new SignedNamedCore(name, signatory, timestamp, new String(XMLSecTools.canonicalize(elem)));
} else
! throw new InvalidNamedObjectException(name + " isnt valid");
}
--- InvalidNamedObject.java DELETED ---
|