28
1 XML Special Topics Emerging Technologies II DCS861A Professor Chuck Tappert Spring 2003 Version 1.5 – March 2003 Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University School of Computer Science and Information Systems

Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

  • Upload
    noura

  • View
    42

  • Download
    2

Embed Size (px)

DESCRIPTION

XML Special Topics Emerging Technologies II DCS861A Professor Chuck Tappert Spring 2003 Version 1.5 – March 2003. Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University School of Computer Science and Information Systems. Overview – What is XML?. - PowerPoint PPT Presentation

Citation preview

Page 1: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

1

XML Special Topics

Emerging Technologies IIDCS861A

Professor Chuck TappertSpring 2003

Version 1.5 – March 2003

Team 3Eric Cole

Anthony GottliebStella Konstantinou

David Ulmer

Pace UniversitySchool of Computer Science and Information Systems

Page 2: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

2

Overview – What is XML?

• eXtensible Markup Language (XML), meaning unlike HTML, the tags are not predefined

• A set of rules for defining semantic tags that break a document into parts and identify the different parts of the document

• A meta-markup language or a language for defining other languages

• Allows designers to develop any arbitrary set of tags to describe meaning and hierarchical structure of data

• It is nonproprietary

• Allows for the design of domain-specific markup languages

Page 3: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

3

Overview – Historical Background

• XML version 1.0 is published from the World Wide Web Consortium (W3C) in 1998

• XML is a true profile/subset of the Standard Generalized Markup Language (SGML)

• SGML is complex– HTML evolved from it but was limited in scope to data

formatting– XML evolved from both to deal with complexity and

the minimal scope of HTML

• XML describes data – HTML describes format

Page 4: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

4

Overview – Advantages of XML

• The data is self-describing• The data can be manipulated with standard

tools (e.g., text editor)• The data can be viewed with standard tools

(e.g., browser)• Different views of the same data are easy to

create with style sheets • Support of Unicode

Page 5: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

5

XML Design Goals

• XML shall be straightforwardly usable over the Internet;• XML shall support a wide variety of applications;• XML shall be compatible with SGML;• It shall be easy to write programs which process XML

documents;• The number of optional features in XML is to be kept to the

absolute minimum, ideally zero;• XML documents should be human-legible and reasonably

clear;• The XML design should be prepared quickly;• The design of XML shall be formal and concise;• XML documents shall be easy to create;• Terseness in XML markup is of minimal importance.

Page 6: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

6

Overview – An XML Example<?xml version="1.0" ?>   <!DOCTYPE SEASON (View Source for full doctype...)> <!– Baseball Example -->- <SEASON>  <YEAR>1998</YEAR> - <LEAGUE>  <LEAGUE_NAME>American</LEAGUE_NAME> - <DIVISION>  <DIVISION_NAME>Central</DIVISION_NAME> - <TEAM>  <TEAM_CITY>Chicago</TEAM_CITY>   <TEAM_NAME>White Sox</TEAM_NAME> - <PLAYER>  <GIVEN_NAME>Jim</GIVEN_NAME>

  <SURNAME>Abbott</SURNAME>   <POSITION>Starting Pitcher</POSITION>   <GAMES>5</GAMES>   <GAMES_STARTED>5</GAMES_STARTED>

  <WINS>5</WINS>   <LOSSES>0</LOSSES>   <SAVES>0</SAVES>   <COMPLETE_GAMES>0</COMPLETE_GAMES>

  <SHUT_OUTS>0</SHUT_OUTS>   <ERA>4.55</ERA>   <INNINGS>31.2</INNINGS>   <HITS_AGAINST>35</HITS_AGAINST> <HOME_RUNS_AGAINST>2</HOME_RUNS_AGAINST>   <RUNS_AGAINST>16</RUNS_AGAINST>   <EARNED_RUNS>16</EARNED_RUNS>   <HIT_BATTER>1</HIT_BATTER>   <WILD_PITCHES>0</WILD_PITCHES>   <BALK>0</BALK>   <WALKED_BATTER>12</WALKED_BATTER>   <STRUCK_OUT_BATTER>14</STRUCK_OUT_BATTER>

  </PLAYER></TEAM>

