|
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 ---
|