Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
Library - xbmcdrm

Kodi's DRM class. More...

Classes

class  XBMCAddon::xbmcdrm::CryptoSession
 

Functions

 XBMCAddon::xbmcdrm::CryptoSession::CryptoSession (String UUID, String cipherAlgorithm, String macAlgorithm)
 
 XBMCAddon::xbmcdrm::CryptoSession::~CryptoSession () override
 
 XBMCAddon::xbmcdrm::CryptoSession::GetKeyRequest (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::GetPropertyString (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::ProvideKeyResponse (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::RemoveKeys (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::RestoreKeys (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::SetPropertyString (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::Decrypt (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::Encrypt (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::Sign (...)
 
 XBMCAddon::xbmcdrm::CryptoSession::Verify (...)
 

Detailed Description

Kodi's DRM class.

Class: xbmcdrm.CryptoSession(UUID, cipherAlgorithm, macAlgorithm)

Parameters
UUIDString 16 byte UUID of the DRM system to use
cipherAlgorithmString algorithm used for en / decryption
macAlgorithmString algorithm used for sign / verify
Exceptions
RuntimeExceptionif the session can not be established

v18 Python API changes:
New class added.

Function Documentation

◆ CryptoSession()

XBMCAddon::xbmcdrm::CryptoSession::CryptoSession ( String  UUID,
String  cipherAlgorithm,
String  macAlgorithm 
)

◆ Decrypt()

Buffer XBMCAddon::xbmcdrm::CryptoSession::Decrypt (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> Decrypt(cipherKeyId, input, iv) </big></font></span></code></h4> \endhtmlonly

Sets a system specific property value in the DRM system

Parameters
[byte]cipherKeyId
[byte]input
[byte]iv
Returns
Decrypted input data

v18 Python API changes:
New function added.

◆ Encrypt()

Buffer XBMCAddon::xbmcdrm::CryptoSession::Encrypt (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> Encrypt(cipherKeyId, input, iv) </big></font></span></code></h4> \endhtmlonly

Sets a system specific property value in the DRM system

Parameters
[byte]cipherKeyId
[byte]input
[byte]iv
Returns
Encrypted input data

v18 Python API changes:
New function added.

◆ GetKeyRequest()

Buffer XBMCAddon::xbmcdrm::CryptoSession::GetKeyRequest (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> GetKeyRequest(init, mimeType, offlineKey, optionalParameters) </big></font></span></code></h4> \endhtmlonly

Generate a key request which is supposed to be send to the key server. The servers response is passed to provideKeyResponse to activate the keys.

Parameters
[byte]init Initialization bytes / depends on key system
StringmimeType Type of media which is xchanged, e.g. application/xml, video/mp4
boolofflineKey Persistant (offline) or temporary (streaming) key
[map]optionalParameters optional parameters / depends on key system
Returns
opaque key request data (challenge) which is send to key server

v18 Python API changes:
New function added.

◆ GetPropertyString()

String XBMCAddon::xbmcdrm::CryptoSession::GetPropertyString (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> GetPropertyString(name) </big></font></span></code></h4> \endhtmlonly

Request a system specific property value of the DRM system

Parameters
StringName name of the property to query
Returns
Value of the requested property

v18 Python API changes:
New function added.

◆ ProvideKeyResponse()

String XBMCAddon::xbmcdrm::CryptoSession::ProvideKeyResponse (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> ProvideKeyResponse(response) </big></font></span></code></h4> \endhtmlonly

Provide key data returned from key server. See getKeyRequest(...)

Parameters
[byte]response Key data returned from key server
Returns
String If offline keays are requested, a keySetId which can be used later with restoreKeys, empty for online / streaming) keys.

v18 Python API changes:
New function added.

◆ RemoveKeys()

void XBMCAddon::xbmcdrm::CryptoSession::RemoveKeys (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> RemoveKeys() </big></font></span></code></h4> \endhtmlonly

removes all keys currently loaded in a session.

Parameters
None
Returns
None

v18 Python API changes:
New function added.

◆ RestoreKeys()

void XBMCAddon::xbmcdrm::CryptoSession::RestoreKeys (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> RestoreKeys(keySetId) </big></font></span></code></h4> \endhtmlonly

restores keys stored during previous provideKeyResponse call.

Parameters
StringkeySetId
Returns
None

v18 Python API changes:
New function added.

◆ SetPropertyString()

void XBMCAddon::xbmcdrm::CryptoSession::SetPropertyString (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> SetPropertyString(name, value) </big></font></span></code></h4> \endhtmlonly

Sets a system specific property value in the DRM system

Parameters
Stringname Name of the property to query
Stringvalue Value of the property to query
Returns
Value of the requested property

v18 Python API changes:
New function added.

◆ Sign()

Buffer XBMCAddon::xbmcdrm::CryptoSession::Sign (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> Sign(macKeyId, message) </big></font></span></code></h4> \endhtmlonly

Sets a system specific property value in the DRM system

Parameters
[byte]macKeyId
[byte]message
Returns
[byte] Signature

v18 Python API changes:
New function added.

◆ Verify()

bool XBMCAddon::xbmcdrm::CryptoSession::Verify (   ...)

@brief \htmlonly <h4><code><span style="font-style: italic;">Function: </span><span style="font-style: bold;"><font color=31363b><big> Verify(macKeyId, message, signature) </big></font></span></code></h4> \endhtmlonly

Sets a system specific property value in the DRM system

Parameters
[byte]macKeyId
[byte]message
[byte]signature
Returns
true if message verification succeded

v18 Python API changes:
New function added.

◆ ~CryptoSession()

XBMCAddon::xbmcdrm::CryptoSession::~CryptoSession ( )
override