3.6 Unsealing

This section contains the following topics:

3.6.1 Unsealing Using the Sealing Sever

Unsealing is the process of converting sealed content back into the original, plaintext content. Unsealing is typically used to convert sealed content that is no longer sensitive back into normal content. Unsealing is an operation that is supported by both Oracle IRM Desktop and the sealing server.

The sealing server supports unsealing. The sealed content is uploaded to the sealing server, the content is decrypted, and the unsealed content is returned to the caller.

3.6.1.1 Uploading Sealed Content

For JAX-WS generated web service proxies, the sealed content is provided as a DataHandler parameter. Using a data handler allows the web service stack to stream the binary content to the server without having to load the complete file into memory.

javax.activation.DataHandler input = new javax.activation.DataHandler(new FileDataSource("example.stml"));

The data source does not have to be a file.

3.6.1.2 Calling unseal

A call to the unseal method results in the unsealed data being returned as a javax.activation.DataHandler. This object can be used to stream the unsealed data into a file or buffer.

SealingServices sealingServices = new SealingServicesService().getSealingServices(new javax.xml.ws.soap.MTOMFeature());
 
javax.activation.DataHandler results = sealingServices.unseal(input);

It is important to enable the MTOM web service feature. This ensures the sealed content is uploaded to the server in the most optimal form. It also avoids java.lang.OutOfMemoryException exceptions if the uploaded file is large.

To call the unseal operation, the authenticated user needs rights that allow the unseal feature to be performed for the classification of the sealed content.

When using the Oracle IRM Server Management Console, the unseal feature is enabled when a role has export constraints of none.

3.6.1.3 Extracting the Content

The DataHandler class can be used to write out the unsealed content to an output stream of the programmer's choice. This example shows the unsealed content being written out to a file.

java.io.FileOutputStream outputStream = new java.io.FileOutputStream("example.html");
 
results.writeTo(outputStream);
 
outputStream.close();

3.6.2 Unsealing Using the IRM Java API

Unsealing is the process of converting sealed content back into the original, plaintext content. Unsealing is typically used to convert sealed content that is no longer sensitive back into normal content. Unsealing is an operation that is supported by both Oracle IRM Desktop and the sealing server. The IRM Java API unseal operation takes an input stream to the sealed data and writes the plain text results to an output stream. The sealed content metadata is also returned from this operation. In the following example, a FileInputStream and FileOutputStream are used to read and write the sealed and unsealed data.

import oracle.irm.engine.content.sealing.SealingOperationsInstance.unseal;
import oracle.irm.engine.content.sealing.ContentDescription;
...
// Sealed content provided as an file
java.io.InputStream input = new java.io.FileInputStream("example.sdoc");
 
// Unsealed content written out to a file
java.io.OutputStream output = new java.io.FileOutputStream("example.doc");
 
// Unseal the content and get the sealed meta-data as a result.
ContentDescription results = unseal(input, output);

The results of the unseal operation can be used to determine the classification of the sealed content.

import oracle.irm.engine.core.classification.Classification;
...
// Extract the classification details
Classification classification = results.getClassification();

Or to examine the custom data embedded in the sealed content. .

import oracle.irm.engine.content.sealing.CustomData;
...
// Extract the custom data details
java.util.Collection<CustomData> customData = results.getCustomData();

To call the unseal operation, the authenticated user needs rights that allow the unseal feature to be performed for the classification of the sealed content.

Unseal Feature:

When using the Oracle IRM Server Management Console, the unseal feature is enabled when a role has export constraints of none.