|
From: <pe...@us...> - 2003-09-24 23:56:55
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver
In directory sc8-pr-cvs1:/tmp/cvs-serv524/src/java/org/neuclear/id/resolver
Modified Files:
NSResolver.java
Log Message:
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.
Index: NSResolver.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/resolver/NSResolver.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NSResolver.java 23 Sep 2003 19:16:27 -0000 1.3
--- NSResolver.java 24 Sep 2003 23:56:48 -0000 1.4
***************
*** 27,31 ****
* @return
*/
! public final static Identity resolveNameSpace(String name) throws NeudistException, InvalidIdentityException {
Identity ns = NSCACHE.fetchCached(name);
if (ns != null)
--- 27,31 ----
* @return
*/
! public final static Identity resolveIdentity(String name) throws NeudistException, InvalidIdentityException {
Identity ns = NSCACHE.fetchCached(name);
if (ns != null)
***************
*** 34,50 ****
String parentname = NSTools.getParentNSURI(name);
String store = NSROOTSTORE;
! boolean isRootlevel = parentname == null || parentname.equals("neu://");
! Identity parent = null;
! if (!isRootlevel) {
! parent = resolveNameSpace(parentname);
! store = parent.getRepository();
! }
// fetches Identity from parent Identity's Default Store
ns = (Identity) Source.getInstance().fetch(store, name);
if (ns == null)
throw new NeudistException("Identity: " + name + " was not resolved");
- PublicKey parentkey = (isRootlevel) ? NSVerifier.getRootPK() : parent.getAllowed();
- if (!ns.verifySignature(parentkey))
- throw new InvalidIdentityException("Identity: " + name + " not allowed in " + parentname);
NSCACHE.cache(ns);
return ns; //This may not be null
--- 34,45 ----
String parentname = NSTools.getParentNSURI(name);
String store = NSROOTSTORE;
! if ( parentname == null || parentname.equals("neu://"))
! return Identity.getRootIdentity();
! Identity parent = resolveIdentity(parentname);
! store = parent.getRepository();
// fetches Identity from parent Identity's Default Store
ns = (Identity) Source.getInstance().fetch(store, name);
if (ns == null)
throw new NeudistException("Identity: " + name + " was not resolved");
NSCACHE.cache(ns);
return ns; //This may not be null
|