</DIVISION></LEAGUE>

</SEASON>

Page 7: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

7

Overview – The Internals of an XML Document

• XML declaration/prolog– Version attribute (name-value pair, e.g., XYZ=1.0)– <?xml version="1.0" encoding="ISO-8859-1"?>

• Document type declaration–   <!DOCTYPE SEASON (View Source for full doctype...)>

• Comments– <!– Baseball Example -->

• Elements and Attributes – <message to="[email protected]" – from="[email protected]"     – subject="XML Is Really Cool">   – </message>

• Root element– <SEASON>

• Start and End tags and text– <LEAGUE_NAME>American</LEAGUE_NAME>

• Well-formed (correct syntax)• XML uses Document Type Definition (DTD) or Schemas to describe the

structure of the data• Valid (conforms to a DTD)

Page 8: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

8

Overview – Examples of some XML-based Markup Languages

• Chemical Markup Language (CML)• Mathematical Markup Language (MathML)• Information Content Exchange (ICE)• Electronic business XML (ebXML)

Page 9: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

9

Overview – XML Document Life Cycle

Page 10: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

10

Document Type Definition (DTD)

• XML based

• Can be included in XML document

• Not extensible

<!ELEMENT slideshow (slide+)> <!ELEMENT slide (title, item*)> <!ELEMENT title (#PCDATA)> <!ELEMENT item (#PCDATA | item)* >

Page 11: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

11

Overview – DTD versus Schemas

Popular XML Schema Features:

• Built in mechanisms for constraining document structures and content

• Ability to embed documentation

• Constraints based on document class

• Provision of direct support for extensions

• Support of keys and referential integrity constraints

• Ability to validate documents composed from markup from multiple namespaces resulting in sharing of data by multiple organizations

• Integration with primitive data types

• Mechanisms enabling inheritance for element, attribute, and data type definitions to formally represent kind-of (for example, an oak is a kind-of tree) and part-of relationships.

Page 12: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

12

XML Transformations

Extensible Stylesheet Language Transformations (XSLT) – XSLT enables and empowers interoperability

– It uses XML vocabularies as its target to transform XML documents into other text formats such as HTML, WML, XML, PDF, etc. or a different XML document that conforms to another DTD

– An XSLT Stylesheet describes rules for transforming a source tree (or input tree) into a separate result tree

XML Path Language (XPath), a common syntax and semantics used by XSLT to address parts of an XML document and associate them with other information

Page 13: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

13

The XSLT Processing Model

The XSLT processor parses the source document to produce a tree representation based on the document contents and structures

– Each generated node includes the node type, node name and either the node text content or, in the absence of text content, an asterisk

– The top level of the tree is the document root. – The second level includes the document root’s children (for example,

document element, XML declaration, processing instructions, etc.).

Page 14: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

14

The XSLT Processing ModelXSLT relies on a parser to convert the XML document

into a tree structure– The Simple API for XML (SAX), an event-based interface where the

application is notified by the parser of individual document information while the document is read

– The Document Object Model (DOM) parser, a platform and language independent interface that allows dynamic access and update of the content, structure and style of documents

Page 15: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

15

The XSLT Processing Model (elements)

– Template rules apply to nodes to match the pattern specified by the templateDEMO TEMPLATES:

<xsl:template match="/MENULIST"> … </xsl:template> <xsl:template match="NAME">…</xsl:template>

• XSL elements provide flexibility and control over data

• Essential elements for display data

– Ascending/Descending sorting capability DEMO SORT ELEMENT: <xsl:sort select="NAME" order="ascending" /> …</xsl:sort>

Page 16: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

16

The XSLT Processing Model (elements)– value-of element - Extracts the value of the selected node

DEMO VALUE-OF: <xsl:value-of select="NAME" />

– conditional elements:– choose – set up the template– when – if condition is true apply associated rules– Otherwise – if condition is false apply associated rules

DEMO CONDITIONAL ELEMENTS: <TD ID="graph" VALIGN="MIDDLE" HEIGHT="100">

<xsl:choose> <xsl:when test="GRAPHIC[. !='']"> <INPUT TYPE="IMAGE" NAME="pict"> <xsl:attribute name="SRC"> <xsl:value-of select="GRAPHIC" /> </xsl:attribute> </INPUT> </xsl:when> </xsl:choose> </TD>

Page 17: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

17

Demo set up and execute instructions1. Unzip contents in a directory2. Compile the Transform.java (Requires 1.2 and up)

– Start DOS session– Go to directory where Transform.java is– Type at the prompt>javac Transform.java– Hit enter

3. Execute program. The program takes 3 arguments: (a) an input xml document, a XSL Stylesheet and the output XHTML document that will hold the results of the transformation)– Start DOS session– Go to directory described in step 1.– Type at the prompt>java Transform menuitems.xml

