IBM Version 5 Universal Remote User Manual


 
36 The XML Files: Development of XML/XSL Applications Using WebSphere Studio
Examples of XML encryption
The main elements in the XML encryption syntax are the EncryptedData
element and the EncryptedKey element, which derive from the EncryptedType
abstract type. The data to be encrypted can be of an type, being an XML
document, element or element content. The result of encrypting data is an XML
encryption element that contains or references the cipher data. When an element
or element content is encrypted, the EncryptedData element replaces the
element or content in the encrypted version of the XML document.
When the data is encrypted, the EncryptedData element may become the root,
or the child of the XML document. When an whole XML document is encrypted,
then the EncryptedData element may become the root of a new document.
However, the EncryptedData cannot be the parent or child of another
EncryptedData element, but the actual data encrypted can be anything including
existing EncryptedData or EncryptedKey elements.
A simple example follows in Example 2-7.
Example 2-7 Information on passenger John Smith
<?xml version='1.0'?>
<Credit Info xmlns='http://creditOrg.org/bills'>
<Name>John Smith<Name/>
<CreditCard Limit='21,000' Currency='AUD'>
<Credit Card Number>3760 098675 3245</Credit Card Number>
<Issuer>Wells Rago</Issuer>
<Expiry date>05/06</Expiry date>
</CreditCard>
</CreaditInfo>
Here we have selectively encrypted John Smiths credit card details. The
EncryptedData elements now takes the place of the credit card element.
Example 2-8 Encrypted Information on passenger John Smith
<?xml version='1.0'?>
<CreditInfo xmlns='http://creditOrg.org/bills'>
<Name>John Smith<Name/>
<EncryptedData Type=’http://www.w3.org/2001/04/xmlenc#Element'
xmlns=’http://www.w3.org/2001/04/xmlenc#’>
<CipherData>
<CipherValue>W78G12I67</CipherValue>
</CipherData>
</EncryptedData>
</CreditInfo>