|
From: <pe...@us...> - 2003-11-19 23:34:40
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv12836/src/java/org/neuclear/store
Modified Files:
EncryptedFileStore.java FileStore.java Store.java
Log Message:
Signers now can generatekeys via the generateKey() method.
Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit.
SignedNamedObject now contains the full xml which is returned with getEncoded()
This means that it is now possible to further send on or process a SignedNamedObject, leaving
NamedObjectBuilder for its original purposes of purely generating new Contracts.
NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it.
Updated all major interfaces that used the old model to use the new model.
Index: EncryptedFileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/EncryptedFileStore.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** EncryptedFileStore.java 18 Nov 2003 23:35:45 -0000 1.12
--- EncryptedFileStore.java 19 Nov 2003 23:34:00 -0000 1.13
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.13 2003/11/19 23:34:00 pelle
+ * Signers now can generatekeys via the generateKey() method.
+ * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit.
+ * SignedNamedObject now contains the full xml which is returned with getEncoded()
+ * This means that it is now possible to further send on or process a SignedNamedObject, leaving
+ * NamedObjectBuilder for its original purposes of purely generating new Contracts.
+ * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it.
+ * Updated all major interfaces that used the old model to use the new model.
+ *
* Revision 1.12 2003/11/18 23:35:45 pelle
* Payment Web Application is getting there.
***************
*** 167,171 ****
import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.id.NSTools;
! import org.neuclear.id.builders.NamedObjectBuilder;
import javax.crypto.CipherInputStream;
--- 176,180 ----
import org.neuclear.commons.crypto.CryptoTools;
import org.neuclear.id.NSTools;
! import org.neuclear.id.SignedNamedObject;
import javax.crypto.CipherInputStream;
***************
*** 183,187 ****
}
! protected OutputStream getOutputStream(NamedObjectBuilder obj) throws NeuClearException, FileNotFoundException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
--- 192,196 ----
}
! protected OutputStream getOutputStream(SignedNamedObject obj) throws NeuClearException, FileNotFoundException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
Index: FileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/FileStore.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** FileStore.java 18 Nov 2003 23:35:46 -0000 1.13
--- FileStore.java 19 Nov 2003 23:34:00 -0000 1.14
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.14 2003/11/19 23:34:00 pelle
+ * Signers now can generatekeys via the generateKey() method.
+ * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit.
+ * SignedNamedObject now contains the full xml which is returned with getEncoded()
+ * This means that it is now possible to further send on or process a SignedNamedObject, leaving
+ * NamedObjectBuilder for its original purposes of purely generating new Contracts.
+ * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it.
+ * Updated all major interfaces that used the old model to use the new model.
+ *
* Revision 1.13 2003/11/18 23:35:46 pelle
* Payment Web Application is getting there.
***************
*** 159,163 ****
import org.neuclear.id.NSTools;
import org.neuclear.id.SignedNamedObject;
- import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.verifier.VerifyingReader;
import org.neuclear.xml.XMLException;
--- 168,171 ----
***************
*** 175,185 ****
}
! protected void rawStore(NamedObjectBuilder obj) throws IOException, NeuClearException, XMLException {
OutputStream out = getOutputStream(obj);
! out.write(obj.canonicalize());
out.close();
}
! protected OutputStream getOutputStream(NamedObjectBuilder obj) throws NeuClearException, FileNotFoundException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
--- 183,193 ----
}
! protected void rawStore(SignedNamedObject obj) throws IOException, NeuClearException, XMLException {
OutputStream out = getOutputStream(obj);
! out.write(obj.getEncoded().getBytes("UTF-8"));
out.close();
}
! protected OutputStream getOutputStream(SignedNamedObject obj) throws NeuClearException, FileNotFoundException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
***************
*** 221,225 ****
}
! protected String getFileName(NamedObjectBuilder obj) throws NeuClearException {
return getFileName(obj.getName());
// if (! (obj instanceof Identity))
--- 229,233 ----
}
! protected String getFileName(SignedNamedObject obj) throws NeuClearException {
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.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Store.java 18 Nov 2003 15:45:09 -0000 1.13
--- Store.java 19 Nov 2003 23:34:00 -0000 1.14
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.14 2003/11/19 23:34:00 pelle
+ * Signers now can generatekeys via the generateKey() method.
+ * Refactored the relationship between SignedNamedObject and NamedObjectBuilder a bit.
+ * SignedNamedObject now contains the full xml which is returned with getEncoded()
+ * This means that it is now possible to further send on or process a SignedNamedObject, leaving
+ * NamedObjectBuilder for its original purposes of purely generating new Contracts.
+ * NamedObjectBuilder.sign() now returns a SignedNamedObject which is the prefered way of processing it.
+ * Updated all major interfaces that used the old model to use the new model.
+ *
* Revision 1.13 2003/11/18 15:45:09 pelle
* FileStoreTest now passes. FileStore works again.
***************
*** 165,178 ****
import org.neuclear.commons.NeuClearException;
- import org.neuclear.id.InvalidNamedObject;
import org.neuclear.id.SignedNamedObject;
! import org.neuclear.id.builders.NamedObjectBuilder;
! import org.neuclear.receiver.RawReceiver;
! import org.neuclear.receiver.UnsupportedTransaction;
import org.neuclear.xml.XMLException;
import java.io.IOException;
! abstract public class Store implements RawReceiver {
--- 174,184 ----
import org.neuclear.commons.NeuClearException;
import org.neuclear.id.SignedNamedObject;
! import org.neuclear.receiver.Receiver;
import org.neuclear.xml.XMLException;
import java.io.IOException;
! abstract public class Store implements Receiver {
***************
*** 182,190 ****
* This handles the Identity checking on the object.
*/
! public final void receive(NamedObjectBuilder obj) throws InvalidNamedObject,NeuClearException {
try {
- // Dont allow overwrites
- //TODO: Implement versioning
- obj.verify();
rawStore(obj);
} catch (IOException e) {
--- 188,193 ----
* This handles the Identity checking on the object.
*/
! public final org.neuclear.xml.ElementProxy receive(SignedNamedObject obj) throws NeuClearException {
try {
rawStore(obj);
} catch (IOException e) {
***************
*** 193,196 ****
--- 196,200 ----
throw new NeuClearException(e);
}
+ return null;
}
***************
*** 198,205 ****
* Override this for each specific Store type
*/
! protected void rawStore(NamedObjectBuilder obj) throws IOException, NeuClearException, XMLException {
;
}
-
--- 202,208 ----
* Override this for each specific Store type
*/
! protected void rawStore(SignedNamedObject obj) throws IOException, NeuClearException, XMLException {
;
}
|