Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
Library - xbmcdrm

Classes

class  XBMCAddon::xbmcdrm::CryptoSession
 Kodi's DRM class. More...
 

Functions

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

Function: GetKeyRequest(init, mimeType, offlineKey, optionalParameters)


Generate a key request
 
 XBMCAddon::xbmcdrm::CryptoSession::GetPropertyString (...)
 

Function: GetPropertyString(name)


Request a system specific property value of the DRM system.
 
 XBMCAddon::xbmcdrm::CryptoSession::ProvideKeyResponse (...)
 

Function: ProvideKeyResponse(response)


Provide a key response
 
 XBMCAddon::xbmcdrm::CryptoSession::RemoveKeys (...)
 

Function: RemoveKeys()


Removes all keys currently loaded in a session.
 
 XBMCAddon::xbmcdrm::CryptoSession::RestoreKeys (...)
 

Function: RestoreKeys(keySetId)


Restores session keys stored during previous ProvideKeyResponse call.
 
 XBMCAddon::xbmcdrm::CryptoSession::SetPropertyString (...)
 

Function: SetPropertyString(name, value)


Set a system specific property value in the DRM system.
 
 XBMCAddon::xbmcdrm::CryptoSession::Decrypt (...)
 

Function: Decrypt(cipherKeyId, input, iv)


Decrypt an encrypted data by using session keys.
 
 XBMCAddon::xbmcdrm::CryptoSession::Encrypt (...)
 

Function: Encrypt(cipherKeyId, input, iv)


Encrypt data by using session keys.
 
 XBMCAddon::xbmcdrm::CryptoSession::Sign (...)
 

Function: Sign(macKeyId, message)


Generate a DRM encrypted signature for a text message.
 
 XBMCAddon::xbmcdrm::CryptoSession::Verify (...)
 

Function: Verify(macKeyId, message, signature)


Verify the validity of a DRM signature of a text message.
 

Detailed Description

Function Documentation

◆ Decrypt()

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

Function: Decrypt(cipherKeyId, input, iv)


Decrypt an encrypted data by using session keys.

Parameters
cipherKeyIdbyte - Encryption key id (provided from a service handshake)
inputbyte - Cipher text to decrypt
ivbyte - Initialization vector of cipher text
Returns
Decrypted input data

v18 Python API changes
New function added.
v19 Python API changes
With python 3 all arguments need to be of type bytearray instead of byte.

◆ Encrypt()

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

Function: Encrypt(cipherKeyId, input, iv)


Encrypt data by using session keys.

Parameters
cipherKeyIdbyte - Encryption key id (provided from a service handshake)
inputbyte - Encrypted text
ivbyte - Initialization vector of encrypted text
Returns
byte - Encrypted input data

v18 Python API changes
New function added.
v19 Python API changes
With python 3 all arguments need to be of type bytearray instead of byte.

◆ GetKeyRequest()

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

Function: GetKeyRequest(init, mimeType, offlineKey, optionalParameters)


Generate a key request

Generate a key request, used for request/response exchange between the app and a license server to obtain or release keys used to decrypt encrypted content. After the app has received the key request response from the license server, it should deliver to the response to the DRM instance using the method ProvideKeyResponse, to activate the keys.

Parameters
initbyte - Initialization bytes container-specific data, its meaning is interpreted based on the mime type provided in the mimeType parameter. It could contain, for example, the content ID, key ID or other data required in generating the key request.
mimeTypestring - Type of media which is exchanged (e.g. "application/xml", "video/mp4")
offlineKeybool - Specifies the type of the request. The request may be to acquire keys for Streaming or Offline content
optionalParameters[opt] map - Will be included in the key request message to allow a client application to provide additional message parameters to the server
Returns
byte - The opaque key request data (challenge) which is send to key server

v18 Python API changes
New function added.
v19 Python API changes
With python 3 the init param must be a bytearray instead of byte.

◆ GetPropertyString()

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

Function: GetPropertyString(name)


Request a system specific property value of the DRM system.

Parameters
Namestring - 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 ( ...)

Function: ProvideKeyResponse(response)


Provide a key response

When a key response is received from the license server, must be sent to the DRM instance by using provideKeyResponse. See also GetKeyRequest.

Parameters
responsebyte - Key data returned from the license server
Returns
A keySetId if the response is for an offline key requests which can be used later with restoreKeys, else return empty for streaming key requests.

v18 Python API changes
New function added.
v19 Python API changes
With python 3 the response argument must be a bytearray instead of byte.

◆ RemoveKeys()

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

Function: RemoveKeys()


Removes all keys currently loaded in a session.


v18 Python API changes
New function added.

◆ RestoreKeys()

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

Function: RestoreKeys(keySetId)


Restores session keys stored during previous ProvideKeyResponse call.

Parameters
keySetIdstring - Identifies the saved key set to restore. This value must never be null.

v18 Python API changes
New function added.

◆ SetPropertyString()

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

Function: SetPropertyString(name, value)


Set a system specific property value in the DRM system.

Parameters
namestring - Name of the property. This value must never be null.
valuestring - Value of the property to set. This value must never be null.

v18 Python API changes
New function added.

◆ Sign()

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

Function: Sign(macKeyId, message)


Generate a DRM encrypted signature for a text message.

Parameters
macKeyIdbyte - HMAC key id (provided from a service handshake)
messagebyte - Message text on which to base the signature
Returns
byte - Signature

v18 Python API changes
New function added.
v19 Python API changes
With python 3 all arguments need to be of type bytearray instead of byte.

◆ Verify()

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

Function: Verify(macKeyId, message, signature)


Verify the validity of a DRM signature of a text message.

Parameters
macKeyIdbyte - HMAC key id (provided from a service handshake)
messagebyte - Message text on which the signature is based
signaturebyte - The signature to verify
Returns
true when the signature is valid

v18 Python API changes
New function added.
v19 Python API changes
With python 3 for all arguments is needed to pass bytearray instead of byte.