Re: [Jsdsi-devel] JSDSI xml
Status: Pre-Alpha
Brought to you by:
sajma
|
From: Sean R. <sra...@ae...> - 2004-02-26 13:56:25
|
akin to 'the spec' I would vote for something like the later: (name (public-key ...) alice bob) becomes <name> <public-key>...</public-key> <local-name>alice</local-name> <local-name>bob</local-name> </name> with maybe an (optional) index attribute on the local-name: <name> <public-key>...</public-key> <local-name index="0">alice</local-name> <local-name index="1">bob</local-name> </name> Sean On Thu, 2004-02-26 at 13:05, Sameer Ajmani wrote: > > Hmm... Those possible changes to the SExp just seem to make them more > > verbose just for XML... > Right. The alternative is to wrap each base SexpString in its own element: > CarolJones > becomes > <string val="CarolJones"/> > or <string>CarolJones</string> > > > Have you seen this: > I glanced at these specs some time age. We should aim to support this > spec whatever the SPKI working group (or Carl Ellison) uses. > > > http://bladesys.demon.co.uk/roller/resources/sradford/draft-orri-spki-xml-cert-struc-00.txt > > Thanks, > Sameer > > > > > Sean > > > > On Wed, 2004-02-25 at 18:41, Sameer Ajmani wrote: > >> > (at first I wondering if the placing of the 'local name' of > >> CarolJones was correct, but I think it is the right thing to do - > >> not many xml documents have a tag and a text value as direct > >> children of another tag). > >> > >> Yes, the string interspersed with elements are ugly (and maybe a > >> problem). > >> I'll try to write an XmlReader that inverts this process sometime > >> soon, > >> and hopefully that will complain if this is invalid XML :) It also > >> may be problematic if XML concatenates adjacent strings, e.g., (name > >> (public-key ...) mary friends) will become: > >> <name> > >> <public-key>...</public-key> > >> mary friends > >> </name> > >> > >> XML will read "mary friends" as a single block of character data, > >> while SPKI treasts it as two SexpStrings. My XmlReader will handle > >> this just fine, but the XML form lacks some structural information. > >> > >> An alternative is to make SPKI's syntax more XML-compatible by > >> restricting its S-expressions to SexpLists thatcontain one SexpString > >> or an arbitrary number of SexpLists. So the above name object would > >> be: > >> (name (public-key ...) (id mary) (id friends)) > >> > >> While this is ugly in the "name" case, it actually makes some other > >> structures clearer: > >> > >> (hash md5 |hfslk782yf2|) > >> becomes: > >> (hash (algo md5) (value |hfslk782yf2|)) > >> > >> (k-of-n "2" "3" > >> (public-key ...) (public-key ...) (public-key ...)) > >> becomes: > >> (k-of-n (k "2") (n "3") > >> (public-key ...) (public-key ...) (public-key ...)) > >> > >> This change would require consulting with the SPKI designers (I could > >> contact Carl Ellison about this). > >> > >> Sameer > >> > >> > On Wed, 2004-02-25 at 02:54, Sameer Ajmani wrote: > >> >> I have just committed a simple Sexp-to-XML converter to JSDSI. > >> This makes it possible to express JSDSI objects as XML (by first > >> converting them to S-expressions). I added the package jsdsi.xml > >> and the class jsdsi.xml.XmlWriter, and extended the jsdsi.S2X > >> utility to support xml output. Here's an example: > >> >> > >> >> Input S-expression: > >> >> > >> >> (cert > >> >> (issuer > >> >> (name > >> >> (public-key > >> >> (rsa-pkcs1-md5 > >> >> (e #010001#) > >> >> (n > >> >> |AKd6zpHoNSq53rFFZ6XZV5m+YZKr1Ym9fUMuE8yHMOZx9AsrWqkZyMxZ9Cn > >> >> 5mIPaTLqYEakoJ7lir25a/Nq1IpvFC8mlalpI2LINDRnIt3HbmiFEj97Eaqk > >> >> 2ffhwXotFHIbPGyrgrMobOtWIpG56Ru5AK230lG68+ZyntCqB53v5|))) > >> >> CarolJones)) > >> >> (subject > >> >> (public-key > >> >> (rsa-pkcs1-md5 > >> >> (e #010001#) > >> >> (n > >> >> |AK0aiccf7Yj/Gzx93m6R6suJiPr5o9ZON6dG31wwDyGK2aKoMJUYLxVMWGh5R > >> >> 2Wsc+RO+ylvablNhmO7zGiZ9qNiN+vdTjdxMALx4ULFF1aYNi86QsSgU/x8Xrk > >> 2SiHQ9EkHGDJ7Bpng+4LNSjQtm2DuEscHP3mqz8BzGB+jTek/|))))) > >> >> > >> >> Output XML: > >> >> > >> >> <cert> > >> >> <issuer> > >> >> <name> > >> >> <public-key> > >> >> <rsa-pkcs1-md5> > >> >> <e> > >> >> #010001# > >> >> </e> > >> >> <n> > >> >> |AKd6zpHoNSq53rFFZ6XZV5m+YZKr1Ym9fUMuE8yHMOZx9AsrWqkZyMxZ9Cn5 > >> >> mIPaTLqYEakoJ7lir25a/Nq1IpvFC8mlalpI2LINDRnIt3HbmiFEj97Eaqk2 > >> >> ffhwXotFHIbPGyrgrMobOtWIpG56Ru5AK230lG68+ZyntCqB53v5| > >> >> </n> > >> >> </rsa-pkcs1-md5> > >> >> </public-key> > >> >> CarolJones > >> >> </name> > >> >> </issuer> > >> >> <subject> > >> >> <public-key> > >> >> <rsa-pkcs1-md5> > >> >> <e> > >> >> #010001# > >> >> </e> > >> >> <n> > >> >> |AK0aiccf7Yj/Gzx93m6R6suJiPr5o9ZON6dG31wwDyGK2aKoMJUYLxVMWGh5R2 > >> >> Wsc+RO+ylvablNhmO7zGiZ9qNiN+vdTjdxMALx4ULFF1aYNi86QsSgU/x8Xrk2 > >> SiHQ9EkHGDJ7Bpng+4LNSjQtm2DuEscHP3mqz8BzGB+jTek/| > >> >> </n> > >> >> </rsa-pkcs1-md5> > >> >> </public-key> > >> >> </subject> > >> >> </cert> > >> >> > >> >> The problems with this are that it's not terribly compact (e.g., > >> the "e" elements could be all on one line), I'm not sure whether > >> all the characters used in the text blocks are allowed, there's no > >> schema or DTD, and there's no XmlReader (yet). But does this > >> conversion look reasonable? > >> >> > >> >> Sameer > >> >> > >> >> http://ajmani.net > >> >> > >> >> > >> >> > >> >> > >> >> > >> >> ------------------------------------------------------- > >> >> SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >> >> Build and deploy apps & Web services for Linux with > >> >> a free DVD software kit from IBM. Click Now! > >> >> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >> >> _______________________________________________ > >> >> Jsdsi-devel mailing list > >> >> Jsd...@li... > >> >> https://lists.sourceforge.net/lists/listinfo/jsdsi-devel > >> > -- > >> > Dr. Sean Radford, MBBS, MSc > >> > sra...@ae... > >> > http://www.aegeus-technology.com > >> > >> > >> http://ajmani.net > >> > >> > >> > >> > >> > >> ------------------------------------------------------- > >> SF.Net is sponsored by: Speed Start Your Linux Apps Now. > >> Build and deploy apps & Web services for Linux with > >> a free DVD software kit from IBM. Click Now! > >> http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click > >> _______________________________________________ > >> Jsdsi-devel mailing list > >> Jsd...@li... > >> https://lists.sourceforge.net/lists/listinfo/jsdsi-devel > > -- > > Dr. Sean Radford, MBBS, MSc > > sra...@ae... > > http://www.aegeus-technology.com > > > http://ajmani.net > -- Dr. Sean Radford, MBBS, MSc sra...@ae... http://www.aegeus-technology.com |