O'Reilly logo

Effective XML: 50 Specific Ways to Improve Your XML by Elliotte Rusty Harold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Encryption Syntax

I'm going to give you just a brief overview of what an encrypted XML document looks like. As with digital signatures (which use a lot of the same math), the arithmetic is far too complex for most humans to do by hand. You'll always use a software application or library to encrypt documents. Encrypted XML isn't intended to be authored by a text editor like normal XML.

When a document or portion of a document is encrypted, that part is replaced by an EncryptedData element like the one that follows.

<EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#"
  Type="URI" MimeType="MIME type" Encoding="URI">
    <EncryptionMethod Algorithm="URI"/>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
      <EncryptedKey>
        Base64-encoded, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required