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 intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface com.wowza.wms.dvr.IDvrEncryptionInfo
ENCRYPTION_TYPE_CENC, ENCRYPTION_TYPE_CUPERTINO, ENCRYPTION_TYPE_PLAYREADY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDRM(String hashKey, ICencDRMInfo drm) Adds a DRM system info instance to the list of DRM systems associated with the stream encryption.clone()static CencInfodeserialize(byte[] data) static CencInfodeserialize(ByteBuffer buffer) voidstatic StringintgetDRMs()byte[]byte[]List<byte[]>byte[]intSerialize encryption info.booleanintgetKID()byte[]byte[]List<byte[]>List<byte[]>intintintReturn number of bytes required to serialize this encryption info.getURL()booleanbooleanisValid()static booleanloadFromKeyFile(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix) static voidbyte[]Serialize the encryption info, returning a byte buffer containing the serialized data.intserialize(byte[] buffer, int pos) Serialize the encryption info into buffer starting at position 'pos'.voidsetAppInstance(IApplicationInstance appInstance) voidsetEncKeyBytes(byte[] keyBytes) Sets the encryption content key as a byte buffer.voidsetEncKeyBytesList(List<byte[]> keyBytesList) voidsetEncRepeaterBytes(byte[] encRepeaterBytes) voidsetIVBytes(byte[] encIVBytes) voidsetIVInChunklist(boolean ivInChunklist) voidsetKeyFormat(String keyFormat) voidsetKeyFormatVersion(String keyFormatVersion) voidsetKeyPairs(Map<Integer, com.wowza.wms.drm.cenc.CencInfo.KeyPair> keyPairs) voidsetKeyRotationInterval(int interval) voidsetKeyRotationType(int keyRotationType) voidsetKID(byte[] KIDbytes) Sets the encryption key id.voidSets the encryption key id.voidsetKIDsList(List<String> KIDList) Sets the list of encryption key id strings.voidsetPSSHFlags(int psshFlags) voidsetPSSHVersion(int psshVersion) voidvoidstatic byte[]swapKIDBytes(byte[] KID) toString()voidupdateKey(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:
getEncKeyBytesin 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:
getEncIVBytesin 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:IDvrEncryptionInfoReturn number of bytes required to serialize this encryption info.- Specified by:
getSerializeSizein interfaceIDvrEncryptionInfo- Returns:
- number of bytes to serialize.
-
serialize
public byte[] serialize()Description copied from interface:IDvrEncryptionInfoSerialize the encryption info, returning a byte buffer containing the serialized data.- Specified by:
serializein interfaceIDvrEncryptionInfo- Returns:
- byte buffer of serialized data
-
serialize
public int serialize(byte[] buffer, int pos) Description copied from interface:IDvrEncryptionInfoSerialize the encryption info into buffer starting at position 'pos'.- Specified by:
serializein 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:IDvrEncryptionInfoSerialize 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:
getEncryptionTypein interfaceIDvrEncryptionInfo- Returns:
- encryption type (constants defined in this class)
-
clone
- Specified by:
clonein interfaceIDvrEncryptionInfo- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
doIVRandom
public void doIVRandom()
-