Exploring XML Encryption, Part 1

Demonstrating the secure exchange of structured data

Return to article.

Listing 10. Using the <Transforms> element and XPath to refer to a particular node of the external XML File
<?xml version='1.0' ?> 
<EncryptedData  ID="Enc-Data" xmlns='http://www.w3.org/2001/04/xmlenc#'
					 Type='http://www.w3.org/2001/04/xmlenc#Element' >
	<CipherReference URI="http://www.waxsys.com/EncFile.xml" >	
		<Transforms  xmlns:ds="http://www.w3.org/2000/09/xmldsig#" >
      		<ds:Transform 	Algorithm="http://www.w3.org/TR/1999/REC-xpath-19991116">
	            	<wax:XPath xmlns:wax="http://www.waxsys.com/xpathNS">
		       		PruchaseOrder/EncryptedData [@Id="Imran-Enc-Data"]    
	            	</wax:XPath>
			</ds:Transform>
          </Transforms>
	</CipherReference>
</EncryptedData>

Return to article.