I've recently been asked how it is possible to embed Oracle IRM sealed content into a web page like I do on the IRM samples. The current 10g release of IRM only supports IE, therefore I have created some scripts to detect the browser, if the IRM Desktop is installed and then the ability to dynamically write the code for displaying sealed content.
So putting sealed content into a HTML page requires the following;
- Check that the browser being used is supported
- Check that the Oracle IRM desktop is installed
- Write out the object tag to display sealed content
<script language=JavaScript src="scripts/browser_os_sniffer.js"></script>
<script language=VBScript src="scripts/irm_unsealerdetect.vbs"></script>
<script language=JavaScript src="scripts/irm_unsealerdetect.js"></script>
<script language=JavaScript src="scripts/writeSampleCode.js"></script>
Just right click and save as on the links above to get a copy of these files.
Check that the browser being used is supported and the IRM Desktop is installed.
So first off you need to check browser compatibility and ensure the IRM Desktop is installed. irm_unsealerdetect.js contains a function called fnDetectIRMDesktop() which gets called from a function inside writeSampleCode.js called setupSampleCode(), which inturn is called from the HTML <body> tag's onLoad event handler, e.g...<body class="layout-two-column-right main-index" onload="setupSampleCode()">
These functions set a string called strViewer which, after the page loads, contains one of two things.
- If an installation of the IRM Desktop has been detected, strViewer is the version number of the IRM Desktop.
- If no IRM Desktop was detected, strViewer contains a string which details if the browser/os is unsupported or if the Desktop just isn't installed.
So this set of code is a nice way to determine if the end user has the Oracle IRM Desktop installed. I've had customers use this code to do detection and automatically redirect to our download page. Once you know that the IRM Desktop is indeed installed, you can then put into the HTML the code to embed sealed content.
Write out the object tag to display sealed content.
My blog code does this dynamically using the function fnWriteDivContent() but here is the format of the object tag that needs to be in the page.<object classid='clsid:18CEFFD2-A724-11D3-B647-86BD54000000' width="200" height="200">
<param name=src value="/sealed/sample.sjpg">
<param name=banner value="false">
<param name=noscroll value="true">
<embed
width="200"
height="200"
src="/sealed/sample.sjpg"
banner="false"
noscroll="true">
</object>
Pretty simply really, you can see all this in action on the various content in the samples category. Now think about the potential of this. Oracle IRM can protect HTML, JPG, GIF and PNG. These are key formats for web based applications... combine this with the fact there is an Oracle IRM API that allows for the dynamic sealing of content in real time and you are able to build web based applications that can use IRM to protect certain areas of the browser based UI. Good examples of this are banking, financial and engineering web applications or anything that returns personally identifiable information to the browser. I have a demo of this which I hope to be creating a flash video from soon when I get the time.