MenuXSL.xsl NameOfHTMLoutput.html– Go to the directory described in step 1. Find the

NameOfHTMLoutput.html document. – Run NameOfHTMLoutput.html

Page 18: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

18

Architecture of XML Security

• The XML language has specific tags reserved for dealing with security related information.

• The XML security standards use current XML tags whenever possible to try and make the information as secure as possible.

• The XML security standards can be applied to any part of the XML language. This includes documents, elements and element content.

• XML security can be provided end-to-end in transit. This type of security is very similar to the security provided by SSL and TLS.

• XML security builds on existing measures whenever possible. For example for digital certificates it does not reinvent the wheel, it uses X.509 certificates. Other hash algorithms like SHA are also incorporated directly into XML.

Page 19: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

19

XML-based Security Standards

• XML uses digital signatures for integrity, non-repudiation and signatures. This is done through using hash algorithms with public private key pairs.

• XML encryption for confidentiality. This is achieved through using various forms of symmetric key encryption.

• XML key management (XKMS) which is done through encryption and X.509 certificates.

• SAML or the security assertion markup language used for authorization and authentication.

• XACML or the XML access control markup language for adding in authorization rules.

Page 20: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

20

XML Digital Signatures

• Entire XML documents including specific elements within the document. What is also interesting is that different elements within the document can be signed by different people and than the entire document signed by a completely different person.

• Any XML format including straight ASCII or binary files.• Multiple documents or multiple elements across documents.

Since one person might be responsible for several documents or for certain elements with various documents, the digital signature can be applied across many files or data structures.

• Allows XML components or documents to be counter-signed by multiple entities to ensure the validity across many parties.

Page 21: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

21

XML Digital Signatures

<CustomerRecord xmlns="http://www.somestore.org/"> <Name> Frank Smith</Name> <Account> 555345 </Account> <Visit date="11pm April 14, 2002"> <Order> Ordered 10 widgets </Order> </Visit> <Signature xmlns='http://www.w3.org/2001/11/xmldsig#'> ... </Signature></CustomerRecord>

The signature can also be in a separate file as shown:

<Signature xmlns='http://www.w3.org/2001/11/xmldsig#'> <SignedInfo> ... </SignedInfo> <SignatureValue> ... </SignatureValue> <Object> <SignatureProperties> <p:Purpose xmlns:p="http://www.someexample.com/schemas"> Approval </p:Purpose> </SignatureProperties> </Object></Signature>

A signature directly embedded within an XML data structure:

Page 22: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

22

XML Encryption

• The process used for encrypting data in XML is similar to most other applications:– a symmetric key is generated and used to encrypt the data

– the symmetric key is than encrypted with the public key of a recipient

– the two pieces of encryption are put together and either stored on the system or sent across the wire

<CustomerRecord xmlns="http://www.somestore.org/"> <Name> Frank Smith</Name> <Account> 555345 </Account> <Visit date="11pm April 14, 2002"> <Order> Ordered 10 widgets </Order> </Visit> <EncryptedData Type='element'> ... </EncryptedData>

