xbmc
Classes
Library - xbmcdrm

**Kodi's DRM class. More...

Collaboration diagram for Library - xbmcdrm:

Classes

class  XBMCAddon::xbmcdrm::CryptoSession
 

Detailed Description

**Kodi's DRM class.

**

Offers classes and functions that allow a developer to work with DRM-protected contents like Widevine.

This type of functionality is closely related to the type of DRM used and the service to be implemented.

Using the CryptoSession constructor allow you to have access to a DRM session. With a DRM session you can read and write the DRM properties GetPropertyString, SetPropertyString and establish session keys with GetKeyRequest and ProvideKeyResponse, or resume previous session keys with RestoreKeys.

When the session keys are established you can use these methods to perform various operations: Encrypt / Decrypt for data encryption / decryption, Sign / Verify for make or verify data-signature. Useful for example to implement encrypted communication between a client and the server.

An example where such functionality is useful is the Message Security Layer (MSL) transmission protocol used in some VOD applications. This protocol (or rather framework) is used to increase the level of security in the exchange of messages (such as licences, manifests or other data), which defines a security extension / layer on top of the HTTP protocol.


Constructor for DRM crypto session

{ xbmcdrm.CryptoSession(UUID, cipherAlgorithm, macAlgorithm) }

Parameters
UUIDstring - 16 byte UUID of the DRM system to use
cipherAlgorithmstring - Algorithm used for encryption / decryption ciphers
macAlgorithmstring - Algorithm used for sign / verify
Exceptions
RuntimeExceptionIf the session can not be established

New class added.

Example:

..
uuid_widevine = 'edef8ba9-79d6-4ace-a3c8-27dcd51d21ed'
crypto_session = xbmcdrm.CryptoSession(uuid_widevine, 'AES/CBC/NoPadding', 'HmacSHA256')
..