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);
extendedFileConnection.enableDRMForwardLock();
extendedFileConnection.create();
out = fileConnection.openOutputStream();
out.write();
} catch (Throwable t) {
} finally {
try {
if(out != null) {
out.close();
}
if(extendedFileConnection != null) {
extendedFileConnection.close();
}
} 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.

About Brian Z.

Brian joined Research In Motion (RIM) in 2005 working with Independent Software Vendors (ISVs) who specialize in Bluetooth, GPS, multimedia, and gaming. As a senior member of the Developer Relations Team, it's Brian's mandate to not only support the application development efforts for a number of ISVs, but also to act as a voice at RIM for third party application developers. Like RIM, Brian's roots are in the enterprise world, but over the past couple of years he's quickly adapted to the consumer space, and that's where he spends most of his time today.

Join the conversation

Show comments Hide comments
+ -
blog comments powered by Disqus