Perl Module to encapsulate OMA DRM format for a media type

Open Mobile Alliance (OMA) is a standards body founded by telecommunication companies which develops open standards for the mobile phone industry. In order to ensure interoperability across all implementations for Digital Rights Management (DRM), the OMA provides DRM specifications so that content providers, operators and mobile phone manufacturers can easily integrate the DRM solution as smoothly as possible.

I have created Net::OmaDrm Perl module so that content providers can format the content-type quickly.

This module support the OMA DRM version 1.0 method of sending content to the handset. A device will declare the support for OMA-DRM by including one of the method which is provided by this module:

  • Forward-lock
    • Content-Type
      • application/vnd.oma.drm.message
  • Combined delivery
    • Content-Type
      • application/vnd.oma.drm.message
      • application/vnd.oma.drm.rights+xml
    • o-ex:permission
      • o-dd:display
      • o-dd:play
    • o-ex:constraint
      • o-dd:count
      • o-dd:interval

A detailed document of OMA-DRM can be found at:
http://www.openmobilealliance.org/release_program/drm_v1_0.html

I have tested this module on perl v5.8.5.

INSTALL
To install, do the following:

perl Makefile.PL
make
make install


The following is a perldoc of this module:

SYNOPSIS


use Net::OmaDrm;

my $mydrm = Net::OmaDrm->new($basepath);
my $content= $mydrm->genForwardLock($content_name,$content_type);

DESCRIPTION
This module will encapsulate the media type to a multi-type content with OMA DRM standard.

METHODS
new, this method is used to create the OmaDrm object.

Usage:


my $mydrm = Net::OmaDrm->new($basepath);

The complete list of arguments is:

  • $basepath : This is the base path for the content.

genForwardLock, this method will generate the Forward Lock DRM with an input Media Type.

Usage:


my $content= $mydrm->genForwardLock($content_name,$content_type);

The complete list of arguments is:

  • $content_name : File name of the content.
  • $content_type : Content Type.

genCombinedDelivery, this method will generate multipart content with rights.

Usage:


my $content= $mydrm->genCombinedDelivery($content_name,$content_type,$interval,$count);

Example:


my $content= $mydrm->genCombinedDelivery("image.gif","image/gif","",3);
my $content= $mydrm->genCombinedDelivery("image.gif","image/gif","P30S","");

The complete list of arguments is:

  • $content_name : File name of the content.
  • $content_type : Content Type.
  • $interval : Interval that the content can play.
  • $count : Number of time that the content can play.

Sample Source Code

The following is a full source code sample for your reference:


#!/usr/local/bin/perl
use strict;
use Net::OmaDrm;

my $basepath='images';
my $content_name='logo.gif';
my $content_type='image/gif';
my $interval='P60S';
my $count='';

my $mydrm = Net::OmaDrm->new($basepath);
my $content= $mydrm->genCombinedDelivery($content_name,$content_type,$interval,$count);

print "$content\n";

The above sample source code will input the image file, logo.gif and format the DRM content with display permission of 60 seconds. An example URL for this sample is available at http://www.artofmobile.com/logo.pl. Enter this URL in your WAP browser in your phone and download the content.

You can download the package at Net-OmaDrm-0.10.tar.gz.