|
From: <pe...@us...> - 2004-01-10 00:03:24
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv23620/src/java/org/neuclear/id
Modified Files:
SignedNamedCore.java SignedNamedObject.java
Added Files:
SignedNamedDocument.java
Log Message:
Implemented new Schema for Transfer*
Working on it for Exchange*, so far all Receipts are implemented.
Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML.
Changed SignedNamedObject.getDigest() from byte array to String.
The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there.
--- NEW FILE: SignedNamedDocument.java ---
package org.neuclear.id;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
/*
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: SignedNamedDocument.java,v 1.1 2004/01/10 00:03:21 pelle Exp $
$Log: SignedNamedDocument.java,v $
Revision 1.1 2004/01/10 00:03:21 pelle
Implemented new Schema for Transfer*
Working on it for Exchange*, so far all Receipts are implemented.
Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML.
Changed SignedNamedObject.getDigest() from byte array to String.
The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there.
*/
/**
* A general purpose object XML information from an arbitrary signed Document.
*/
public class SignedNamedDocument extends SignedNamedObject{
private SignedNamedDocument(SignedNamedCore core) {
super(core);
}
/**
* This parses the document from the encoded version and returns it to you.
* Note it parses it on every call, so you might want to
* @return
* @throws DocumentException
*/
public Document getDocument() throws DocumentException {
return DocumentHelper.parseText(getEncoded());
}
final public static class Reader implements NamedObjectReader {
/**
* Read object from Element and fill in its details
*
* @param elem
* @return
*/
public SignedNamedObject read(final SignedNamedCore core, final Element elem) {
return new SignedNamedDocument(core);
}
}
}
Index: SignedNamedCore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedCore.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** SignedNamedCore.java 9 Jan 2004 16:34:40 -0000 1.10
--- SignedNamedCore.java 10 Jan 2004 00:03:21 -0000 1.11
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.11 2004/01/10 00:03:21 pelle
+ * Implemented new Schema for Transfer*
+ * Working on it for Exchange*, so far all Receipts are implemented.
+ * Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML.
+ * Changed SignedNamedObject.getDigest() from byte array to String.
+ * The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there.
+ *
* Revision 1.10 2004/01/09 16:34:40 pelle
* changed use of base36 encoding to base32 to ensure compatibility with other schemes.
***************
*** 246,256 ****
import org.dom4j.Element;
import org.dom4j.QName;
- import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.CryptoTools;
- import org.neuclear.commons.crypto.Base64;
- import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.time.TimeTools;
import org.neuclear.id.resolver.NSResolver;
- import org.neuclear.xml.XMLException;
import org.neuclear.xml.xmlsec.KeyInfo;
import org.neuclear.xml.xmlsec.XMLSecTools;
--- 253,259 ----
***************
*** 282,286 ****
private SignedNamedCore(final PublicKey pub){
this.digest=CryptoTools.encodeBase32(CryptoTools.digest(pub.getEncoded()));
! this.name="neu:sha1:"+digest;
this.timestamp=System.currentTimeMillis();
this.encoded=new String(pub.getEncoded());
--- 285,289 ----
private SignedNamedCore(final PublicKey pub){
this.digest=CryptoTools.encodeBase32(CryptoTools.digest(pub.getEncoded()));
! this.name="neu:sha1://"+digest;
this.timestamp=System.currentTimeMillis();
this.encoded=new String(pub.getEncoded());
Index: SignedNamedObject.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedObject.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** SignedNamedObject.java 8 Jan 2004 23:39:06 -0000 1.16
--- SignedNamedObject.java 10 Jan 2004 00:03:21 -0000 1.17
***************
*** 2,5 ****
--- 2,12 ----
* $Id$
* $Log$
+ * Revision 1.17 2004/01/10 00:03:21 pelle
+ * Implemented new Schema for Transfer*
+ * Working on it for Exchange*, so far all Receipts are implemented.
+ * Added SignedNamedDocument which is a generic SignedNamedObject that works with all Signed XML.
+ * Changed SignedNamedObject.getDigest() from byte array to String.
+ * The whole malarchy in neuclear-pay does not build yet. The refactoring is a big job, but getting there.
+ *
* Revision 1.16 2004/01/08 23:39:06 pelle
* XMLSignature can now give you the Signing key and the id of the signer.
***************
*** 230,238 ****
package org.neuclear.id;
- import org.dom4j.Element;
- import org.dom4j.QName;
import org.dom4j.DocumentHelper;
import org.neuclear.commons.NeuClearException;
- import org.neuclear.xml.xmlsec.XMLSecurityException;
import java.sql.Timestamp;
--- 237,243 ----
package org.neuclear.id;
import org.dom4j.DocumentHelper;
+ import org.dom4j.QName;
import org.neuclear.commons.NeuClearException;
import java.sql.Timestamp;
***************
*** 318,322 ****
}
! public final byte[] getDigest() {
return core.getDigest();
}
--- 323,327 ----
}
! public final String getDigest() {
return core.getDigest();
}
***************
*** 360,382 ****
private final SignedNamedCore core;
-
- final public static class Reader implements NamedObjectReader {
- /**
- * Read object from Element and fill in its details
- *
- * @param elem
- * @return
- */
- public SignedNamedObject read(final SignedNamedCore core, final Element elem) {
- return new SignedNamedObject(core);
- }
- /**
- * Read object from Element and fill in its details
- *
- * @param elem
- * @return
- */
-
- }
}
--- 365,368 ----
|