This is an experimental reference implementation of XML Encryption Syntax and Processing, which specifies a process for encrypting data and representing the result in XML.
The installation and configuration process can be broken down into the following steps. Windows is used here as an example, but the implementation should work with any platform that has Java2.
samples\ to your classpath for your
convenience.data\enc\ and type:
>java enc.DOMCipher -e keyinfo1.xml
bookorder.xml
"//*[name()='cardinfo']"
template1.xml
where line breaks are only for readability - you should type the
command in a single line. DOMCipher with -e
option encrypts the elements specified by XPaths in a document
according to templates and prints the resulting document to stdout.
In this case, the cardinfo element in bookorder.xml is
encrypted as specified in template1.xml. The
key being used is obtained from the keystore specified in keyinfo1.xml. If the
command works, you can see the package has been installed correctly.
| Application Features | Key Word | Support |
|---|---|---|
| Laxly valid schema generation of EncryptedData/EncryptedKey | MUST | Y |
|
SHOULD | Y |
| Type, MimeType, and Encoding | MUST | Y |
| CipherReference URI derefencing | MUST | Y |
|
OPTIONAL | Y |
| ds:KeyInfo | MUST | Y |
|
OPTIONAL | N |
|
RECOMMENDED | Y |
|
REQUIRED | Y |
| ReferenceList | OPTIONAL | Y |
| EncryptionProperties | OPTIONAL | Y |
| Processing Features | Key Word | Support |
| Required Type support: Element and Content | MUST | Y |
| Encryption | MUST | Y |
|
MAY | Y |
|
MUST | N |
|
MUST | Y |
|
SHOULD | Y |
| Decryption | MUST | Y |
|
MUST | Y |
|
MUST | Y |
|
SHOULD | Y |
| Algorithms | Key Word | Support |
| Triple DES | REQUIRED | Y |
| AES-128 | REQUIRED | Y |
| AES-192 | OPTIONAL | Y |
| AES-256 | REQUIRED | Y |
| RSA-v1.5 | REQUIRED | Y |
| RSA-OAEP | REQUIRED | Y (only with SHA1 and no parameters) |
| Diffie-Hellman | OPTIONAL | N |
| Triple DES Key Wrap | REQUIRED | Y |
| AES-128 Key Wrap | REQUIRED | Y |
| AES-192 Key Wrap | OPTIONAL | Y |
| AES-256 Key Wrap | REQUIRED | Y |
| SHA1 | REQUIRED | Y |
| SHA256 | RECOMMENDED | Y |
| SHA512 | OPTIONAL | Y |
| RIPEMD-160 | OPTIONAL | Y |
| XML Digital Signature | RECOMMENDED | Y (by the XML-Signature implementation) |
| Decryption Transform | RECOMMENDED | Y |
|
OPTIONAL | Y (XPointer of type "#xpointer(id('ID'))" and barename XPointer only) |
| Canonical XML (with and without comments) | OPTIONAL | Y (only for DOM) |
| Exclusive Canonicalization (with and without comments) | OPTIONAL | Y (only for DOM) |
| Base64 | REQUIRED | Y |
Reference to packages, classes and members. This is generated by javadoc.
com.ibm.xml.enc.KeyInfoResolverBase for
recursive key encryptioncom.ibm.xml.enc.EncryptedKeyRetriever
for retrieval of the EncryptedKey elements referencing an IDenc.XMLCipher2 to
enc.XNICipherenc.DOMCipher, a sample application for the
DOM-based implementationenc.XMLSig, a sample application for
Decryption Transform