Content Decryption Module Interface Specification
Content Decryption Module Interface Specification
Content Decryption
Module Interface
Specification
An open interface for enabling HTML5 Encrypted
Media Extensions in open source browsers
John C. Simmons
January 2, 2014
Version 1.0
Abstract:
The W3C HTML working group is developing media extension specifications for HTML5 to
enable the delivery of commercial video to consumers over the Web. One of these is the
Encrypted Media Extensions (EME) specification. The current specification describes an open
interface which may be used to implement an EME-compliant Content Decryption Module
(CDM) within a User-agent, providing access to a platform DRM component which supports
the defined Content Decryption Module interface (CDMi).
2014 Microsoft Corporation. All rights reserved.
Legal Notice
2014 Microsoft Corporation. All rights reserved. This document is provided "as-is." The Information
contained in this document, including URL and other Internet Web site references, may change without
notice. You bear the risk of using it.
This document does not provide you with any legal rights to any intellectual property in any Microsoft
product. You may copy and use this document for your internal, reference purposes. You may not
remove any notices from this document.
2-Jan-14/1.0
Contents
1
Introduction ............................................................................. 1
1.1
1.2
1.3
1.4
1.5
Scope ......................................................................................................................... 1
Conventions ............................................................................................................. 1
Terminology, Abbreviations and Acronyms ...................................................... 2
References ................................................................................................................ 4
Revision History...................................................................................................... 5
Architecture ............................................................................................................. 6
CDM Interface Object Model .............................................................................. 7
Cdm_MediaKeys Object ....................................................................................... 8
Cdm_MediaKeySession Object ............................................................................ 9
Figures
Figure 1 Content Decryption Module Interface Entity Relationship Diagram ........................ 6
Figure 2 CDM Interface Object Model .......................................................................................... 7
Tables
Table 1 CDMi Implementation ReadyState ................................................................................... 9
2-Jan-14/1.0
ii
2-Jan-14/1.0
iii
CO N T E N T D E CRY P T I O N M O DU L E
I N T E R FA C E S P E C I F I C A T I O N
VERS ION 1.0
JANUA RY 2, 2014
INTRODUCTION
1.1 SCOPE
An open interface for accessing a platform DRM Content Decryption Module (CDM) which may
be used by a User-agent to expose CDM functionality as specified by the W3C HTML Encrypted
Media Extensions.
1.2 CONVENTIONS
The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD,
SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be
interpreted as described in [RFC2119]. That is:
MUST, REQUIRED and SHALL mean that the definition is an absolute requirement
of the specification.
MUST NOT and SHALL NOT mean that the definition is an absolute prohibition of
the specification.
There are two additional W3C specifications outside the media extensions activity which will become important for
consumer web distribution -Web Cryptography API and Web Crypto Key Discovery.
2 Microsoft will make available to PlayReady licensees a CDMi Implementation designed to work with the PlayReady
Device Porting Kit (Device PK).
1
2-Jan-14/1.0
1.3
SHOULD and RECOMMENDED mean that there may be valid reasons to ignore a
particular item, but the full implications must be understood and carefully weighed
before choosing a different course.
SHOULD NOT and NOT RECOMMENDED mean that there may be valid reasons when
the particular behavior is acceptable, but the full implications should be understood and
the case carefully weighed before implementing any behavior described with this label.
1.3.1 TERMINOLOGY
AppData
Content Decryption
Module (CDM)
Content Decryption
Module interface (CDMi)
CDMi Implementation
CDMi Implementation
License Store
Encrypted Media
Extensions (EME)
Globally Unique
Identifier (GUID)
The AppData field is not yet in the official EME specification but is implemented in IE11 and will be proposed by
Microsoft to the EME specification.
3
2-Jan-14/1.0
Initialization Data
Key
Key Session
Key System
keyadded event
keyerror event
keymessage event
License
License Server
Licensed Product
Media Session
2-Jan-14/1.0
Protection System
Specific Header box
(pssh)
Session ID
Update
User-agent (UA)
1.4
CDMi
EME
GUID
JS
JavaScript
KID
Key Identifier
MSE
UA
User-agent
REFERENCES
[RFC2119]
2-Jan-14/1.0
[DASH]
[DRM]
[ISOBFF]
[KEYDSC]
[MSE]
2-Jan-14/1.0
The Content Decryption Module interface (CDMi) is an open, interoperable interface enabling a
User-agent to implement CDM functionality as provided by a platform DRM. This interface is
exposed by a CDMi Implementation, providing a translation between HTML Encrypted Media
Extension (EME) methods and events to the equivalent functions of the underlying platform
DRM.
The CDMi object model parallels that of the MediaKeys and MediaKeySession objects in the
W3C Encrypted Media Extensions specification [EME] and is intended to have no DRM-provider
specific elements.
2.1 ARCHITECTURE
The relationship of the Content Decryption Module interface Implementation to the browser,
the media engine and the underlying Platform DRM are shown in the Figure 1.
2-Jan-14/1.0
Microsoft will provide to PlayReady licensees a CDMi Implementation on top of the PlayReady Device Porting Kit.
For example, the PlayReady CDMi Implementation incorporates a Media Session interface, to be used by the
PlayReady licensee in the platform to secure content decryption.
4
5
2-Jan-14/1.0
ATTRIBUTE KEYSYSTEM
The Keysystem attribute is a wchar_t * pointer to an identifier of the Key System being used [EME].7
As defined in [EME].
CDM specific data which is passed in some applications with the InitData. 8
Algorithm
1. The CDMi Implementation creates a new Cdm_MediaKeySession object with a ready
state of START
2. The CDMi Implementation sets the Cdm_MediaKeySession SessionId to a random
value a base 64 encoded GUID.
3. The InitData and AppData are parsed and the CDMi Implementation specific data is
extracted from the InitData9.
4. Initialize the DRM Key Session state. This action is CDMi Implementation specific.
Even though Cdm_Init is a CDMi Implementation specific call, it takes the keySystem parameter because the reverse
domain name format is intended to handle versioning, as well.
7 For the Microsoft PlayReady CDMi Implementation, this is com.microsoft.playready.
8 The AppData field is not yet in the official EME specification but is implemented in IE11 and has been proposed by
Microsoft to the EME specification. It enables Application specific information to be carried securely with the license
request.
9 For the ISO Base Media File Format, the CDMi Implementation specific information extracted from initData will be a
Protection System Specific Header box [CENC].
6
2-Jan-14/1.0
Algorithm
1. Return TRUE if Keysys string and type are both supported by the CDMi
Implementation.
Indicates the MediaKeySession has been created but has not yet generated a
keymessage.
pending
ready
2-Jan-14/1.0
error
Algorithm
1. If the CDMi Implementation supports locally cached Licenses, and a License exists in the
CDMi Implementation License Store which can be used with this Key Session:
a. The CDMi Implementation will use the Session Callback object Keyready
method to notify the UA CDM that the Key is ready for us.
2. Else
a. The CDMi Implementation will generate a License challenge to be sent to its
License Server
b. If successful:
- The CDMi Implementation will use the Keymessage method to prompt
the UA CDM to notify the JS application to issue a License Request
message to the specified License Server
- The CDMi Key Session readyState is changed to PENDING.
c. Else
- The CDMi Implementation will use the Session Callback object
keyerror method to notify the UA CDM of the error.
2.4.5 UPDATE METHOD
This method is called by the UA CDM to process a License response.
Use: long Update(const unsigned char *key, unsigned long cb);
key
cb
Pointer to an array of bytes containing the response from the License Server.
Count byte
Algorithm
1. The CDMi Implementation process the response from the License Server.
2-Jan-14/1.0
10
3. Else
a. The CDMi Implementation will use the Session Callback object keyerror
method to inform the UA CDM of the error.
2.4.6 CLOSE METHOD
Used by the UA CDM to close the CDMi Key Session.
Use: void Close();
Algorithm
1. The CDMi Implementation closes the CDMi Key Session.
2.4.7 SESSION CALLBACK OBJECT
The methods in the Callback object are provided by the UA CDM so that the CDMi
Implementation can provide information needed for the [EME] keyready, keyerror and
keymessage events.
2.4.7.1 KEYMESSAGE METHOD
This is a message generated by the CDMi Implementation, passed to the UA CDM and exposed
to the JS Application as a keymessage event. It is likely a message to be sent to the License
Server.
Use: void Keymessage (unsigned int *mesg, unsigned long cbmesg, char
*dest, unsigned long cbdest);
mesg
cbmesg
dest
cbdest
Algorithm
1. The CDMi Implementation will use a DRM specific mechanism to construct the Key
Message.
2-Jan-14/1.0
11
2-Jan-14/1.0
12