You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(119) |
Oct
(111) |
Nov
(238) |
Dec
(395) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(239) |
Feb
(59) |
Mar
(354) |
Apr
(489) |
May
(23) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(5) |
Jun
(2) |
Jul
|
Aug
|
Sep
(3) |
Oct
(14) |
Nov
(17) |
Dec
(9) |
| 2007 |
Jan
(4) |
Feb
(3) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
(7) |
May
(3) |
Jun
(6) |
Jul
(4) |
Aug
(3) |
Sep
(15) |
Oct
(13) |
Nov
(35) |
Dec
(40) |
| 2009 |
Jan
(19) |
Feb
(21) |
Mar
(16) |
Apr
(18) |
May
(36) |
Jun
(20) |
Jul
(32) |
Aug
(11) |
Sep
(3) |
Oct
(2) |
Nov
(2) |
Dec
(13) |
| 2010 |
Jan
(5) |
Feb
(5) |
Mar
(7) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(4) |
Nov
|
Dec
(3) |
| 2012 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(8) |
Jun
(4) |
Jul
(9) |
Aug
(2) |
Sep
(8) |
Oct
(3) |
Nov
(8) |
Dec
(4) |
| 2013 |
Jan
(2) |
Feb
(1) |
Mar
(5) |
Apr
(6) |
May
(10) |
Jun
(5) |
Jul
(6) |
Aug
(7) |
Sep
(5) |
Oct
(2) |
Nov
(4) |
Dec
(4) |
| 2014 |
Jan
(13) |
Feb
(4) |
Mar
(7) |
Apr
(9) |
May
(20) |
Jun
(13) |
Jul
(10) |
Aug
(3) |
Sep
(5) |
Oct
(2) |
Nov
(2) |
Dec
(2) |
| 2015 |
Jan
(3) |
Feb
(3) |
Mar
(5) |
Apr
(4) |
May
(3) |
Jun
(2) |
Jul
(4) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2016 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
(3) |
Oct
(3) |
Nov
(4) |
Dec
(2) |
| 2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id
In directory sc8-pr-cvs1:/tmp/cvs-serv12836/src/java/org/neuclear/id
Modified Files:
Identity.java NamedObjectReader.java SignatureRequest.java
SignedNamedObject.java SignedObject.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: Identity.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Identity.java 18 Nov 2003 15:07:36 -0000 1.18
--- Identity.java 19 Nov 2003 23:33:59 -0000 1.19
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.19 2003/11/19 23:33:59 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.18 2003/11/18 15:07:36 pelle
* Changes to JCE Implementation
***************
*** 241,245 ****
import org.neuclear.commons.crypto.CryptoException;
import org.neuclear.commons.crypto.CryptoTools;
- import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.senders.Sender;
--- 250,253 ----
***************
*** 289,294 ****
*/
! protected Identity(String name, Identity signatory, Timestamp timestamp, String digest, String repository, String signer, String logger, String receiver, PublicKey pub) throws NeuClearException {
! super(name, signatory, timestamp, digest);
this.repository = repository;
this.logger = logger;
--- 297,302 ----
*/
! protected Identity(String name, Identity signatory, Timestamp timestamp, String encoded, String repository, String signer, String logger, String receiver, PublicKey pub) throws NeuClearException {
! super(name, signatory, timestamp, encoded);
this.repository = repository;
this.logger = logger;
***************
*** 311,315 ****
}
! public SignedNamedObject send(NamedObjectBuilder obj) throws NeuClearException {
if (!Utility.isEmpty(receiver))
return Sender.quickSend(receiver, obj);
--- 319,323 ----
}
! public SignedNamedObject send(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(receiver))
return Sender.quickSend(receiver, obj);
***************
*** 318,322 ****
}
! void log(NamedObjectBuilder obj) throws NeuClearException {
if (!Utility.isEmpty(logger))
Sender.quickSend(logger, obj);
--- 326,330 ----
}
! void log(SignedNamedObject obj) throws NeuClearException {
if (!Utility.isEmpty(logger))
Sender.quickSend(logger, obj);
***************
*** 356,369 ****
public static final Identity NEUROOT = createRootIdentity();
! public final Certificate[] getCertificateChain(){
! ArrayList certs=new ArrayList(3);
! Identity id=this;
! while(id!=null ||id.getName().equals("neu://")) {
certs.add(id.getCertificate());
! id=id.getSignatory();
}
certs.add(NEUROOT);
certs.trimToSize();
! return (Certificate[])certs.toArray();
}
--- 364,377 ----
public static final Identity NEUROOT = createRootIdentity();
! public final Certificate[] getCertificateChain() {
! ArrayList certs = new ArrayList(3);
! Identity id = this;
! while (id != null || id.getName().equals("neu://")) {
certs.add(id.getCertificate());
! id = id.getSignatory();
}
certs.add(NEUROOT);
certs.trimToSize();
! return (Certificate[]) certs.toArray();
}
***************
*** 391,395 ****
*/
public byte[] getEncoded() throws CertificateEncodingException {
! return getName().getBytes();
}
--- 399,403 ----
*/
public byte[] getEncoded() throws CertificateEncodingException {
! return getEncoded();
}
***************
*** 433,437 ****
* @return
*/
! public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws XMLSecurityException, NeuClearException {
String repository = elem.attributeValue(DocumentHelper.createQName("repository", NSTools.NS_NEUID));
String signer = elem.attributeValue(DocumentHelper.createQName("signer", NSTools.NS_NEUID));
--- 441,445 ----
* @return
*/
! public SignedNamedObject read(Element elem, String name, Identity signatory, String encoded, Timestamp timestamp) throws XMLSecurityException, NeuClearException {
String repository = elem.attributeValue(DocumentHelper.createQName("repository", NSTools.NS_NEUID));
String signer = elem.attributeValue(DocumentHelper.createQName("signer", NSTools.NS_NEUID));
***************
*** 442,446 ****
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);
}
--- 450,454 ----
KeyInfo ki = new KeyInfo(allowElement.element(XMLSecTools.createQName("KeyInfo")));
PublicKey pub = ki.getPublicKey();
! return new Identity(name, signatory, timestamp, encoded, repository, signer, logger, receiver, pub);
}
Index: NamedObjectReader.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/NamedObjectReader.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** NamedObjectReader.java 11 Nov 2003 21:18:43 -0000 1.3
--- NamedObjectReader.java 19 Nov 2003 23:33:59 -0000 1.4
***************
*** 27,30 ****
--- 27,39 ----
$Id$
$Log$
+ Revision 1.4 2003/11/19 23:33:59 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.3 2003/11/11 21:18:43 pelle
Further vital reshuffling.
***************
*** 50,54 ****
/**
- *
* User: pelleb
* Date: Sep 23, 2003
--- 59,62 ----
***************
*** 59,65 ****
/**
* Read object from Element and fill in its details
! * @param elem
! * @return
*/
! public SignedNamedObject read(Element elem,String name,Identity signatory,String digest,Timestamp timestamp) throws NeuClearException, XMLSecurityException;
}
--- 67,74 ----
/**
* Read object from Element and fill in its details
! *
! * @param elem
! * @return
*/
! public SignedNamedObject read(Element elem, String name, Identity signatory, String encoded, Timestamp timestamp) throws NeuClearException, XMLSecurityException;
}
Index: SignatureRequest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignatureRequest.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SignatureRequest.java 18 Nov 2003 00:01:55 -0000 1.3
--- SignatureRequest.java 19 Nov 2003 23:33:59 -0000 1.4
***************
*** 30,33 ****
--- 30,42 ----
$Id$
$Log$
+ Revision 1.4 2003/11/19 23:33:59 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.3 2003/11/18 00:01:55 pelle
The sample signing web application for logging in and out is now working.
***************
*** 55,60 ****
*/
public class SignatureRequest extends SignedNamedObject {
! private SignatureRequest(String name, Identity signer, Timestamp timestamp, String digest, String userid, NamedObjectBuilder unsigned, String description) throws NeuClearException {
! super(name, signer, timestamp, digest);
this.userid = userid;
this.unsigned = unsigned;
--- 64,69 ----
*/
public class SignatureRequest extends SignedNamedObject {
! private SignatureRequest(String name, Identity signer, Timestamp timestamp, String encoded, String userid, NamedObjectBuilder unsigned, String description) throws NeuClearException {
! super(name, signer, timestamp, encoded);
this.userid = userid;
this.unsigned = unsigned;
Index: SignedNamedObject.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedNamedObject.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** SignedNamedObject.java 11 Nov 2003 21:18:43 -0000 1.9
--- SignedNamedObject.java 19 Nov 2003 23:33:59 -0000 1.10
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.10 2003/11/19 23:33:59 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.9 2003/11/11 21:18:43 pelle
* Further vital reshuffling.
***************
*** 179,182 ****
--- 188,192 ----
import org.dom4j.Element;
import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.crypto.CryptoTools;
import java.sql.Timestamp;
***************
*** 195,199 ****
* SignedNamedObject should have a corresponding subclass of NamedObjectBuilder.<p>
* These NamedObjectBuilder objects should be signed using your Signer, before being sent on to a web service.
! *
* @see NamedObjectReader
* @see org.neuclear.id.builders.NamedObjectBuilder
--- 205,209 ----
* SignedNamedObject should have a corresponding subclass of NamedObjectBuilder.<p>
* These NamedObjectBuilder objects should be signed using your Signer, before being sent on to a web service.
! *
* @see NamedObjectReader
* @see org.neuclear.id.builders.NamedObjectBuilder
***************
*** 205,213 ****
public class SignedNamedObject implements SignedObject, Named {
! protected SignedNamedObject(String name, Identity signer, Timestamp timestamp, String digest) throws NeuClearException {
this.name = NSTools.normalizeNameURI(name);
this.signer = signer;
this.timestamp = timestamp;
! this.digest = digest;
}
--- 215,223 ----
public class SignedNamedObject implements SignedObject, Named {
! protected SignedNamedObject(String name, Identity signer, Timestamp timestamp, String encoded) throws NeuClearException {
this.name = NSTools.normalizeNameURI(name);
this.signer = signer;
this.timestamp = timestamp;
! this.encoded = encoded;
}
***************
*** 223,232 ****
/**
* The Name of an object within it's parent Identity
! * <p>
* eg.:<pre>
* getName() = "neu://test/hello"
* getLocalName() = "hello":
* </pre>
! * @return Name
*/
public String getLocalName() {
--- 233,243 ----
/**
* The Name of an object within it's parent Identity
! * <p/>
* eg.:<pre>
* getName() = "neu://test/hello"
* getLocalName() = "hello":
* </pre>
! *
! * @return Name
*/
public String getLocalName() {
***************
*** 239,243 ****
/**
* The time the object was signed
! * @return
*/
public Timestamp getTimeStamp() {
--- 250,255 ----
/**
* The time the object was signed
! *
! * @return
*/
public Timestamp getTimeStamp() {
***************
*** 257,266 ****
/**
! * The SHA1 Digest of the original xml signed document
*
* @return
*/
! public String getDigest() {
! return digest;
}
--- 269,282 ----
/**
! * The original xml document
*
* @return
*/
! public final String getEncoded() {
! return encoded;
! }
!
! public final byte[] getDigest() {
! return CryptoTools.digest(encoded.getBytes());
}
***************
*** 268,272 ****
private final Identity signer;
private final Timestamp timestamp;
! private final String digest;
final public static class Reader implements NamedObjectReader {
--- 284,288 ----
private final Identity signer;
private final Timestamp timestamp;
! private final String encoded;
final public static class Reader implements NamedObjectReader {
***************
*** 277,283 ****
* @return
*/
! public SignedNamedObject read(Element elem, String name, Identity signatory, String digest, Timestamp timestamp) throws NeuClearException {
! return new SignedNamedObject(name, signatory, timestamp, digest);
}
--- 293,299 ----
* @return
*/
! public SignedNamedObject read(Element elem, String name, Identity signatory, String encoded, Timestamp timestamp) throws NeuClearException {
! return new SignedNamedObject(name, signatory, timestamp, encoded);
}
Index: SignedObject.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignedObject.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SignedObject.java 21 Oct 2003 22:31:13 -0000 1.2
--- SignedObject.java 19 Nov 2003 23:33:59 -0000 1.3
***************
*** 1,4 ****
--- 1,13 ----
/* $Id$
* $Log$
+ * Revision 1.3 2003/11/19 23:33:59 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.2 2003/10/21 22:31:13 pelle
* Renamed NeudistException to NeuClearException and moved it to org.neuclear.commons where it makes more sense.
***************
*** 18,22 ****
* The AbstractElementProxy has a new final method .asXML()
* which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization.
! * You can now also easily get the digest of a SignedElement with the new .getDigest() value.
*
* Revision 1.2 2003/02/08 18:48:37 pelle
--- 27,31 ----
* The AbstractElementProxy has a new final method .asXML()
* which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization.
! * You can now also easily get the digest of a SignedElement with the new .getEncoded() value.
*
* Revision 1.2 2003/02/08 18:48:37 pelle
***************
*** 80,91 ****
*/
- import org.neuclear.commons.NeuClearException;
-
! public interface SignedObject {
Identity getSignatory();
! String getDigest();
}
--- 89,98 ----
*/
! public interface SignedObject {
Identity getSignatory();
! String getEncoded();
}
|
|
From: <pe...@us...> - 2003-11-19 23:34:40
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv12836/src/java/org/neuclear/id/builders
Modified Files:
NamedObjectBuilder.java TargetReference.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: NamedObjectBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/NamedObjectBuilder.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** NamedObjectBuilder.java 15 Nov 2003 01:58:16 -0000 1.8
--- NamedObjectBuilder.java 19 Nov 2003 23:33:58 -0000 1.9
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.9 2003/11/19 23:33:58 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.8 2003/11/15 01:58:16 pelle
* More work all around on web applications.
***************
*** 160,168 ****
import org.neuclear.id.resolver.NSResolver;
import org.neuclear.id.verifier.VerifyingReader;
- import org.neuclear.senders.Sender;
import org.neuclear.xml.AbstractElementProxy;
import org.neuclear.xml.XMLException;
import org.neuclear.xml.xmlsec.SignedElement;
- import org.neuclear.xml.xmlsec.XMLSecTools;
import org.neuclear.xml.xmlsec.XMLSecurityException;
--- 169,175 ----
***************
*** 216,224 ****
}
! final public void sign(Signer signer) throws NeuClearException, XMLSecurityException {
sign(getParent().getName(), signer);
}
! public final SignedNamedObject verify() throws NeuClearException, XMLException {
if (!isSigned())
throw new InvalidNamedObject("Invalid: " + this.getName());
--- 223,232 ----
}
! final public SignedNamedObject sign(Signer signer) throws NeuClearException, XMLException {
sign(getParent().getName(), signer);
+ return verify();
}
! private final SignedNamedObject verify() throws NeuClearException, XMLException {
if (!isSigned())
throw new InvalidNamedObject("Invalid: " + this.getName());
***************
*** 293,308 ****
}
- /**
- * This is called after signing to handle any post signing tasks such as logging
- *
- * @throws XMLSecurityException
- */
- protected void postSign() throws XMLSecurityException {
- try {
- log();
- } catch (NeuClearException e) {
- XMLSecTools.rethrowException(e);
- }
- }
/**
--- 301,304 ----
***************
*** 350,354 ****
while (iter.hasNext()) {
TargetReference tg = ((TargetReference) iter.next());
- tg.send();
System.out.println("NEUDIST: Sent to " + tg.getHref());
}
--- 346,349 ----
***************
*** 373,381 ****
}
- public final void log() throws NeuClearException {
- Identity ns = getParent();
- if (ns != null && ns.getLogger() != null)
- Sender.quickSend(ns.getLogger(), this);
- }
public Identity getParent() throws NeuClearException {
--- 368,371 ----
Index: TargetReference.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/TargetReference.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** TargetReference.java 11 Nov 2003 21:18:42 -0000 1.4
--- TargetReference.java 19 Nov 2003 23:33:59 -0000 1.5
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.5 2003/11/19 23:33:59 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.4 2003/11/11 21:18:42 pelle
* Further vital reshuffling.
***************
*** 58,65 ****
import org.dom4j.Element;
import org.dom4j.Namespace;
- import org.neuclear.id.NSTools;
- import org.neuclear.senders.Sender;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
import org.neuclear.xml.AbstractElementProxy;
--- 67,73 ----
import org.dom4j.Element;
import org.dom4j.Namespace;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.Utility;
+ import org.neuclear.id.NSTools;
import org.neuclear.xml.AbstractElementProxy;
***************
*** 99,105 ****
}
- public void send() throws NeuClearException {
- Sender.quickSend(getHref(), owner);
- }
private NamedObjectBuilder owner;
--- 107,110 ----
|
|
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 {
;
}
|
|
From: <pe...@us...> - 2003-11-19 23:34:40
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv12836/src/java/org/neuclear/store/servlet
Modified Files:
StorageServlet.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: StorageServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/servlet/StorageServlet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** StorageServlet.java 11 Nov 2003 21:18:44 -0000 1.4
--- StorageServlet.java 19 Nov 2003 23:33:59 -0000 1.5
***************
*** 9,50 ****
package org.neuclear.store.servlet;
- import org.dom4j.DocumentHelper;
- import org.dom4j.Element;
- import org.neuclear.id.builders.NamedObjectBuilder;
- import org.neuclear.store.FileStore;
- import org.neuclear.store.Store;
import org.neuclear.commons.Utility;
! import org.neuclear.xml.soap.SOAPException;
! import org.neuclear.xml.soap.SOAPServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
! public class StorageServlet extends SOAPServlet {
public void init(ServletConfig config) throws ServletException {
System.out.println("NEUDIST: Initialising StorageServlet");
super.init(config);
! String storePath = config.getServletContext().getRealPath(Utility.denullString(config.getInitParameter("basedir"), "/WEB-INF/store"));
System.out.println("NEUDIST: Setting up store at: " + storePath);
! store = new FileStore(storePath);
!
! }
- private Store getStore() {
- return store;
}
! private Store store;
- protected Element handleSOAPRequest(Element request, String soapAction) throws SOAPException {
- try {
- store.receive(new NamedObjectBuilder(request));
- } catch (Exception e) {
- Element error = DocumentHelper.createElement("Error");
- error.setText(e.getMessage());
- return error;
- }
- return request;
- }
}
--- 9,31 ----
package org.neuclear.store.servlet;
import org.neuclear.commons.Utility;
! import org.neuclear.receiver.ReceiverServlet;
! import org.neuclear.store.FileStore;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
! public class StorageServlet extends ReceiverServlet {
public void init(ServletConfig config) throws ServletException {
System.out.println("NEUDIST: Initialising StorageServlet");
super.init(config);
! storePath = config.getServletContext().getRealPath(Utility.denullString(config.getInitParameter("basedir"), "/WEB-INF/store"));
System.out.println("NEUDIST: Setting up store at: " + storePath);
! setReceiver(new FileStore(storePath));
}
! private String storePath;
}
|
|
From: <pe...@us...> - 2003-11-19 23:34:00
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec In directory sc8-pr-cvs1:/tmp/cvs-serv12757/src/java/org/neuclear/xml/xmlsec Modified Files: Reference.java SignedElement.java XMLSignature.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: Reference.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/Reference.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Reference.java 11 Nov 2003 16:33:26 -0000 1.1.1.1 --- Reference.java 19 Nov 2003 23:33:17 -0000 1.2 *************** *** 1,4 **** --- 1,13 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:17 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.1.1.1 2003/11/11 16:33:26 pelle * Moved over from neudist.org *************** *** 43,47 **** * * Revision 1.7 2003/02/16 00:24:21 pelle ! * getDigest() was broken in Reference.java * * Revision 1.6 2003/02/11 14:50:24 pelle --- 52,56 ---- * * Revision 1.7 2003/02/16 00:24:21 pelle ! * getEncoded() was broken in Reference.java * * Revision 1.6 2003/02/11 14:50:24 pelle *************** *** 93,100 **** import org.dom4j.Element; import org.neuclear.commons.crypto.Base64; - import org.neuclear.commons.crypto.CryptoTools; import org.neuclear.commons.crypto.CryptoException; ! import org.neuclear.commons.Utility; import org.neuclear.xml.XMLException; import org.neuclear.xml.XMLTools; --- 102,109 ---- import org.dom4j.Element; + import org.neuclear.commons.Utility; import org.neuclear.commons.crypto.Base64; import org.neuclear.commons.crypto.CryptoException; ! import org.neuclear.commons.crypto.CryptoTools; import org.neuclear.xml.XMLException; import org.neuclear.xml.XMLTools; *************** *** 102,108 **** import org.neuclear.xml.c14.CanonicalizerWithComments; import org.neuclear.xml.c14.CanonicalizerWithoutSignature; - import org.neuclear.xml.transforms.ClearTransform; import org.neuclear.xml.transforms.Transform; - import org.neuclear.xml.transforms.TransformerFactory; import java.io.File; --- 111,115 ---- *************** *** 116,132 **** * Currently only RSA */ ! public Reference(Element root, String uri,SignatureInfo si,int sigtype) throws XMLException { super(Reference.TAG_NAME); this.root = root; ! this.si=si; ! xmlsigType=sigtype; // findRefElement(); ! if (root==null) loadReference(uri); ! if (getSigType()==XMLSIGTYPE_ENVELOPED) addTransform("http://www.w3.org/2000/09/xmldsig#enveloped-signature"); ! else if (getSigType()==XMLSIGTYPE_ENVELOPING) { ! root=si.getSig().getElement().element("Object"); // System.out.println(new String(canonicalizeReference()));// Just debugging here } --- 123,139 ---- * Currently only RSA */ ! public Reference(Element root, String uri, SignatureInfo si, int sigtype) throws XMLException { super(Reference.TAG_NAME); this.root = root; ! this.si = si; ! xmlsigType = sigtype; // findRefElement(); ! if (root == null) loadReference(uri); ! if (getSigType() == XMLSIGTYPE_ENVELOPED) addTransform("http://www.w3.org/2000/09/xmldsig#enveloped-signature"); ! else if (getSigType() == XMLSIGTYPE_ENVELOPING) { ! root = si.getSig().getElement().element("Object"); // System.out.println(new String(canonicalizeReference()));// Just debugging here } *************** *** 139,147 **** } ! public Reference(Element elem,SignatureInfo si) throws XMLSecurityException { super(elem); if (!elem.getQName().getName().equals(TAG_NAME)) throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); ! this.si=si; // Here we will try to get work out Root findRefElement(); --- 146,154 ---- } ! public Reference(Element elem, SignatureInfo si) throws XMLSecurityException { super(elem); if (!elem.getQName().getName().equals(TAG_NAME)) throw new XMLSecurityException("Element: " + elem.getQualifiedName() + " is not a valid: " + XMLSecTools.NS_DS.getPrefix() + ":" + TAG_NAME); ! this.si = si; // Here we will try to get work out Root findRefElement(); *************** *** 153,169 **** Element objectElem = sigElement.element(XMLSecTools.createQName("Object")); ! if (objectElem!=null) { // Enveloping ! xmlsigType=XMLSIGTYPE_ENVELOPING; ! List contents=objectElem.content(); ! if (contents.size()==1) ! root=contents.get(0); else ! root=contents; ! root=objectElem; } else if (sigElement.getParent() != null) { // Enveloped ! xmlsigType=XMLSIGTYPE_ENVELOPED; root = getElement().getDocument(); ! } else {// Detached ! xmlsigType=XMLSIGTYPE_DETACHED; loadReference(getElement().attributeValue("URI")); } --- 160,176 ---- Element objectElem = sigElement.element(XMLSecTools.createQName("Object")); ! if (objectElem != null) { // Enveloping ! xmlsigType = XMLSIGTYPE_ENVELOPING; ! List contents = objectElem.content(); ! if (contents.size() == 1) ! root = contents.get(0); else ! root = contents; ! root = objectElem; } else if (sigElement.getParent() != null) { // Enveloped ! xmlsigType = XMLSIGTYPE_ENVELOPED; root = getElement().getDocument(); ! } else {// Detached ! xmlsigType = XMLSIGTYPE_DETACHED; loadReference(getElement().attributeValue("URI")); } *************** *** 174,178 **** throw new XMLSecurityException("XMLSignature is not linked to Document"); try { ! root=XMLTools.loadDocument(new File(refuri)).getRootElement(); } catch (XMLException e) { XMLSecTools.rethrowException(e); --- 181,185 ---- throw new XMLSecurityException("XMLSignature is not linked to Document"); try { ! root = XMLTools.loadDocument(new File(refuri)).getRootElement(); } catch (XMLException e) { XMLSecTools.rethrowException(e); *************** *** 194,205 **** // } // transforms.add(tran); ! transformsElement.addElement(XMLSecTools.createQName("Transform")).addAttribute("Algorithm",algorithm); } /** ! * Method getDigest * This returns the Digest ! * @return ! * @throws XMLSecurityException */ public byte[] getDigest() throws XMLSecurityException, CryptoException { --- 201,213 ---- // } // transforms.add(tran); ! transformsElement.addElement(XMLSecTools.createQName("Transform")).addAttribute("Algorithm", algorithm); } /** ! * Method getEncoded * This returns the Digest ! * ! * @return ! * @throws XMLSecurityException */ public byte[] getDigest() throws XMLSecurityException, CryptoException { *************** *** 209,217 **** return null; } void setDigest() throws XMLSecurityException { Element sv = (Element) getElement().element(XMLSecTools.createQName("DigestValue")); ! byte dig[]=generateRefenceDigest(); ! if (sv==null) ! getElement().add(XMLSecTools.base64ToElement("DigestValue",dig)); else sv.addText(Base64.encode(dig)); --- 217,226 ---- return null; } + void setDigest() throws XMLSecurityException { Element sv = (Element) getElement().element(XMLSecTools.createQName("DigestValue")); ! byte dig[] = generateRefenceDigest(); ! if (sv == null) ! getElement().add(XMLSecTools.base64ToElement("DigestValue", dig)); else sv.addText(Base64.encode(dig)); *************** *** 221,225 **** private final Object performTransforms() { // Element subject = root;//(Element) root.clone(); ! Object subject=root; Iterator iter = transforms.iterator(); while (iter.hasNext() && root != null) { --- 230,234 ---- private final Object performTransforms() { // Element subject = root;//(Element) root.clone(); ! Object subject = root; Iterator iter = transforms.iterator(); while (iter.hasNext() && root != null) { *************** *** 231,237 **** private Canonicalizer getCanonicalizer() { ! if (getSigType()==Reference.XMLSIGTYPE_ENVELOPED) return new CanonicalizerWithoutSignature(); ! else if (c14nType==Canonicalizer.C14NTYPE_WITH_COMMENTS) return new CanonicalizerWithComments(); return new Canonicalizer(); --- 240,246 ---- private Canonicalizer getCanonicalizer() { ! if (getSigType() == Reference.XMLSIGTYPE_ENVELOPED) return new CanonicalizerWithoutSignature(); ! else if (c14nType == Canonicalizer.C14NTYPE_WITH_COMMENTS) return new CanonicalizerWithComments(); return new Canonicalizer(); *************** *** 243,248 **** protected final byte[] canonicalizeReference() { ! return XMLSecTools.canonicalize(getCanonicalizer(),getReferenceElement()); } protected final byte[] generateRefenceDigest() { return CryptoTools.digest(canonicalizeReference()); --- 252,258 ---- protected final byte[] canonicalizeReference() { ! return XMLSecTools.canonicalize(getCanonicalizer(), getReferenceElement()); } + protected final byte[] generateRefenceDigest() { return CryptoTools.digest(canonicalizeReference()); *************** *** 250,254 **** public final boolean verifyReferences() throws XMLSecurityException, CryptoException { ! return CryptoTools.equalByteArrays(generateRefenceDigest(),getDigest()); } --- 260,264 ---- public final boolean verifyReferences() throws XMLSecurityException, CryptoException { ! return CryptoTools.equalByteArrays(generateRefenceDigest(), getDigest()); } *************** *** 267,275 **** private List transforms; private Element transformsElement; ! private int xmlsigType=0; ! public final static int XMLSIGTYPE_ENVELOPED=0; ! public final static int XMLSIGTYPE_ENVELOPING=1; ! public final static int XMLSIGTYPE_DETACHED=2; private int c14nType; --- 277,285 ---- private List transforms; private Element transformsElement; ! private int xmlsigType = 0; ! public final static int XMLSIGTYPE_ENVELOPED = 0; ! public final static int XMLSIGTYPE_ENVELOPING = 1; ! public final static int XMLSIGTYPE_DETACHED = 2; private int c14nType; Index: SignedElement.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/SignedElement.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SignedElement.java 11 Nov 2003 21:18:07 -0000 1.2 --- SignedElement.java 19 Nov 2003 23:33:17 -0000 1.3 *************** *** 1,4 **** --- 1,13 ---- /* $Id$ * $Log$ + * Revision 1.3 2003/11/19 23:33:17 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.2 2003/11/11 21:18:07 pelle * Further vital reshuffling. *************** *** 28,32 **** * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getDigest() value. * * Revision 1.2 2003/02/08 18:48:37 pelle --- 37,41 ---- * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getEncoded() value. * * Revision 1.2 2003/02/08 18:48:37 pelle *************** *** 91,96 **** import org.dom4j.Namespace; import org.dom4j.QName; - import org.neuclear.commons.crypto.signers.Signer; import org.neuclear.commons.crypto.CryptoException; import org.neuclear.xml.AbstractElementProxy; import org.neuclear.xml.XMLException; --- 100,105 ---- import org.dom4j.Namespace; import org.dom4j.QName; import org.neuclear.commons.crypto.CryptoException; + import org.neuclear.commons.crypto.signers.Signer; import org.neuclear.xml.AbstractElementProxy; import org.neuclear.xml.XMLException; Index: XMLSignature.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/xmlsec/XMLSignature.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** XMLSignature.java 11 Nov 2003 16:33:27 -0000 1.1.1.1 --- XMLSignature.java 19 Nov 2003 23:33:17 -0000 1.2 *************** *** 1,4 **** --- 1,13 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:17 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.1.1.1 2003/11/11 16:33:27 pelle * Moved over from neudist.org *************** *** 61,65 **** * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getDigest() value. * * Revision 1.6 2003/02/11 14:50:24 pelle --- 70,74 ---- * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getEncoded() value. * * Revision 1.6 2003/02/11 14:50:24 pelle *************** *** 119,125 **** import org.dom4j.DocumentHelper; import org.dom4j.Element; - import org.neuclear.commons.crypto.Base64; - import org.neuclear.commons.crypto.CryptoTools; import org.neuclear.commons.crypto.CryptoException; import org.neuclear.xml.XMLException; --- 128,133 ---- import org.dom4j.DocumentHelper; import org.dom4j.Element; import org.neuclear.commons.crypto.CryptoException; + import org.neuclear.commons.crypto.CryptoTools; import org.neuclear.xml.XMLException; *************** *** 136,143 **** /** * Creates an Enveloped (Embedded) Signature object based on the given element root ! * @param key ! * @param root ! * @param uri ! * @throws XMLSecurityException */ public XMLSignature(PrivateKey key, Element root, String uri) throws XMLSecurityException, CryptoException { --- 144,152 ---- /** * Creates an Enveloped (Embedded) Signature object based on the given element root ! * ! * @param key ! * @param root ! * @param uri ! * @throws XMLSecurityException */ public XMLSignature(PrivateKey key, Element root, String uri) throws XMLSecurityException, CryptoException { *************** *** 147,154 **** /** * Creates an Enveloped (Embedded) Signature object based on the given element root ! * @param keypair ! * @param root ! * @param uri ! * @throws XMLSecurityException */ public XMLSignature(KeyPair keypair, Element root, String uri) throws XMLSecurityException, CryptoException { --- 156,164 ---- /** * Creates an Enveloped (Embedded) Signature object based on the given element root ! * ! * @param keypair ! * @param root ! * @param uri ! * @throws XMLSecurityException */ public XMLSignature(KeyPair keypair, Element root, String uri) throws XMLSecurityException, CryptoException { *************** *** 158,167 **** /** * Creates a Signature object based on given element root. ! * ! * @param keypair ! * @param root ! * @param uri ! * @param type Reference.XMLSIGTYPE_ENVELOPED,Reference.XMLSIGTYPE_ENVELOPING or Reference.XMLSIGTYPE_DETACHED ! * @throws XMLSecurityException */ public XMLSignature(KeyPair keypair, Element root, String uri, int type) throws XMLSecurityException, CryptoException { --- 168,177 ---- /** * Creates a Signature object based on given element root. ! * ! * @param keypair ! * @param root ! * @param uri ! * @param type Reference.XMLSIGTYPE_ENVELOPED,Reference.XMLSIGTYPE_ENVELOPING or Reference.XMLSIGTYPE_DETACHED ! * @throws XMLSecurityException */ public XMLSignature(KeyPair keypair, Element root, String uri, int type) throws XMLSecurityException, CryptoException { *************** *** 210,216 **** /** * Method getPublicKey ! * ! * @return ! * @throws XMLSecurityException */ public byte[] getSignature() throws XMLSecurityException, CryptoException { --- 220,226 ---- /** * Method getPublicKey ! * ! * @return ! * @throws XMLSecurityException */ public byte[] getSignature() throws XMLSecurityException, CryptoException { |
|
From: <pe...@us...> - 2003-11-19 23:34:00
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml In directory sc8-pr-cvs1:/tmp/cvs-serv12757/src/java/org/neuclear/xml Modified Files: AbstractElementProxy.java XMLTools.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: AbstractElementProxy.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/AbstractElementProxy.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** AbstractElementProxy.java 11 Nov 2003 16:33:20 -0000 1.1.1.1 --- AbstractElementProxy.java 19 Nov 2003 23:33:17 -0000 1.2 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:17 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.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org *************** *** 25,29 **** * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getDigest() value. * * Revision 1.2 2003/02/11 14:47:02 pelle --- 34,38 ---- * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getEncoded() value. * * Revision 1.2 2003/02/11 14:47:02 pelle Index: XMLTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/XMLTools.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** XMLTools.java 11 Nov 2003 16:33:20 -0000 1.1.1.1 --- XMLTools.java 19 Nov 2003 23:33:17 -0000 1.2 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:17 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.1.1.1 2003/11/11 16:33:20 pelle * Moved over from neudist.org *************** *** 21,25 **** * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getDigest() value. * * Revision 1.3 2003/02/11 14:47:03 pelle --- 30,34 ---- * The AbstractElementProxy has a new final method .asXML() * which is similar to DOM4J's but it outputs the xml in the compact format and not the pretty format, thus not causing problems with Canonicalization. ! * You can now also easily get the digest of a SignedElement with the new .getEncoded() value. * * Revision 1.3 2003/02/11 14:47:03 pelle *************** *** 128,150 **** public class XMLTools { ! /** public static void writeDom(Document doc,OutputStream out) throws IOException{ ! try { ! ! TransformerFactory fact=TransformerFactory.newInstance(); ! Transformer tran=fact.newTransformer(); ! tran.setOutputProperty(OutputKeys.INDENT,"2"); ! tran.transform(new DOMSource(doc),new StreamResult(out)); ! } catch (TransformerFactoryConfigurationError error) { ! Utility.handleException(error); ! } catch (TransformerException e) { ! Utility.handleException(e); ! } ! // SerializerToXML serializer = new SerializerToXML(); ! // // Insert your PipedOutputStream here instead of System.out! ! // serializer.indent(2); ! // ! // serializer.setOutputStream(out); ! // serializer.serialize(doc); ! } */ public static boolean isAttributeTrue(Element elem, String name) { --- 137,160 ---- public class XMLTools { ! /** ! * public static void writeDom(Document doc,OutputStream out) throws IOException{ ! * try { ! * <p/> ! * TransformerFactory fact=TransformerFactory.newInstance(); ! * Transformer tran=fact.newTransformer(); ! * tran.setOutputProperty(OutputKeys.INDENT,"2"); ! * tran.transform(new DOMSource(doc),new StreamResult(out)); ! * } catch (TransformerFactoryConfigurationError error) { ! * Utility.handleException(error); ! * } catch (TransformerException e) { ! * Utility.handleException(e); ! * } ! * // SerializerToXML serializer = new SerializerToXML(); ! * // // Insert your PipedOutputStream here instead of System.out! ! * // serializer.indent(2); ! * // ! * // serializer.setOutputStream(out); ! * // serializer.serialize(doc); ! * } */ public static boolean isAttributeTrue(Element elem, String name) { |
|
From: <pe...@us...> - 2003-11-19 23:33:55
|
Update of /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap In directory sc8-pr-cvs1:/tmp/cvs-serv12757/src/java/org/neuclear/xml/soap Modified Files: SOAPTools.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: SOAPTools.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/src/java/org/neuclear/xml/soap/SOAPTools.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** SOAPTools.java 11 Nov 2003 16:33:23 -0000 1.1.1.1 --- SOAPTools.java 19 Nov 2003 23:33:16 -0000 1.2 *************** *** 1,4 **** --- 1,13 ---- /* $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:33:16 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.1.1.1 2003/11/11 16:33:23 pelle * Moved over from neudist.org *************** *** 90,96 **** */ - import org.dom4j.Element; import org.dom4j.Document; import org.dom4j.DocumentException; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; --- 99,105 ---- */ import org.dom4j.Document; import org.dom4j.DocumentException; + import org.dom4j.Element; import org.dom4j.io.SAXReader; import org.neuclear.commons.NeuClearException; *************** *** 112,116 **** } } ! public static InputStream soapRequest(String endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); --- 121,126 ---- } } ! ! public static InputStream soapRequest(String endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(new URL(endpoint), request, soapAction); *************** *** 119,122 **** --- 129,133 ---- } } + public static Element soapRequestElement(URL endpoint, Element request, String soapAction) throws NeuClearException { try { *************** *** 127,131 **** } ! public static InputStream soapRequest(URL endpoint, Element request, String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); --- 138,143 ---- } ! ! public static InputStream soapRequest(URL endpoint, String request, String soapAction) throws NeuClearException { try { return soapRequest(endpoint.openConnection(), request, soapAction); *************** *** 136,139 **** --- 148,155 ---- public static InputStream soapRequest(URLConnection conn, Element request, String soapAction) throws NeuClearException { + return soapRequest(conn, request.asXML(), soapAction); + } + + public static InputStream soapRequest(URLConnection conn, String request, String soapAction) throws NeuClearException { try { //Set Headers *************** *** 147,153 **** OutputStream out = conn.getOutputStream(); out.write(SOAP_START); ! out.write(request.asXML().getBytes()); ! System.out.println("Request"); ! System.out.println(request.asXML()); out.write(SOAP_END); out.close(); --- 163,167 ---- OutputStream out = conn.getOutputStream(); out.write(SOAP_START); ! out.write(request.getBytes()); out.write(SOAP_END); out.close(); *************** *** 162,166 **** BufferedReader in = new BufferedReader( new InputStreamReader( ! soapRequest(conn,request,soapAction) )); SAXReader reader = new SAXReader(); --- 176,180 ---- BufferedReader in = new BufferedReader( new InputStreamReader( ! soapRequest(conn, request, soapAction) )); SAXReader reader = new SAXReader(); |
|
From: <pe...@us...> - 2003-11-19 23:33:55
|
Update of /cvsroot/neuclear/neuclear-xmlsig In directory sc8-pr-cvs1:/tmp/cvs-serv12757 Modified Files: project.properties 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: project.properties =================================================================== RCS file: /cvsroot/neuclear/neuclear-xmlsig/project.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** project.properties 11 Nov 2003 21:18:09 -0000 1.2 --- project.properties 19 Nov 2003 23:33:17 -0000 1.3 *************** *** 20,22 **** #maven.ui.property.file = ui.properties maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ ! maven.test.skip=false --- 20,22 ---- #maven.ui.property.file = ui.properties maven.repo.remote = http://www.ibiblio.org/maven/,http://dist.codehaus.org/,http://neuclear.org/maven/ ! maven.test.skip=true |
|
From: <pe...@us...> - 2003-11-19 23:33:34
|
Update of /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers
In directory sc8-pr-cvs1:/tmp/cvs-serv12633/src/test/org/neuclear/commons/crypto/signers
Modified Files:
SimpleSignerStoreTest.java TestCaseSignerTest.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: SimpleSignerStoreTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/SimpleSignerStoreTest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SimpleSignerStoreTest.java 12 Nov 2003 23:47:50 -0000 1.2
--- SimpleSignerStoreTest.java 19 Nov 2003 23:32:51 -0000 1.3
***************
*** 1,4 ****
--- 1,13 ----
/* $Id$
* $Log$
+ * Revision 1.3 2003/11/19 23:32:51 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.2 2003/11/12 23:47:50 pelle
* Much work done in creating good test environment.
***************
*** 90,97 ****
import java.io.IOException;
! import java.security.GeneralSecurityException;
! import java.security.KeyPair;
! import java.security.KeyPairGenerator;
! import java.security.SecureRandom;
--- 99,103 ----
import java.io.IOException;
! import java.security.*;
***************
*** 103,107 ****
public SimpleSignerStoreTest(String name) throws GeneralSecurityException, NeuClearException, ConfigurationException {
super(name);
! store = getSignerStoreInstance();
generateKeys();
}
--- 109,113 ----
public SimpleSignerStoreTest(String name) throws GeneralSecurityException, NeuClearException, ConfigurationException {
super(name);
! signer = getSignerStoreInstance();
generateKeys();
}
***************
*** 133,137 ****
boolean success = false;
try {
! store.addKey("root", root.getPrivate());
success = true;
} catch (GeneralSecurityException e) {
--- 139,143 ----
boolean success = false;
try {
! signer.addKey("root", root.getPrivate());
success = true;
} catch (GeneralSecurityException e) {
***************
*** 147,152 ****
byte data[] = null;
try {
! store.addKey("bob", bob.getPrivate());
! data = store.sign("bob", "test".getBytes());
assertTrue(CryptoTools.verify(bob.getPublic(), "test".getBytes(), data));
success = true;
--- 153,158 ----
byte data[] = null;
try {
! signer.addKey("bob", bob.getPrivate());
! data = signer.sign("bob", "test".getBytes());
assertTrue(CryptoTools.verify(bob.getPublic(), "test".getBytes(), data));
success = true;
***************
*** 161,166 ****
}
! private SimpleSigner store;
private static KeyPairGenerator kg;
protected static KeyPair root;
--- 167,182 ----
}
+ public void testGenerateKey() throws CryptoException {
+ PublicKey pub = signer.generateKey("tupac");
+ byte data[] = "this is a test".getBytes();
+ byte sig[] = signer.sign("tupac", data);
+ assertNotNull(sig);
+ assertTrue(CryptoTools.verify(pub, data, sig));
+ assertTrue(signer.canSignFor("tupac"));
!
! }
!
! private SimpleSigner signer;
private static KeyPairGenerator kg;
protected static KeyPair root;
Index: TestCaseSignerTest.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/test/org/neuclear/commons/crypto/signers/TestCaseSignerTest.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TestCaseSignerTest.java 12 Nov 2003 23:47:50 -0000 1.1
--- TestCaseSignerTest.java 19 Nov 2003 23:32:51 -0000 1.2
***************
*** 7,10 ****
--- 7,11 ----
import java.security.GeneralSecurityException;
+ import java.security.PublicKey;
/*
***************
*** 28,31 ****
--- 29,41 ----
$Id$
$Log$
+ Revision 1.2 2003/11/19 23:32:51 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.1 2003/11/12 23:47:50 pelle
Much work done in creating good test environment.
***************
*** 59,62 ****
--- 69,83 ----
}
+ public void testGenerateKey() throws CryptoException {
+ PublicKey pub = signer.generateKey(ALIASEVE);
+ byte data[] = "this is a test".getBytes();
+ byte sig[] = signer.sign(ALIASEVE, data);
+ assertNotNull(sig);
+ assertTrue(CryptoTools.verify(pub, data, sig));
+ assertTrue(signer.canSignFor(ALIASEVE));
+
+
+ }
+
private void testKey(String name) throws CryptoException {
byte sig[] = signer.sign(name, TESTDATA.getBytes());
***************
*** 68,71 ****
--- 89,93 ----
private TestCaseSigner signer;
private String TESTDATA = "Here we go again";
+ private static final String ALIASEVE = "neu://eve@test";
}
|
|
From: <pe...@us...> - 2003-11-19 23:33:34
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers In directory sc8-pr-cvs1:/tmp/cvs-serv12633/src/java/org/neuclear/commons/crypto/signers Modified Files: JCESigner.java Signer.java SimpleSigner.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: JCESigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/JCESigner.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** JCESigner.java 18 Nov 2003 15:07:18 -0000 1.5 --- JCESigner.java 19 Nov 2003 23:32:50 -0000 1.6 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.6 2003/11/19 23:32:50 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.5 2003/11/18 15:07:18 pelle * Changes to JCE Implementation *************** *** 92,99 **** --- 101,110 ---- import org.neuclear.commons.crypto.CryptoException; import org.neuclear.commons.crypto.CryptoTools; + import org.neuclear.commons.crypto.RawCertificate; import org.neuclear.commons.crypto.passphraseagents.PassPhraseAgent; import java.io.*; import java.security.*; + import java.security.cert.Certificate; import java.security.cert.CertificateException; import java.security.interfaces.DSAPublicKey; *************** *** 110,119 **** protected JCESigner(String name, InputStream in, String type, String provider, PassPhraseAgent agent) throws NeuClearException { ! this(loadKeyStore(provider, type, in, agent, name),agent); } private static KeyStore loadKeyStore(String provider, String type, InputStream in, PassPhraseAgent agent, String name) throws NeuClearException { try { ! KeyStore ki=null; if (provider == null) ki = KeyStore.getInstance(type); --- 121,130 ---- protected JCESigner(String name, InputStream in, String type, String provider, PassPhraseAgent agent) throws NeuClearException { ! this(loadKeyStore(provider, type, in, agent, name), agent); } private static KeyStore loadKeyStore(String provider, String type, InputStream in, PassPhraseAgent agent, String name) throws NeuClearException { try { ! KeyStore ki = null; if (provider == null) ki = KeyStore.getInstance(type); *************** *** 136,144 **** } ! public JCESigner(KeyStore ks,PassPhraseAgent agent) { this.agent = agent; this.ks = ks; cache = new KeyCache(ks); } private PrivateKey getKey(String name, char passphrase[]) throws InvalidPassphraseException, NonExistingSignerException, IOException { try { --- 147,163 ---- } ! public JCESigner(KeyStore ks, PassPhraseAgent agent) throws CryptoException { this.agent = agent; this.ks = ks; cache = new KeyCache(ks); + try { + kpg = KeyPairGenerator.getInstance("RSA"); + kpg.initialize(1024, SecureRandom.getInstance("SHA1PRNG")); + } catch (NoSuchAlgorithmException e) { + throw new CryptoException(e); + } + } + private PrivateKey getKey(String name, char passphrase[]) throws InvalidPassphraseException, NonExistingSignerException, IOException { try { *************** *** 204,207 **** --- 223,245 ---- } + /** + * Creates a new KeyPair, stores the PrivateKey using the given alias + * and returns the PublicKey. + * + * @param alias + * @return Generated PublicKey + * @throws org.neuclear.commons.crypto.CryptoException + * + */ + public PublicKey generateKey(String alias) throws CryptoException { + try { + KeyPair kp = kpg.generateKeyPair(); + ks.setKeyEntry(alias, kp.getPrivate(), agent.getPassPhrase(alias), new Certificate[]{new RawCertificate(kp.getPublic())}); + return kp.getPublic(); + } catch (KeyStoreException e) { + throw new CryptoException(e); + } + } + public PublicKey getPublicKey(String name) throws CryptoException { try { *************** *** 216,218 **** --- 254,257 ---- private final PassPhraseAgent agent; + private final KeyPairGenerator kpg; } Index: Signer.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/Signer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Signer.java 11 Nov 2003 21:17:47 -0000 1.1 --- Signer.java 19 Nov 2003 23:32:50 -0000 1.2 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.2 2003/11/19 23:32:50 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.1 2003/11/11 21:17:47 pelle * Further vital reshuffling. *************** *** 70,73 **** --- 79,84 ---- import org.neuclear.commons.crypto.CryptoException; + import java.security.PublicKey; + /** *************** *** 91,94 **** --- 102,106 ---- * @return The signature * @throws org.neuclear.commons.crypto.CryptoException + * */ *************** *** 109,122 **** /** * Checks the key type of the given alias ! * @param name * @return KEY_NONE,KEY_RSA,KEY_DSA ! * @throws CryptoException */ public int getKeyType(String name) throws CryptoException; ! final public static int KEY_NONE=0; ! final public static int KEY_RSA=1; ! final public static int KEY_DSA=2; ! final public static int KEY_OTHER=-1; } --- 121,145 ---- /** * Checks the key type of the given alias ! * ! * @param name * @return KEY_NONE,KEY_RSA,KEY_DSA ! * @throws CryptoException */ public int getKeyType(String name) throws CryptoException; ! /** ! * Creates a new KeyPair, stores the PrivateKey using the given alias ! * and returns the PublicKey. ! * ! * @param alias ! * @return Generated PublicKey ! * @throws CryptoException ! */ ! public PublicKey generateKey(String alias) throws CryptoException; ! ! final public static int KEY_NONE = 0; ! final public static int KEY_RSA = 1; ! final public static int KEY_DSA = 2; ! final public static int KEY_OTHER = -1; } Index: SimpleSigner.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/signers/SimpleSigner.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleSigner.java 12 Nov 2003 18:54:42 -0000 1.2 --- SimpleSigner.java 19 Nov 2003 23:32:50 -0000 1.3 *************** *** 2,5 **** --- 2,14 ---- * $Id$ * $Log$ + * Revision 1.3 2003/11/19 23:32:50 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.2 2003/11/12 18:54:42 pelle * Updated SimpleSignerStoreTest to use a StoredPassPhraseAgent eliminating the popup during testing. *************** *** 90,96 **** import javax.crypto.CipherOutputStream; import java.io.*; ! import java.security.GeneralSecurityException; ! import java.security.KeyFactory; ! import java.security.PrivateKey; import java.security.spec.KeySpec; import java.security.spec.PKCS8EncodedKeySpec; --- 99,103 ---- import javax.crypto.CipherOutputStream; import java.io.*; ! import java.security.*; import java.security.spec.KeySpec; import java.security.spec.PKCS8EncodedKeySpec; *************** *** 117,120 **** --- 124,134 ---- kf = KeyFactory.getInstance("RSA", "BC"); + try { + kpg = KeyPairGenerator.getInstance("RSA"); + kpg.initialize(1024, SecureRandom.getInstance("SHA1PRNG")); + } catch (NoSuchAlgorithmException e) { + throw new CryptoException(e); + } + } catch (IOException e) { throw new NeuClearException(e); *************** *** 235,238 **** --- 249,274 ---- } + /** + * Creates a new KeyPair, stores the PrivateKey using the given alias + * and returns the PublicKey. + * + * @param alias + * @return Generated PublicKey + * @throws org.neuclear.commons.crypto.CryptoException + * + */ + public PublicKey generateKey(String alias) throws CryptoException { + try { + KeyPair kp = kpg.generateKeyPair(); + addKey(alias, agent.getPassPhrase(alias), kp.getPrivate()); + return kp.getPublic(); + } catch (GeneralSecurityException e) { + throw new CryptoException(e); + } catch (IOException e) { + throw new CryptoException(e); + } + + } + private KeyFactory kf; private Map ks; *************** *** 240,242 **** --- 276,279 ---- private final File signerFile; private final PassPhraseAgent agent; + private final KeyPairGenerator kpg; } |
|
From: <pe...@us...> - 2003-11-19 23:33:29
|
Update of /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto
In directory sc8-pr-cvs1:/tmp/cvs-serv12633/src/java/org/neuclear/commons/crypto
Modified Files:
CryptoTools.java
Added Files:
RawCertificate.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.
--- NEW FILE: RawCertificate.java ---
package org.neuclear.commons.crypto;
import java.security.*;
import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
/*
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: RawCertificate.java,v 1.1 2003/11/19 23:32:51 pelle Exp $
$Log: RawCertificate.java,v $
Revision 1.1 2003/11/19 23:32:51 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.
*/
/**
* User: pelleb
* Date: Nov 19, 2003
* Time: 1:37:31 PM
*/
public class RawCertificate extends Certificate {
public RawCertificate(PublicKey pub) {
super("RAW");
this.pub = pub;
}
public byte[] getEncoded() throws CertificateEncodingException {
return pub.getEncoded();
}
/**
* Not Implemented Pure Dummy
*
* @param publicKey
* @throws CertificateException
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
* @throws NoSuchProviderException
* @throws SignatureException
*/
public void verify(PublicKey publicKey) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
;
}
/**
* * Not Implemented Pure Dummy
*
* @param publicKey
* @param string
* @throws CertificateException
* @throws NoSuchAlgorithmException
* @throws InvalidKeyException
* @throws NoSuchProviderException
* @throws SignatureException
*/
public void verify(PublicKey publicKey, String string) throws CertificateException, NoSuchAlgorithmException, InvalidKeyException, NoSuchProviderException, SignatureException {
;
}
public String toString() {
try {
return CryptoTools.formatAsURLSafe(CryptoTools.digest(getEncoded()));
} catch (Exception e) {
return "error";
}
}
public PublicKey getPublicKey() {
return pub;
}
private final PublicKey pub;
}
Index: CryptoTools.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-commons/src/java/org/neuclear/commons/crypto/CryptoTools.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** CryptoTools.java 18 Nov 2003 23:34:55 -0000 1.2
--- CryptoTools.java 19 Nov 2003 23:32:50 -0000 1.3
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.3 2003/11/19 23:32:50 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.2 2003/11/18 23:34:55 pelle
* Payment Web Application is getting there.
***************
*** 179,182 ****
--- 188,192 ----
import org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher;
import org.bouncycastle.crypto.params.KeyParameter;
+ import org.bouncycastle.jce.interfaces.ECPrivateKey;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
***************
*** 396,402 ****
Signature sig = null;
if (key instanceof RSAPrivateKey)
! sig = Signature.getInstance("SHA1withRSA"); // Set up signature object.
else if (key instanceof DSAPrivateKey)
! sig = Signature.getInstance("SHA1withDSA");
sig.initSign(key); // Initialize with my private signing key.
--- 406,414 ----
Signature sig = null;
if (key instanceof RSAPrivateKey)
! sig = Signature.getInstance("SHA1withRSA", "BC"); // Set up signature object.
else if (key instanceof DSAPrivateKey)
! sig = Signature.getInstance("SHA1withDSA", "BC");
! else if (key instanceof ECPrivateKey)
! sig = Signature.getInstance("SHA1withECDSA", "BC");
sig.initSign(key); // Initialize with my private signing key.
***************
*** 408,415 ****
Signature sig = null;
if (pk instanceof DSAPublicKey) {
! sig = Signature.getInstance("SHA1withDSA"); // Set up signature object.
sigvalue = convertXMLDSIGtoASN1(sigvalue);
} else if (pk instanceof RSAPublicKey) {
! sig = Signature.getInstance("SHA1withRSA");
}
sig.initVerify(pk); // Initialize with my private signing key.
--- 420,427 ----
Signature sig = null;
if (pk instanceof DSAPublicKey) {
! sig = Signature.getInstance("SHA1withDSA", "BC"); // Set up signature object.
sigvalue = convertXMLDSIGtoASN1(sigvalue);
} else if (pk instanceof RSAPublicKey) {
! sig = Signature.getInstance("SHA1withRSA", "BC");
}
sig.initVerify(pk); // Initialize with my private signing key.
|
|
From: <pe...@us...> - 2003-11-19 23:33:05
|
Update of /cvsroot/neuclear/neuclear-pay
In directory sc8-pr-cvs1:/tmp/cvs-serv12523
Modified Files:
project.xml
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: project.xml
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/project.xml,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** project.xml 18 Nov 2003 23:34:30 -0000 1.11
--- project.xml 19 Nov 2003 23:32:21 -0000 1.12
***************
*** 165,168 ****
--- 165,174 ----
</properties>
</dependency>
+ <dependency>
+ <id>servletapi</id>
+ <name>servletapi</name>
+ <version>2.3</version>
+ </dependency>
+
</dependencies>
|
|
From: <pe...@us...> - 2003-11-19 23:33:04
|
Update of /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/receiver In directory sc8-pr-cvs1:/tmp/cvs-serv12523/src/test/org/neuclear/asset/receiver Modified Files: PaymentReceiverTest.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: PaymentReceiverTest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/test/org/neuclear/asset/receiver/PaymentReceiverTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PaymentReceiverTest.java 12 Nov 2003 23:47:05 -0000 1.4 --- PaymentReceiverTest.java 19 Nov 2003 23:32:20 -0000 1.5 *************** *** 20,29 **** import org.neuclear.tests.AbstractReceiverTest; import org.neuclear.xml.XMLException; - import org.neuclear.xml.XMLTools; ! import java.io.File; ! import java.io.FileNotFoundException; ! import java.io.FileOutputStream; ! import java.io.OutputStream; import java.security.GeneralSecurityException; --- 20,25 ---- import org.neuclear.tests.AbstractReceiverTest; import org.neuclear.xml.XMLException; ! import java.io.*; import java.security.GeneralSecurityException; *************** *** 48,51 **** --- 44,56 ---- $Id$ $Log$ + Revision 1.5 2003/11/19 23:32:20 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.4 2003/11/12 23:47:05 pelle Much work done in creating good test environment. *************** *** 108,112 **** */ public class PaymentReceiverTest extends AbstractReceiverTest { ! public PaymentReceiverTest(String string) throws NeuClearException, GeneralSecurityException, UnknownLedgerException, LowlevelLedgerException, BookExistsException, FileNotFoundException, InvalidTransferException, XMLException { super(string); asset = (Asset) NSResolver.resolveIdentity(assetName); --- 113,117 ---- */ public class PaymentReceiverTest extends AbstractReceiverTest { ! public PaymentReceiverTest(String string) throws NeuClearException, GeneralSecurityException, UnknownLedgerException, LowlevelLedgerException, BookExistsException, IOException, InvalidTransferException, XMLException { super(string); asset = (Asset) NSResolver.resolveIdentity(assetName); *************** *** 168,176 **** } ! public void createPayments(Identity from, Identity to, double amount) throws InvalidTransferException, XMLException, NeuClearException, FileNotFoundException { TransferRequestBuilder transfer = new TransferRequestBuilder(asset, from, to, 100, TimeTools.now(), "Test One"); ! transfer.sign(getSigner()); ! OutputStream out = new FileOutputStream(directory.getAbsolutePath() + "/" + transfer.getLocalName() + ".xml"); ! XMLTools.writeFile(out, transfer.getElement()); } --- 173,182 ---- } ! public void createPayments(Identity from, Identity to, double amount) throws InvalidTransferException, XMLException, NeuClearException, IOException, UnsupportedEncodingException { TransferRequestBuilder transfer = new TransferRequestBuilder(asset, from, to, 100, TimeTools.now(), "Test One"); ! SignedNamedObject signed = transfer.sign(getSigner()); ! OutputStream out = new BufferedOutputStream(new FileOutputStream(directory.getAbsolutePath() + "/" + transfer.getLocalName() + ".xml")); ! out.write(signed.getEncoded().getBytes("UTF-8")); ! } |
|
From: <pe...@us...> - 2003-11-19 23:33:03
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/remote
In directory sc8-pr-cvs1:/tmp/cvs-serv12523/src/java/org/neuclear/asset/remote
Modified Files:
AssetControlClient.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: AssetControlClient.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/remote/AssetControlClient.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** AssetControlClient.java 12 Nov 2003 23:47:05 -0000 1.5
--- AssetControlClient.java 19 Nov 2003 23:32:20 -0000 1.6
***************
*** 4,14 ****
import org.neuclear.asset.contracts.HeldTransferReceipt;
import org.neuclear.asset.contracts.TransferReceipt;
! import org.neuclear.asset.contracts.builders.CancelHeldTransferRequestBuilder;
! import org.neuclear.asset.contracts.builders.CompleteHeldTransferRequestBuilder;
! import org.neuclear.asset.contracts.builders.HeldTransferRequestBuilder;
! import org.neuclear.asset.contracts.builders.TransferRequestBuilder;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.signers.Signer;
! import org.neuclear.xml.xmlsec.XMLSecurityException;
/*
--- 4,12 ----
import org.neuclear.asset.contracts.HeldTransferReceipt;
import org.neuclear.asset.contracts.TransferReceipt;
! import org.neuclear.asset.contracts.builders.*;
import org.neuclear.commons.NeuClearException;
import org.neuclear.commons.crypto.signers.Signer;
! import org.neuclear.id.SignedNamedObject;
! import org.neuclear.xml.XMLException;
/*
***************
*** 32,35 ****
--- 30,42 ----
$Id$
$Log$
+ Revision 1.6 2003/11/19 23:32:20 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.5 2003/11/12 23:47:05 pelle
Much work done in creating good test environment.
***************
*** 86,109 ****
}
! public TransferReceipt performTransfer(TransferRequestBuilder req) throws NeuClearException, XMLSecurityException {
! req.sign(signer);
! return (TransferReceipt) req.getAsset().send(req);
}
! public HeldTransferReceipt performHeldTransfer(HeldTransferRequestBuilder req) throws NeuClearException, XMLSecurityException {
! req.sign(signer);
! return (HeldTransferReceipt) req.getAsset().send(req);
}
! public TransferReceipt performCompleteHeld(CompleteHeldTransferRequestBuilder req) throws NeuClearException, XMLSecurityException {
! req.sign(signer);
! return (TransferReceipt) req.getAsset().send(req);
}
! public CancelHeldTransferReceipt performCancelHeld(CancelHeldTransferRequestBuilder req) throws NeuClearException, XMLSecurityException {
! req.sign(signer);
! return (CancelHeldTransferReceipt) req.getAsset().send(req);
}
private final Signer signer;
--- 93,116 ----
}
! public TransferReceipt performTransfer(TransferRequestBuilder req) throws NeuClearException, XMLException {
! return (TransferReceipt) send(req);
}
!
! public HeldTransferReceipt performHeldTransfer(HeldTransferRequestBuilder req) throws NeuClearException, XMLException {
! return (HeldTransferReceipt) send(req);
}
! public TransferReceipt performCompleteHeld(CompleteHeldTransferRequestBuilder req) throws NeuClearException, XMLException {
! return (TransferReceipt) send(req);
}
! public CancelHeldTransferReceipt performCancelHeld(CancelHeldTransferRequestBuilder req) throws NeuClearException, XMLException {
! return (CancelHeldTransferReceipt) req.getAsset().send(req.sign(signer));
}
+ private SignedNamedObject send(TransferBuilder req) throws NeuClearException, XMLException {
+ return req.getAsset().send(req.sign(signer));
+ }
private final Signer signer;
|
|
From: <pe...@us...> - 2003-11-19 23:33:03
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/receiver/servlet
In directory sc8-pr-cvs1:/tmp/cvs-serv12523/src/java/org/neuclear/asset/receiver/servlet
Modified Files:
AssetControllerServlet.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: AssetControllerServlet.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/receiver/servlet/AssetControllerServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AssetControllerServlet.java 18 Nov 2003 23:34:29 -0000 1.1
--- AssetControllerServlet.java 19 Nov 2003 23:32:20 -0000 1.2
***************
*** 33,36 ****
--- 33,45 ----
$Id$
$Log$
+ Revision 1.2 2003/11/19 23:32:20 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.1 2003/11/18 23:34:29 pelle
Payment Web Application is getting there.
***************
*** 65,68 ****
--- 74,92 ----
e.printStackTrace();
}
+ }
+
+ public Asset getAsset() {
+ final byte test[] = "one two three".getBytes();
+ test[0] = 0;
+
+ return asset;
+ }
+
+ public String getServiceid() {
+ return serviceid;
+ }
+
+ public String getDatasource() {
+ return datasource;
}
|
|
From: <pe...@us...> - 2003-11-19 23:33:03
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts
In directory sc8-pr-cvs1:/tmp/cvs-serv12523/src/java/org/neuclear/asset/contracts
Modified Files:
Asset.java AssetTransactionContract.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: Asset.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/Asset.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Asset.java 12 Nov 2003 23:47:04 -0000 1.6
--- Asset.java 19 Nov 2003 23:32:19 -0000 1.7
***************
*** 9,13 ****
import org.neuclear.id.NamedObjectReader;
import org.neuclear.id.SignedNamedObject;
- import org.neuclear.id.builders.NamedObjectBuilder;
import org.neuclear.senders.SoapSender;
import org.neuclear.xml.xmlsec.KeyInfo;
--- 9,12 ----
***************
*** 38,41 ****
--- 37,49 ----
$Id$
$Log$
+ Revision 1.7 2003/11/19 23:32:19 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.6 2003/11/12 23:47:04 pelle
Much work done in creating good test environment.
***************
*** 102,109 ****
* @throws NeuClearException
*/
! public SignedNamedObject send(NamedObjectBuilder obj) throws NeuClearException {
! if (obj.isSigned())
! return SoapSender.quickSend(assetController, obj);
! throw new NeuClearException("Object wasnt signed");
}
--- 110,115 ----
* @throws NeuClearException
*/
! public SignedNamedObject send(SignedNamedObject obj) throws NeuClearException {
! return SoapSender.quickSend(assetController, obj);
}
Index: AssetTransactionContract.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/AssetTransactionContract.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** AssetTransactionContract.java 12 Nov 2003 23:47:04 -0000 1.3
--- AssetTransactionContract.java 19 Nov 2003 23:32:20 -0000 1.4
***************
*** 21,28 ****
* $Id$
* $Log$
* Revision 1.3 2003/11/12 23:47:04 pelle
* Much work done in creating good test environment.
* PaymentReceiverTest works, but needs a abit more work in its environment to succeed testing.
! *
* Revision 1.2 2003/11/11 21:17:19 pelle
* Further vital reshuffling.
--- 21,37 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/11/19 23:32:20 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.3 2003/11/12 23:47:04 pelle
* Much work done in creating good test environment.
* PaymentReceiverTest works, but needs a abit more work in its environment to succeed testing.
! * <p/>
* Revision 1.2 2003/11/11 21:17:19 pelle
* Further vital reshuffling.
|
|
From: <bug...@ve...> - 2003-11-19 23:18:55
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Wed, 19 Nov 2003 6:17 PM
Now implements getEncoded().
NamedObjectBuilder.sign() returns a verified SignedNamedObject
---------------------------------------------------------------------
View the issue:
http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=NEU-18
Here is an overview of the issue:
---------------------------------------------------------------------
Key: NEU-18
Summary: Need to store full xml within SignedNamedObject
Type: Improvement
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Identity
Fix Fors:
0.8
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Wed, 19 Nov 2003 4:27 PM
Updated: Wed, 19 Nov 2003 6:17 PM
Description:
Currently the SignedNamedObject can not regenerate its own XML when required. Leaving the NamedObjectBuilder for that task.
This isnt really good as NamedObjectBuilder isnt immutable and is clunky.
The solution would seem to store a byte array containing the xml within each SignedNamedObject. Given an OutputStream this could be written out.
Maybe there should be an getEncoded() instead.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://devone.veraxpay.com:9090/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2003-11-19 21:29:15
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=NEU-18 Here is an overview of the issue: --------------------------------------------------------------------- Key: NEU-18 Summary: Need to store full xml within SignedNamedObject Type: Improvement Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Identity Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Wed, 19 Nov 2003 4:27 PM Updated: Wed, 19 Nov 2003 4:27 PM Description: Currently the SignedNamedObject can not regenerate its own XML when required. Leaving the NamedObjectBuilder for that task. This isnt really good as NamedObjectBuilder isnt immutable and is clunky. The solution would seem to store a byte array containing the xml within each SignedNamedObject. Given an OutputStream this could be written out. Maybe there should be an getEncoded() instead. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 21:24:38
|
Message: Work on this issue has been started by Pelle Braendgaard (mailto:pe...@ve...) --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=PAY-6 Here is an overview of the issue: --------------------------------------------------------------------- Key: PAY-6 Summary: Create Asset Controller Servlet Type: New Feature Status: In Progress Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Payments Fix Fors: 0.3 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Tue, 18 Nov 2003 6:08 PM Updated: Wed, 19 Nov 2003 4:21 PM Description: The AssetControl server is a wrapper around the AssetControlReceiver. This should also allow JSP's etc in the web application a way of receiving information about the Asset. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 18:55:21
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Wed, 19 Nov 2003 1:56 PM
Added and implemented for both SimpleSigner and JCESigner
---------------------------------------------------------------------
View the issue:
http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=COM-3
Here is an overview of the issue:
---------------------------------------------------------------------
Key: COM-3
Summary: Add generateKey() method to Signer
Type: New Feature
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Commons
Fix Fors:
r_0_5
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Wed, 19 Nov 2003 12:51 PM
Updated: Wed, 19 Nov 2003 1:56 PM
Description:
generateKey will generate a KeyPair using its default algorithm and key size.
It will store the PrivateKey using whatever means and return a PublicKey.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://devone.veraxpay.com:9090/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|
|
From: <bug...@ve...> - 2003-11-19 17:50:58
|
Message: Work on this issue has been started by Pelle Braendgaard (mailto:pe...@ve...) --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=COM-3 Here is an overview of the issue: --------------------------------------------------------------------- Key: COM-3 Summary: Add generateKey() method to Signer Type: New Feature Status: In Progress Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Commons Fix Fors: r_0_5 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Wed, 19 Nov 2003 12:51 PM Updated: Wed, 19 Nov 2003 12:52 PM Description: generateKey will generate a KeyPair using its default algorithm and key size. It will store the PrivateKey using whatever means and return a PublicKey. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 17:50:24
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=COM-3 Here is an overview of the issue: --------------------------------------------------------------------- Key: COM-3 Summary: Add generateKey() method to Signer Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Commons Fix Fors: r_0_5 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Wed, 19 Nov 2003 12:51 PM Updated: Wed, 19 Nov 2003 12:51 PM Description: generateKey will generate a KeyPair using its default algorithm and key size. It will store the PrivateKey using whatever means and return a PublicKey. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 17:28:21
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=GL-17 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-17 Summary: Create LedgerStatementServlet Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Fix Fors: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Wed, 19 Nov 2003 12:29 PM Updated: Wed, 19 Nov 2003 12:29 PM Description: Similar to LedgerBrowserServlet, but displays summary information for an account. Summary Information should be as follows: - Amount of Transactions in Period - Sum of Inward Cashflow in Period - Sum of Outgoing Cashflow in Period - Starting and end balances --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 17:25:25
|
Message: A new issue has been created in JIRA. --------------------------------------------------------------------- View the issue: http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=GL-16 Here is an overview of the issue: --------------------------------------------------------------------- Key: GL-16 Summary: Create LedgerBrowserServlet Type: New Feature Status: Open Priority: Major Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: NeuClear Ledger Fix Fors: r_0_4 Assignee: Pelle Braendgaard Reporter: Pelle Braendgaard Created: Wed, 19 Nov 2003 12:26 PM Updated: Wed, 19 Nov 2003 12:26 PM Description: Create a LedgerBrowserServlet, which will format and page the items for a particular account a ledger. The Servlet should be setup in its Init parameters with information about: - The Ledger Instance to use - The Ledger ID The account in mention will be determined by a request parameter. AccessControl should be done outside of this Servlet in a filter. --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://devone.veraxpay.com:9090/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |
|
From: <bug...@ve...> - 2003-11-19 17:16:22
|
Message:
The following issue has been closed.
Resolver: Pelle Braendgaard
Date: Wed, 19 Nov 2003 12:17 PM
Added silent passphrase entry using the excellent JLine library. Should work on both Windows and Unix (Thus I assume Mac as well).
---------------------------------------------------------------------
View the issue:
http://devone.veraxpay.com:9090/secure/ViewIssue.jspa?key=COM-2
Here is an overview of the issue:
---------------------------------------------------------------------
Key: COM-2
Summary: Need to Mask input on CommandLineAgent
Type: Improvement
Status: Closed
Priority: Major
Resolution: FIXED
Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown
Project: NeuClear Commons
Fix Fors:
r_0_5
Assignee: Pelle Braendgaard
Reporter: Pelle Braendgaard
Created: Tue, 18 Nov 2003 3:49 PM
Updated: Wed, 19 Nov 2003 12:17 PM
Description:
Current implementation mirrors the typed passphrase.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://devone.veraxpay.com:9090/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|