Explaining Digital Rights Management

Interviews/Thought Leadership

I get asked about digital rights management (DRM) often enough that it’s probably high-time I do some writing about it. For those who don’t know, DRM generically refers to access control software used for limiting usage of digital media. For those that want to know more about what DRM options are available to them on BlackBerry® smartphones, this post will give you everything you should need.

Of the many DRM formats available, BlackBerry supports OMA DRM 1.0 forward lock. If a file protected with OMA DRM 1.0 forward lock is downloaded and installed to the BlackBerry smartphone via the BlackBerry Browser. It will then automatically be encrypted into a format such that the file can only be opened by the BlackBerry smartphone that created the file.

To achieve similar functionality in your own application, in BlackBerry OS 4.2 and above, open a FileConnection, cast it to an ExtendedFileConnection, call ExtendedFileConnection.enableDRMForwardLock() to enable the encryption on the file, create the file, then write out the contents.

ExtendedFileConnection extendedFileConnection = null;
OutputStream out = null;
try {
String filename = ;
extendedFileConnection =
(ExtendedFileConnection) Connector.open(filename);
out = fileConnection.openOutputStream();
} catch (Throwable t) {
} finally {
try {
if(out != null) {
if(extendedFileConnection != null) {
} catch (Throwable t) {

What about applications that need DRM on streaming media or that want to implement their own DRM solution? As you would expect, there’s a little more work involved, but it’s definitely possible. In this case, you’ll need to extend the DataSource class and implement the SourceStream interface. Pass your DataSource instance into the media player, and the device will make calls to your SourceStream’s read() method as it needs to read more media data. So that means that you need to open the connection to your encrypted media data (either local or remote), decrypt and/or buffer it, then simply supply the decrypted data to the read() calls.

To see a sample DataSource / SourceStream implementation, check out the bufferedplaybackdemo in the JDE’s samples directory.

Join the conversation

Show comments Hide comments
+ -