|
From: Pelle B. <pe...@us...> - 2004-03-22 20:20:09
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11947/src/java/org/neuclear/id Modified Files: Identity.java SignatureRequest.java Log Message: Added simple ledger for unit testing and in memory use Index: Identity.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/Identity.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Identity.java 18 Feb 2004 00:14:31 -0000 1.30 --- Identity.java 22 Mar 2004 20:09:49 -0000 1.31 *************** *** 2,5 **** --- 2,8 ---- * $Id$ * $Log$ + * Revision 1.31 2004/03/22 20:09:49 pelle + * Added simple ledger for unit testing and in memory use + * * Revision 1.30 2004/02/18 00:14:31 pelle * Many, many clean ups. I've readded Targets in a new method. *************** *** 44,49 **** * NamedObjectBuilder/SignedNamedObject Pairs. * Sample application has been expanded with a basic email application. ! * Updated docs for sample web app. ! * Added missing LGPL LICENSE.txt files to signer and sample app * * Revision 1.23 2003/12/10 23:58:51 pelle --- 47,52 ---- * NamedObjectBuilder/SignedNamedObject Pairs. * Sample application has been expanded with a basic email application. ! * Updated docs for simple web app. ! * Added missing LGPL LICENSE.txt files to signer and simple app * * Revision 1.23 2003/12/10 23:58:51 pelle *************** *** 357,371 **** /** * Constructor for creating an Identity object for a "Nymous" Identity. * @param pub */ ! public Identity(final PublicKey pub){ ! this(new SignedNamedCore(pub),pub,null,null); } ! protected Identity(final SignedNamedCore core, final PublicKey pub,String signer,Targets targets) { super(core); this.pub = pub; ! this.targets=(targets!=null)?targets:Targets.EMPTY; ! this.signer=Utility.denullString(signer,DEFAULT_SIGNER); } --- 360,375 ---- /** * Constructor for creating an Identity object for a "Nymous" Identity. + * * @param pub */ ! public Identity(final PublicKey pub) { ! this(new SignedNamedCore(pub), pub, null, null); } ! protected Identity(final SignedNamedCore core, final PublicKey pub, String signer, Targets targets) { super(core); this.pub = pub; ! this.targets = (targets != null) ? targets : Targets.EMPTY; ! this.signer = Utility.denullString(signer, DEFAULT_SIGNER); } *************** *** 398,402 **** private final PublicKey pub; ! private final Targets targets; private final String signer; --- 402,406 ---- private final PublicKey pub; ! private final Targets targets; private final String signer; *************** *** 410,414 **** * Returns the fixed Root PublicKey */ ! final static synchronized PublicKey getRootPK() { try { if (nsrootpk == null) --- 414,418 ---- * Returns the fixed Root PublicKey */ ! final static synchronized PublicKey getRootPK() { try { if (nsrootpk == null) *************** *** 424,428 **** public NeuClearCertificate(Identity id) { super("NeuClear"); ! this.id=id; } --- 428,432 ---- public NeuClearCertificate(Identity id) { super("NeuClear"); ! this.id = id; } *************** *** 471,474 **** --- 475,479 ---- return getName(); } + private final Identity id; } *************** *** 484,497 **** public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { ! 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 Targets targets=Targets.parseList(elem); ! final Element se=elem.element("Signer"); ! final String signer=(se!=null)?se.getTextTrim():null; ! return new Identity(core, pub,signer,targets); } catch (XMLSecurityException e) { ! throw new InvalidNamedObjectException(core.getName(),e); } } --- 489,502 ---- public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { ! 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 Targets targets = Targets.parseList(elem); ! final Element se = elem.element("Signer"); ! final String signer = (se != null) ? se.getTextTrim() : null; ! return new Identity(core, pub, signer, targets); } catch (XMLSecurityException e) { ! throw new InvalidNamedObjectException(core.getName(), e); } } Index: SignatureRequest.java =================================================================== RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/SignatureRequest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** SignatureRequest.java 18 Feb 2004 00:14:32 -0000 1.14 --- SignatureRequest.java 22 Mar 2004 20:09:49 -0000 1.15 *************** *** 27,30 **** --- 27,33 ---- $Id$ $Log$ + Revision 1.15 2004/03/22 20:09:49 pelle + Added simple ledger for unit testing and in memory use + Revision 1.14 2004/02/18 00:14:32 pelle Many, many clean ups. I've readded Targets in a new method. *************** *** 91,95 **** Revision 1.3 2003/11/18 00:01:55 pelle ! The sample signing web application for logging in and out is now working. There had been an issue in the canonicalizer when dealing with the embedded object of the SignatureRequest object. --- 94,98 ---- Revision 1.3 2003/11/18 00:01:55 pelle ! The simple signing web application for logging in and out is now working. There had been an issue in the canonicalizer when dealing with the embedded object of the SignatureRequest object. *************** *** 117,121 **** */ public final class SignatureRequest extends SignedNamedObject { ! private SignatureRequest(final SignedNamedCore core, final String userid, final Builder unsigned, final String description) { super(core); this.userid = userid; --- 120,124 ---- */ public final class SignatureRequest extends SignedNamedObject { ! private SignatureRequest(final SignedNamedCore core, final String userid, final Builder unsigned, final String description) { super(core); this.userid = userid; *************** *** 129,133 **** public final Builder getUnsigned() { ! return (Builder) unsigned.clone(); } --- 132,136 ---- public final Builder getUnsigned() { ! return (Builder) unsigned.clone(); } *************** *** 144,150 **** */ public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { ! InvalidNamedObjectException.assertElementQName(core,elem,createNEUIDQName(SIGREQUEST_TAG)); ! final Element request = InvalidNamedObjectException.assertContainsElementQName(core,elem,createNEUIDQName("Unsigned")); ! final String userid = InvalidNamedObjectException.assertAttributeQName(core,elem,createNEUIDQName("userid")); final Element uelem = ((Element) request.elements().get(0)).createCopy(); final Document doc = DocumentHelper.createDocument(uelem); --- 147,153 ---- */ public final SignedNamedObject read(final SignedNamedCore core, final Element elem) throws InvalidNamedObjectException { ! InvalidNamedObjectException.assertElementQName(core, elem, createNEUIDQName(SIGREQUEST_TAG)); ! final Element request = InvalidNamedObjectException.assertContainsElementQName(core, elem, createNEUIDQName("Unsigned")); ! final String userid = InvalidNamedObjectException.assertAttributeQName(core, elem, createNEUIDQName("userid")); final Element uelem = ((Element) request.elements().get(0)).createCopy(); final Document doc = DocumentHelper.createDocument(uelem); *************** *** 158,162 **** return new SignatureRequest(core, userid, unsigned, description); } catch (XMLSecurityException e) { ! throw new InvalidNamedObjectException(core.getName(),e); } } --- 161,165 ---- return new SignatureRequest(core, userid, unsigned, description); } catch (XMLSecurityException e) { ! throw new InvalidNamedObjectException(core.getName(), e); } } |