IRM Protector Development Example
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
The following short example describes the basic steps you can take to create a custom integrated IRM protector and integrate it with Windows SharePoint Services. In this example, a developer wants to enable adding rights-managed JPEG images to a document library.
The developer ensures that a client application exists that is capable of handling rights-managed JPEG images. Optionally, the developer could create this application.
For information about creating applications for rights-managed content, see Rights Management Services SDK Documentation.
The developer creates a class that implements the I_IrmProtector Interface.
Depending on the complexity of the file type, the developer may want to write stream operators or other helper functions that call I_IrmCrypt.HrEncrypt Methodand I_IrmCrypt.HrDecrypt Method functions.
Concerned with backward-compatibility, the developer creates a base JPEG image to use as a document template for the developer's I_IrmProtector.HrProtectRMS Method function to use when creating the protected content. The image consists of the text "This is an IRM protected JPEG image. You need to open this image in an IRM-aware application."
The developer implements the functions of the I_IrmProtector interface, as follows:
I_IrmProtector.HrInit Method In this function, the developer includes code that loads the document template into memory, so that it can be referenced quickly by other functions.
I_IrmProtector.HrProtectRMS Method In this function, the developer writes code that adds metadata to an instance of the document template. The code adds the IL, EUL, and the protected content, which the code accesses through the piid argument of the HrProtectRMS method and possibly the stream operators the developer created earlier.
I_IrmProtector.HrUnprotectRMS Method In this function, the developer writes code to extract the IL and EUL from the protected JPEG image, and calls Windows SharePoint Services functions to decrypt the data.
I_IrmProtector.HrIsProtected Property In this function, the developer writes code that examines a JPEG image and checks for the existence of the extra metadata that the developer stores in an IRM-protected JPEG image.
I_IrmProtector.HrSetLangId Method The developer wants to enable IRM-protected JPEG files for a Japanese audience as well. He creates another document template, this time a JPEG image displaying the same message as described previously, but in Japanese. The developer then implements this method, and changes the HrProtectRMS function to load the correct document template based on the stored language ID value.
The developer compiles his protector class as a COM object, registers the object by composing a custom .wxs file, and then applies it to the server registry.