[Jsdsi-devel] My jsdsi changes
Status: Pre-Alpha
Brought to you by:
sajma
From: Sean R. <sra...@ae...> - 2004-02-12 19:01:26
|
Sameer, I've had a quick look at my changes and thought I'd let you know some points thus far: 1. Made jsdsi.Obj implement java.io.Serializable for rmi. I think this should really implement the readObject() and writeObject() methods too in order to marshal using SEXPs. 2. jsdsi.Validity had some code added to it by Michael Jaegar: He added some bounds checking to the constructor: public Validity(Date b, Date a, OnlineTest[] t) { // By mic...@in... if( t==null ) { t = new OnlineTest[0]; } notBefore = b; notAfter = a; tests = t; } and similar to the intersect method: public Validity intersect(Validity v) { Date nb = notBefore; if ((nb == null) || (v.notBefore != null && v.notBefore.after(nb))) { nb = v.notBefore; } Date na = notAfter; if ((na == null) || (v.notAfter != null && v.notAfter.before(na))) { na = v.notAfter; } // combine lists of tests OnlineTest[] ts = new OnlineTest[(tests == null ? 0 : tests.length) + (v.tests == null ? 0 : v.tests.length)]; int i = 0; if (tests != null) { System.arraycopy(tests, 0, ts, i, tests.length); i += tests.length; } if (v.tests != null) { System.arraycopy(v.tests, 0, ts, i, v.tests.length); } return new Validity(nb, na, ts); } 3. Michael also added some similar bounds checking to jsdsi.NameCertSelector: public boolean match(jsdsi.Certificate cert) { boolean toReturn = (cert.getCert() instanceof NameCert); // By mic...@in...: if( issuer != null ) { toReturn &= cert.getCert().getIssuer().samePrincipalAs(issuer); } if( name!=null) { toReturn &= ((NameCert) cert.getCert()).getName().equals(name); } return toReturn; /* return (cert.getCert() instanceof NameCert) && cert.getCert().getIssuer().samePrincipalAs(issuer) && ((NameCert) cert.getCert()).getName().equals(name); */ } 4. The rest of the changes/were to do with parsing/unparsing and I'd need to have a more indepth look to find out what. From memory there was one or two bugs and some stuff left to implement, e.g. handling of URLs. What I'll do is run your latest code against my unit tests that I created to test/implement my parsing/unparsing code. And as additional questions: 1. Shouldn't the references to java.net.URLs actually be java.net.URIs? 2. Should the <issuer-loc> (issuer-info) attribute be added to AuthCert? (http://theworld.com/~cme/spki.txt section 4.4) Let me know what you think, regards, Sean -- Dr. Sean Radford, MBBS, MSc sra...@ae... |