|
From: Pelle B. <pe...@us...> - 2004-04-01 23:31:08
|
Update of /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4049/src/java/org/neuclear/asset/contracts Modified Files: Asset.java Log Message: Split Identity into Signatory and Identity class. Identity remains a signed named object and will in the future just be used for self declared information. Signatory now contains the PublicKey etc and is NOT a signed object. Index: Asset.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-pay/src/java/org/neuclear/asset/contracts/Asset.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Asset.java 18 Feb 2004 00:13:30 -0000 1.14 --- Asset.java 1 Apr 2004 23:18:32 -0000 1.15 *************** *** 5,13 **** import org.neuclear.id.*; import org.neuclear.id.targets.Targets; - import org.neuclear.xml.xmlsec.KeyInfo; - import org.neuclear.xml.xmlsec.XMLSecTools; - import org.neuclear.xml.xmlsec.XMLSecurityException; - - import java.security.PublicKey; /* --- 5,8 ---- *************** *** 31,34 **** --- 26,34 ---- $Id$ $Log$ + Revision 1.15 2004/04/01 23:18:32 pelle + Split Identity into Signatory and Identity class. + Identity remains a signed named object and will in the future just be used for self declared information. + Signatory now contains the PublicKey etc and is NOT a signed object. + Revision 1.14 2004/02/18 00:13:30 pelle Many, many clean ups. I've readded Targets in a new method. *************** *** 123,128 **** */ public final class Asset extends Identity { ! protected Asset(final SignedNamedCore core, final Targets targets,final PublicKey pub, final int decimal, final double minimumTransaction) { ! super(core, pub,null,targets); //Web services dont have signing urls this.decimal = decimal; this.multiplier = (int) Math.round(Math.pow(10, -decimal)); --- 123,128 ---- */ public final class Asset extends Identity { ! protected Asset(final SignedNamedCore core, final Targets targets, final int decimal, final double minimumTransaction) { ! super(core, null, targets); //Web services dont have signing urls this.decimal = decimal; this.multiplier = (int) Math.round(Math.pow(10, -decimal)); *************** *** 175,193 **** public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().equals(AssetGlobals.NS_ASSET)) ! throw new InvalidNamedObjectException(core.getName(),"Not in XML NameSpace: "+AssetGlobals.NS_ASSET.getURI()); ! final Element allowElement = InvalidNamedObjectException.assertContainsElementQName(core,elem,createNEUIDQName("allow")); ! try { ! final KeyInfo ki = new KeyInfo(InvalidNamedObjectException.assertContainsElementQName(allowElement, XMLSecTools.createQName("KeyInfo"))); ! final PublicKey pub = ki.getPublicKey(); ! final String dec = elem.attributeValue("decimalpoints"); ! final int decimal = (!Utility.isEmpty(dec)) ? Integer.parseInt(dec) : 0; ! final String min = elem.attributeValue("minimumxact"); ! final double minimum = (!Utility.isEmpty(min)) ? Double.parseDouble(min) : 0; ! final Targets targets=Targets.parseList(elem); ! return new Asset(core, targets, pub, decimal, minimum); ! } catch (XMLSecurityException e) { ! throw new InvalidNamedObjectException(core.getName(),e); ! } } --- 175,186 ---- public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { if (!elem.getNamespace().equals(AssetGlobals.NS_ASSET)) ! throw new InvalidNamedObjectException(core.getName(), "Not in XML NameSpace: " + AssetGlobals.NS_ASSET.getURI()); ! final String dec = elem.attributeValue("decimalpoints"); ! final int decimal = (!Utility.isEmpty(dec)) ? Integer.parseInt(dec) : 0; ! final String min = elem.attributeValue("minimumxact"); ! final double minimum = (!Utility.isEmpty(min)) ? Double.parseDouble(min) : 0; ! final Targets targets = Targets.parseList(elem); ! return new Asset(core, targets, decimal, minimum); } |