Package com.wowza.wms.drm.cenc
Class CencInfo
Object
com.wowza.wms.drm.cenc.CencInfo
- All Implemented Interfaces:
IDvrEncryptionInfo
,com.wowza.wms.httpstreamer.util.IEncryptionInfo
,Cloneable
public class CencInfo
extends Object
implements IDvrEncryptionInfo, com.wowza.wms.httpstreamer.util.IEncryptionInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface com.wowza.wms.dvr.IDvrEncryptionInfo
ENCRYPTION_TYPE_CENC, ENCRYPTION_TYPE_CUPERTINO, ENCRYPTION_TYPE_PLAYREADY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDRM
(String hashKey, ICencDRMInfo drm) Adds a DRM system info instance to the list of DRM systems associated with the stream encryption.clone()
static CencInfo
deserialize
(byte[] data) static CencInfo
deserialize
(ByteBuffer buffer) void
static String
int
getDRMs()
byte[]
byte[]
List<byte[]>
byte[]
int
Serialize encryption info.boolean
int
getKID()
byte[]
byte[]
List<byte[]>
List<byte[]>
int
int
int
Return number of bytes required to serialize this encryption info.getURL()
boolean
boolean
isValid()
static boolean
loadFromKeyFile
(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix) static void
byte[]
Serialize the encryption info, returning a byte buffer containing the serialized data.int
serialize
(byte[] buffer, int pos) Serialize the encryption info into buffer starting at position 'pos'.void
setAppInstance
(IApplicationInstance appInstance) void
setEncKeyBytes
(byte[] keyBytes) Sets the encryption content key as a byte buffer.void
setEncKeyBytesList
(List<byte[]> keyBytesList) void
setEncRepeaterBytes
(byte[] encRepeaterBytes) void
setIVBytes
(byte[] encIVBytes) void
setIVInChunklist
(boolean ivInChunklist) void
setKeyFormat
(String keyFormat) void
setKeyFormatVersion
(String keyFormatVersion) void
setKeyPairs
(Map<Integer, com.wowza.wms.drm.cenc.CencInfo.KeyPair> keyPairs) void
setKeyRotationInterval
(int interval) void
setKeyRotationType
(int keyRotationType) void
setKID
(byte[] KIDbytes) Sets the encryption key id.void
Sets the encryption key id.void
setKIDsList
(List<String> KIDList) Sets the list of encryption key id strings.void
setPSSHFlags
(int psshFlags) void
setPSSHVersion
(int psshVersion) void
void
static byte[]
swapKIDBytes
(byte[] KID) toString()
void
updateKey
(long chunkId, int chunkDurationTarget)
-
Field Details
-
PSSH_VERSION_0
public static final int PSSH_VERSION_0- See Also:
-
PSSH_VERSION_1
public static final int PSSH_VERSION_1- See Also:
-
ALGORITHMID_NONE
public static final int ALGORITHMID_NONE- See Also:
-
ALGORITHMID_CTR
public static final int ALGORITHMID_CTR- See Also:
-
ALGORITHMID_CBC
public static final int ALGORITHMID_CBC- See Also:
-
SCHEME_CENC
- See Also:
-
SCHEME_CBC1
- See Also:
-
SCHEME_CENS
- See Also:
-
SCHEME_CBCS
- See Also:
-
SCHEME_UNKNOWN
- See Also:
-
KEY_ROTATION_TYPE_NONE
public static final int KEY_ROTATION_TYPE_NONE- See Also:
-
KEY_ROTATION_TYPE_INTERNAL_STATIC
public static final int KEY_ROTATION_TYPE_INTERNAL_STATIC- See Also:
-
KEY_ROTATION_TYPE_INTERNAL_RANDOM
public static final int KEY_ROTATION_TYPE_INTERNAL_RANDOM- See Also:
-
KEY_ROTATION_TYPE_EXTERNAL
public static final int KEY_ROTATION_TYPE_EXTERNAL- See Also:
-
-
Constructor Details
-
CencInfo
public CencInfo()
-
-
Method Details
-
setEncKeyBytes
public void setEncKeyBytes(byte[] keyBytes) Sets the encryption content key as a byte buffer.- Parameters:
keyBytes
- the encryption content key as a byte buffer
-
setEncKeyBytesList
-
setKeyRotationType
public void setKeyRotationType(int keyRotationType) -
getKeyRotationType
public int getKeyRotationType() -
getIsRotatingKeys
public boolean getIsRotatingKeys() -
generateRandomKID
-
updateKey
public void updateKey(long chunkId, int chunkDurationTarget) -
setKeyPairs
-
getKeyPairs
-
setKeyRotationInterval
public void setKeyRotationInterval(int interval) -
getEncKeyBytes
public byte[] getEncKeyBytes()- Specified by:
getEncKeyBytes
in interfacecom.wowza.wms.httpstreamer.util.IEncryptionInfo
-
isIVInChunklist
public boolean isIVInChunklist() -
setIVInChunklist
public void setIVInChunklist(boolean ivInChunklist) -
getURL
-
setURL
-
getKeyFormat
-
setKeyFormat
-
getKeyFormatVersion
-
setKeyFormatVersion
-
getEncKeyBytesList
-
getEncKeyString
-
setIVBytes
public void setIVBytes(byte[] encIVBytes) -
getEncIVBytes
public byte[] getEncIVBytes()- Specified by:
getEncIVBytes
in interfacecom.wowza.wms.httpstreamer.util.IEncryptionInfo
-
swapKIDBytes
public static byte[] swapKIDBytes(byte[] KID) -
setKID
Sets the encryption key id. String must be in uuid form "F6005DCF-7F93-4B8E-85C7-F977740DA059" (big endian)- Parameters:
KID
- key id
-
setKID
public void setKID(byte[] KIDbytes) Sets the encryption key id.- Parameters:
KIDbytes
- key id byte array
-
setKIDsList
Sets the list of encryption key id strings. Ids must be in uuid form "F6005DCF-7F93-4B8E-85C7-F977740DA059" (big endian)- Parameters:
KIDList
- list of key id strings
-
getKID
-
getKIDBytes
public byte[] getKIDBytes() -
getKIDBytesSwapped
public byte[] getKIDBytesSwapped() -
getKIDsList
-
getKIDsBytesList
-
getKIDsBytesListSwapped
-
getAlgorithm
public int getAlgorithm() -
setScheme
-
getScheme
-
isValid
public boolean isValid() -
getNameSpaceString
-
getCencMp4ProtSchemeString
-
getCencMpegTsProtSchemeString
-
addDRM
Adds a DRM system info instance to the list of DRM systems associated with the stream encryption. The hashKey should be some unique string to identify the DRM System, such as a concatenation of the DRM system's system name and systemIdExample hashKey: "myDRM:12345678-1234-1234-1234-123456789123"
- Parameters:
hashKey
- hash keydrm
- the drm info instance
-
getDRMs
-
getEncRepeaterBytes
public byte[] getEncRepeaterBytes() -
setEncRepeaterBytes
public void setEncRepeaterBytes(byte[] encRepeaterBytes) -
setAppInstance
-
formatKID
-
loadFromKeyFile
public static boolean loadFromKeyFile(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix) -
loadHLSKEYParameters
-
getSerializeSize
public int getSerializeSize()Description copied from interface:IDvrEncryptionInfo
Return number of bytes required to serialize this encryption info.- Specified by:
getSerializeSize
in interfaceIDvrEncryptionInfo
- Returns:
- number of bytes to serialize.
-
serialize
public byte[] serialize()Description copied from interface:IDvrEncryptionInfo
Serialize the encryption info, returning a byte buffer containing the serialized data.- Specified by:
serialize
in interfaceIDvrEncryptionInfo
- Returns:
- byte buffer of serialized data
-
serialize
public int serialize(byte[] buffer, int pos) Description copied from interface:IDvrEncryptionInfo
Serialize the encryption info into buffer starting at position 'pos'.- Specified by:
serialize
in interfaceIDvrEncryptionInfo
- Parameters:
buffer
- buffer to serialize topos
- position to start serializing- Returns:
- new position into buffer
-
deserialize
-
deserialize
-
toString
-
getPSSHVersion
public int getPSSHVersion() -
setPSSHVersion
public void setPSSHVersion(int psshVersion) -
getPSSHFlags
public int getPSSHFlags() -
setPSSHFlags
public void setPSSHFlags(int psshFlags) -
getEncryptionType
public int getEncryptionType()Description copied from interface:IDvrEncryptionInfo
Serialize encryption info.The encryption should consist of the following:
- version (1 byte)
- encryption type (1 byte)
- length of 'blob' (2 bytes)
- byte blob (n bytes)
- Specified by:
getEncryptionType
in interfaceIDvrEncryptionInfo
- Returns:
- encryption type (constants defined in this class)
-
clone
- Specified by:
clone
in interfaceIDvrEncryptionInfo
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
doIVRandom
public void doIVRandom()
-