Subject: XML-AC - Sample Java Code

From: "Anders Rundgren" <[email-masked]>
Date: Tue, 14 Nov 2000 12:04:37 +0100

Hi,
I would like to give you a programmers view of the XML-AC suggestion.
Assumption: Each AC application has it *own* schema (instead of the current
one-size-fits-all-try-to-guess-this-profile approach). They share a common
header [schema] document though that indicates that they really are an AC etc.

Some "virtual java-code":

ACReader o = new ACReader ();   // Generic code supplied by the "system"
o.read (inputstream);    // Reads the entire AC structure, verifies signatures, checks syntax and
// extracts the AC application-specfic schema

If (!o.getAppSchemaName ().equals ("http://www.server.com/my-database-login-thing")) 
  {
    throw new IOException ("I don't eat this s**t!");
  }

// Now we have the AC data.  Extract it and do something with it

handle = performDBLogin (o.getProp ("UserID"), o.getProp ("Password")); 

 // Note: We KNOW that "UserID" and "Password" exist due to the schema!

With the exception of the data extraction part which probably requires a little more
tree-navigating using DOM/SAX APIs (but not testing), this is what we should get. 
Based on a 100% generic reader-code that does not have to be "adjustable".

===================================================
The above can IMO not be done with the current ASN.1-based AC system.
====================================================

Note: I deliberately excluded the PKC link part but it should have a pretty general
solution hopefully only requiring a few property settings.

Anders R