<Signature xmlns='http://www.w3.org/2001/11/xmldsig#'> ... </Signature></CustomerRecord>

Page 23: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

23

XML-based Key Management

• Key to the XML Trust Model is the relationship between the XML Signature and Encryption standards and the XML Key Management Specification.

• The XML Key Management Specification (XKMS) provides the programming interface for web developers to such services.

• (XKMS) Design Criteria:– To be compatible with the XML-Signature and XML-Encryption standards– Implementation should be simple (All Cryptographic actions stay within XML

Signature & Encryption)– ASN.1 tools are not required (Data Definition for Telecommunications)– Management of status information is transparent to a public-key using

application in an on-line environment– Minimize client code and configuration complexity. (Providing standardized

protocols and interfaces)

Page 24: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

24

The (X-KISS) & (X-KRSS) Specifications• XKMS delegates the distribution of public key services to its XML Key Information

Service Specification (X-KISS) and further delegates the public key registration services to its XML-Key Registration Service Specification (X-KRSS).

• (X-KISS)– The XML-Key Information Service Specification (X-KISS) fetches information related

to a public key. – These pieces of information are referred to by KeyInfo elements and they are used to

authenticate a digital signature associated with an incoming message to the application.

– The signor of the message may or may not attach KeyInfo elements such as their public key to the message.

• (X-KRSS)– The XML Key Registration Service Specification is called upon by clients to:– Register Key (Registration servers may request this too);– Revoke Key– Recover Key

Page 25: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

25

X-KISS Services

• (X-KISS) Locate Service

– The Locate service is called upon by applications to retrieve additional key information which has been inserted into KeyInfo.

– Below, we see a Locate service request by an application (client) who has received a XML document which has been signed. The retrieved KeyInfo element provides for a (URL RetrievalMethod) for an X509 certificate which contains the public key.

<Locate> <Query> <ds:KeyInfo> <ds:RetrievalMethod URL=http://www.somebody.test/Certificates/02191366 Type=http://www.w3.org/2001/09/xmldsig#X509Data/> <ds:KeyInfo> <Query> <Respond> <string>KeyName</string> <string>KeyValue</string> <Respond> <Locate>

Page 26: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

26

X-KISS Services

• (X-KISS) Validate Service– The Validate service is called upon by applications (clients) to assert that

the binding between a public key and a data element is in good standing. – Procedurally, an application (client) will pass to a Trust service, the

elements whose trust binding status is desired.– Below is a fragment of code from an application (client), destined for the

Trust service. It shows a verified document’s binding being queried for its trustworthiness and its validity.

<Validate> <Query> <Status>Valid</Status> <ds:KeyInfo> <ds:KeyName>…</ds:KeyName> <ds:KeyValue>…</ds:KeyValue> <ds:KeyInfo> <Query> <Respond> <string>KeyName</string> <string>KeyValue</string> <Respond> <Validate>

Page 27: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

27

X-KRSS Services• Register Key

– Registering is the generation of a public key pair that is bound to information. – The request for such a binding is called an assertion and is aimed at the registration

service. – Registration requests originating from clients differ from those originating from a service.

A service based assertion will not have included in its prototype, the public key data. • Revoke Key

– A client may revoke an assertion and thus render it invalid. – No key will last indefinitely and it is therefore recommended that a key revocation

certificate be generated at the time the key pair is created. • Recover Key (two approaches)

– First, a key-escrow facility can hold a copy of the owner’s private key that has been serially encrypted in the public keys of that key certification authority. Here, the owner may regain the use of the forgotten private key by first providing strong identification.

– Second, an authorization code could be issued to the client by the certification authority, which will revoke the forgotten private key when the client passes the authorization code back to the service via the application.

Page 28: Team 3 Eric Cole Anthony Gottlieb Stella Konstantinou David Ulmer Pace University

28

XML Demonstration

* * *

XML Transformation