This section describes the operations to be performed as part of encryption and decryption processing.
For each data item to be encrypted:
ds:KeyInfo
as approriate
(e.g., ds:KeyName
, ds:KeyValue
,
ds:KeyRetrievalMethod
, etc.)EncryptedKey
element. This may be then be a child of
ds:KeyInfo
, or it may exist elsewhere and may be
identified in the previous step.EncryptedData
Type
attribute.EncryptedData
structure. An
EncryptedData
element represents all of the information
previously discussed including the encryption algorithm, parameters, key,
type of the encrypted data, etc.
CipherData
element within the
EncryptedData
, then the encrypted octet sequence is
base64 encoded and inserted as the text value of a
CipherValue
element.EncryptedData
structure, then represent the URI, and
optional transforms, required for the Decryptor to retrieve the
encrypted octet sequence within a CipherReference
element.Type
of the encrypted data is Element
or Element
Content, implementations MUST be able to return the UTF-8
encoding of the EncryptedData
element to the
application. The application may use this as the top-level element in
a new XML Document or insert it into another XML document.
Encryption applications MUST be able to replace the unencrypted
Element or Content with the EncryptedData
element.. The
application supplies the XML Document context and identifies the
Element or Content being replaced. The Encryptor must remove the
identified XML and insert the EncryptedData
element in
its place.
EncryptedData
element is always returned to the application. The application may
use this as the top-level element in a new XML Document or insert it
into another XML document (which may require a re-encoding).For each EncryptedType
item to be decrypted (either an
EncryptedData
or EncryptedKey
element):
EncryptedType
element to
determine the algorithm, parameters and ds:KeyInfo
element
to be used. If some information is omitted, the application must supply
it.ds:KeyInfo
element, which may contain one or more key attributes. These attributes
have no implied processing order. If the data encryption key is
encrypted, locate the corresponding key to decrypt it. (This may be a
recursive step as the key-encryption key may itself be encrypted.) Or,
one might retrieve the data encryption key from a local store using the
provided attributes or implicit binding.CipherData
element.
CipherValue
child element is present, then the
associated text value is retrieved and base64 decoded so as to obtain
the encrypted octet sequence.CipherReference
child element is present, the URI
and optional transforms are used to retrieve the encrypted octet
sequence. EncryptedData
element(s). The Decryptor should support passing this key value to
the application for persistent storage. If it represents encrypted
data then processing as described below is required.EncryptedData
element with the decrypted Element
or Element
Content represented by the UTF-8 encoded characters. The
Decryptor is not required to perform validation on the serialized XML
nor are they required to ensure the result of this replacement
operation results in a valid XML document.Type
is unspecified or is not Element
or Element
Content
Encryption and decryption operations are transforms on octets. As noted in the preceding discussion, the encrypting application is responsible for the serialization of XML into an octet sequence, and that octets' semantics, such that the decrypted data is useful to the decrypting application.
For example, if the applications wishes to canonicalize its data or
encode/compress the data in an XML packaging format, the application needs to
marshal the XML accordingly and identify the resulting type, which will
encoded in the optional EncryptedData
Type
attribute. The likelihood of successful decryption and subsequent processing
will be dependent on the recipient's support for the given type. Also, if the
data is intended to be processed both before and after decryption (e.g., XML
Signature [XMLDSIG]
validation or an XSLT transform) the encrypting application must be careful
to preserve information necessary for that process's success.
For interoperability purposes, the following types MUST be implemented.
EmptyElemTag
| STag
content
ETag"
[XML]CharData
?
((element
| Reference
| CDSect
| PI |
Comment)
CharData
?)*"
[XML]