Interface ICencDRMInfo
-
- All Known Subinterfaces:
ICencDRMInfo2
public interface ICencDRMInfo
Interface for Common Encryption (CENC) DRM information classes. DRM system-specific metadata can be attached to a stream's CENC data to indicate that a stream or a media segment within that stream is protected by the particular DRM system, and may be authorized and decrypted by a player client using the provided DRM system metadata. The metadata provided by classes implementing ICencDRMInfo is inserted into a stream's manifest and/or fragment files. CENC DRM support is in accordance with the Common Encryption standard (ISO/IEC 23001-7).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deserialize(byte[] data)
Sets all internal class data by deserializing the data from the provided byte buffer representation of the class.byte[]
generateKey(byte[] KID)
Generates a 128-bit content key for use in AES encryption.String
getMPEGDashCPSubElements(boolean keyRotation)
Returns a string defining zero or more custom xml elements to be inserted as sub-elements to the ContentProtection element that defines the DRM system in an MPEG-DASH MPD.String
getNameSpaces()
Returns a string defining zero or more custom xml name space strings to be inserted into an xml-formatted manifest, such as an MPEG-DASH MPD.byte[]
getPsshData(boolean keyRotation)
Returns the DRM system-specific binary data associated with the encryption of the media.String
getSystemId()
Returns the DRM system id.String
getSystemName()
Returns a string defining the DRM system name.String
getURL()
Returns the license acquisition URL.boolean
isComplete()
Verifies whether all required class parameters have been set, such as systemId.byte[]
serialize()
Returns a byte buffer with a serialized representation of the class, which could later be reconstituted back into the class via the deserialize method.void
setPsshData(byte[] psshData)
Sets the DRM system-specific binary data associated with the encryption of the media.void
setSystemId(String systemId)
Sets the DRM system id.void
setURL(String url)
Sets the license acquisition URL.boolean
supportsKeyGeneration()
Verifies whether dynamic key generation is supported.void
updateKeyInfo(byte[] KID, byte[] contentKey)
Sets the new key id and a 128-bit content key values for use in AES encryption.
-
-
-
Method Detail
-
setSystemId
void setSystemId(String systemId)
Sets the DRM system id.Example: "12345678-1234-1234-1234-123456789012"
- Parameters:
systemId
- DRM system id
-
getSystemId
String getSystemId()
Returns the DRM system id.- Returns:
- DRM system id string
-
getURL
String getURL()
Returns the license acquisition URL.- Returns:
- license acquisition URL string
-
setURL
void setURL(String url)
Sets the license acquisition URL.Example: "http://www.mycompany.com/sdrm/rightsmanager.asmx"
- Parameters:
url
- license acquisition URL string
-
getNameSpaces
String getNameSpaces()
Returns a string defining zero or more custom xml name space strings to be inserted into an xml-formatted manifest, such as an MPEG-DASH MPD.Example:
xmlns:sdrma="urn:mycompany:superdrm:a" xmlns:sdrmb="urn:mycompany:superdrm:b"
- Returns:
- zero or more xml name space strings separate by spaces, with a "" or 'null' return indicating no custom namespaces
-
getMPEGDashCPSubElements
String getMPEGDashCPSubElements(boolean keyRotation)
Returns a string defining zero or more custom xml elements to be inserted as sub-elements to the ContentProtection element that defines the DRM system in an MPEG-DASH MPD. The element would typically contain Base64-encoded system-specific metadata.Example:
<sdrma:hdr><!-- base64-encoded data --></sdrma:hdr>
The resulting ContentProtection element would look something like:
<ContentProtection schemeIdUri="urn:uuid:12345678-1234-1234-1234-123456789012" value="SuperDRM">
<sdrma:hdr><!-- base64-encoded data --></sdrma:hdr>
</ContentProtection>- Parameters:
keyRotation
- indicates whether key rotation is enabled- Returns:
- string defining the MPEG-DASH ContentProtection sub-elements
-
getSystemName
String getSystemName()
Returns a string defining the DRM system name. This string would be used as the value of the value attribute in the ContentProtection element that defines the DRM system in an MPEG-DASH MPD.Example:
"SuperDRM"
The resulting ContentProtection element in an MPEG-DASH MPD would look something like:
<ContentProtection schemeIdUri="urn:uuid:12345678-1234-1234-1234-123456789012" value="SuperDRM">
<sdrma:hdr><!-- base64-encoded data --></sdrma:hdr>
</ContentProtection>- Returns:
- string defining the DRM system name
-
supportsKeyGeneration
boolean supportsKeyGeneration()
Verifies whether dynamic key generation is supported. This capability is only required for dynamic random key rotation support.- Returns:
- true if dynamic key generation is supported, else false
- See Also:
generateKey(byte[] KID)
-
generateKey
byte[] generateKey(byte[] KID)
Generates a 128-bit content key for use in AES encryption. Support for this method is only required when dynamic random key generation & rotation is supported.- Parameters:
KID
- key id for which a content key should be generated- Returns:
- byte buffer containing the generated content key, or null if not supported
- See Also:
supportsKeyGeneration()
-
updateKeyInfo
void updateKeyInfo(byte[] KID, byte[] contentKey)
Sets the new key id and a 128-bit content key values for use in AES encryption. Support for this method is only required in a Common Encryption scenario where dynamic random key generation & rotation is supported.- Parameters:
KID
- new key id in effectcontentKey
- new content key in effect- See Also:
supportsKeyGeneration()
-
serialize
byte[] serialize()
Returns a byte buffer with a serialized representation of the class, which could later be reconstituted back into the class via the deserialize method.- Returns:
- byte buffer containing a serialized representation of the class
- See Also:
deserialize(byte[] data)
-
deserialize
void deserialize(byte[] data)
Sets all internal class data by deserializing the data from the provided byte buffer representation of the class.- Parameters:
data
- byte buffer containing the serialized representation of the class- See Also:
serialize()
-
getPsshData
byte[] getPsshData(boolean keyRotation)
Returns the DRM system-specific binary data associated with the encryption of the media. This data will be inserted into an ISOBMFF pssh box and identified by the associated systemId.- Parameters:
keyRotation
- indicates whether key rotation is enabled- Returns:
- byte buffer containing the DRM system-specific binary data for the pssh box
-
setPsshData
void setPsshData(byte[] psshData)
Sets the DRM system-specific binary data associated with the encryption of the media. This data will be inserted into an ISOBMFF pssh box and identified by the associated systemId.- Parameters:
psshData
- DRM system-specific binary data for the pssh box
-
isComplete
boolean isComplete()
Verifies whether all required class parameters have been set, such as systemId.- Returns:
- true if all required class parameters have been set, else false
-
-