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 SummaryFields Modifier and Type Field Description static intALGORITHMID_CBCstatic intALGORITHMID_CTRstatic intALGORITHMID_NONEstatic intKEY_ROTATION_TYPE_EXTERNALstatic intKEY_ROTATION_TYPE_INTERNAL_RANDOMstatic intKEY_ROTATION_TYPE_INTERNAL_STATICstatic intKEY_ROTATION_TYPE_NONEstatic intPSSH_VERSION_0static intPSSH_VERSION_1- 
Fields inherited from interface com.wowza.wms.dvr.IDvrEncryptionInfoENCRYPTION_TYPE_CENC, ENCRYPTION_TYPE_CUPERTINO, ENCRYPTION_TYPE_PLAYREADY
 
- 
 - 
Constructor SummaryConstructors Constructor Description CencInfo()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDRM(String hashKey, ICencDRMInfo drm)Adds a DRM system info instance to the list of DRM systems associated with the stream encryption.Objectclone()static CencInfodeserialize(byte[] data)static CencInfodeserialize(java.nio.ByteBuffer buffer)static StringformatKID(String KID)StringgenerateRandomKID()intgetAlgorithm()StringgetAlgorithmString()StringgetCencMp4ProtSchemeString()StringgetCencMpegTsProtSchemeString()java.util.Map<String,ICencDRMInfo>getDRMs()byte[]getEncIVBytes()byte[]getEncKeyBytes()java.util.List<byte[]>getEncKeyBytesList()StringgetEncKeyString()byte[]getEncRepeaterBytes()intgetEncryptionType()Serialize encryption info.booleangetIsRotatingKeys()java.util.Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair>getKeyPairs()intgetKeyRotationType()StringgetKID()byte[]getKIDBytes()byte[]getKIDBytesSwapped()java.util.List<byte[]>getKIDsBytesList()java.util.List<byte[]>getKIDsBytesListSwapped()java.util.List<String>getKIDsList()StringgetNameSpaceString()intgetPSSHFlags()intgetPSSHVersion()intgetSerializeSize()Return number of bytes required to serialize this encryption info.booleanisValid()static booleanloadFromKeyFile(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix)byte[]serialize()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'.voidsetAlgorithm(int algorithm)Sets the encryption algorithm to be used.voidsetAppInstance(IApplicationInstance appInstance)voidsetEncKeyBytes(byte[] keyBytes)Sets the encryption content key as a byte buffer.voidsetEncKeyBytesList(java.util.List<byte[]> keyBytesList)voidsetEncRepeaterBytes(byte[] encRepeaterBytes)voidsetIVBytes(byte[] encIVBytes)voidsetKeyPairs(java.util.Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair> keyPairs)voidsetKeyRotationInterval(int interval)voidsetKeyRotationType(int keyRotationType)voidsetKID(byte[] KIDbytes)Sets the encryption key id.voidsetKID(String KID)Sets the encryption key id.voidsetKIDsList(java.util.List<String> KIDList)Sets the list of encryption key id strings.voidsetPSSHFlags(int psshFlags)voidsetPSSHVersion(int psshVersion)static byte[]swapKIDBytes(byte[] KID)StringtoString()voidupdateKey(long chunkId, int chunkDurationTarget)
 
- 
- 
- 
Field Detail- 
PSSH_VERSION_0public static final int PSSH_VERSION_0 - See Also:
- Constant Field Values
 
 - 
PSSH_VERSION_1public static final int PSSH_VERSION_1 - See Also:
- Constant Field Values
 
 - 
ALGORITHMID_NONEpublic static final int ALGORITHMID_NONE - See Also:
- Constant Field Values
 
 - 
ALGORITHMID_CTRpublic static final int ALGORITHMID_CTR - See Also:
- Constant Field Values
 
 - 
ALGORITHMID_CBCpublic static final int ALGORITHMID_CBC - See Also:
- Constant Field Values
 
 - 
KEY_ROTATION_TYPE_NONEpublic static final int KEY_ROTATION_TYPE_NONE - See Also:
- Constant Field Values
 
 - 
KEY_ROTATION_TYPE_INTERNAL_STATICpublic static final int KEY_ROTATION_TYPE_INTERNAL_STATIC - See Also:
- Constant Field Values
 
 - 
KEY_ROTATION_TYPE_INTERNAL_RANDOMpublic static final int KEY_ROTATION_TYPE_INTERNAL_RANDOM - See Also:
- Constant Field Values
 
 - 
KEY_ROTATION_TYPE_EXTERNALpublic static final int KEY_ROTATION_TYPE_EXTERNAL - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
setEncKeyBytespublic void setEncKeyBytes(byte[] keyBytes) Sets the encryption content key as a byte buffer.- Parameters:
- keyBytes- the encryption content key as a byte buffer
 
 - 
setEncKeyBytesListpublic void setEncKeyBytesList(java.util.List<byte[]> keyBytesList) 
 - 
setKeyRotationTypepublic void setKeyRotationType(int keyRotationType) 
 - 
getKeyRotationTypepublic int getKeyRotationType() 
 - 
getIsRotatingKeyspublic boolean getIsRotatingKeys() 
 - 
generateRandomKIDpublic String generateRandomKID() 
 - 
updateKeypublic void updateKey(long chunkId, int chunkDurationTarget)
 - 
getKeyPairspublic java.util.Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair> getKeyPairs() 
 - 
setKeyPairspublic void setKeyPairs(java.util.Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair> keyPairs) 
 - 
setKeyRotationIntervalpublic void setKeyRotationInterval(int interval) 
 - 
getEncKeyBytespublic byte[] getEncKeyBytes() - Specified by:
- getEncKeyBytesin interface- com.wowza.wms.httpstreamer.util.IEncryptionInfo
 
 - 
getEncKeyBytesListpublic java.util.List<byte[]> getEncKeyBytesList() 
 - 
getEncKeyStringpublic String getEncKeyString() 
 - 
setIVBytespublic void setIVBytes(byte[] encIVBytes) 
 - 
getEncIVBytespublic byte[] getEncIVBytes() - Specified by:
- getEncIVBytesin interface- com.wowza.wms.httpstreamer.util.IEncryptionInfo
 
 - 
swapKIDBytespublic static byte[] swapKIDBytes(byte[] KID) 
 - 
setKIDpublic void setKID(String KID) Sets the encryption key id. String must be in uuid form "F6005DCF-7F93-4B8E-85C7-F977740DA059" (big endian)- Parameters:
- KID- key id
 
 - 
setKIDpublic void setKID(byte[] KIDbytes) Sets the encryption key id.- Parameters:
- KIDbytes- key id byte array
 
 - 
setKIDsListpublic void setKIDsList(java.util.List<String> KIDList) 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
 
 - 
getKIDpublic String getKID() 
 - 
getKIDBytespublic byte[] getKIDBytes() 
 - 
getKIDBytesSwappedpublic byte[] getKIDBytesSwapped() 
 - 
getKIDsListpublic java.util.List<String> getKIDsList() 
 - 
getKIDsBytesListpublic java.util.List<byte[]> getKIDsBytesList() 
 - 
getKIDsBytesListSwappedpublic java.util.List<byte[]> getKIDsBytesListSwapped() 
 - 
getAlgorithmpublic int getAlgorithm() 
 - 
getAlgorithmStringpublic String getAlgorithmString() 
 - 
setAlgorithmpublic void setAlgorithm(int algorithm) Sets the encryption algorithm to be used. Currently only CencInfo.ALGORITHMID_CTR is supported.- Parameters:
- algorithm- encryption algorithm
 
 - 
isValidpublic boolean isValid() 
 - 
getNameSpaceStringpublic String getNameSpaceString() 
 - 
getCencMp4ProtSchemeStringpublic String getCencMp4ProtSchemeString() 
 - 
getCencMpegTsProtSchemeStringpublic String getCencMpegTsProtSchemeString() 
 - 
addDRMpublic void addDRM(String hashKey, ICencDRMInfo drm)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 key
- drm- the drm info instance
 
 - 
getDRMspublic java.util.Map<String,ICencDRMInfo> getDRMs() 
 - 
getEncRepeaterBytespublic byte[] getEncRepeaterBytes() 
 - 
setEncRepeaterBytespublic void setEncRepeaterBytes(byte[] encRepeaterBytes) 
 - 
setAppInstancepublic void setAppInstance(IApplicationInstance appInstance) 
 - 
formatKIDpublic static String formatKID(String KID) 
 - 
loadFromKeyFilepublic static boolean loadFromKeyFile(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix) 
 - 
getSerializeSizepublic int getSerializeSize() Description copied from interface:IDvrEncryptionInfoReturn number of bytes required to serialize this encryption info.- Specified by:
- getSerializeSizein interface- IDvrEncryptionInfo
- Returns:
- number of bytes to serialize.
 
 - 
serializepublic byte[] serialize() Description copied from interface:IDvrEncryptionInfoSerialize the encryption info, returning a byte buffer containing the serialized data.- Specified by:
- serializein interface- IDvrEncryptionInfo
- Returns:
- byte buffer of serialized data
 
 - 
serializepublic int serialize(byte[] buffer, int pos)Description copied from interface:IDvrEncryptionInfoSerialize the encryption info into buffer starting at position 'pos'.- Specified by:
- serializein interface- IDvrEncryptionInfo
- Parameters:
- buffer- buffer to serialize to
- pos- position to start serializing
- Returns:
- new position into buffer
 
 - 
deserializepublic static CencInfo deserialize(byte[] data) 
 - 
deserializepublic static CencInfo deserialize(java.nio.ByteBuffer buffer) 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- Object
 
 - 
getPSSHVersionpublic int getPSSHVersion() 
 - 
setPSSHVersionpublic void setPSSHVersion(int psshVersion) 
 - 
getPSSHFlagspublic int getPSSHFlags() 
 - 
setPSSHFlagspublic void setPSSHFlags(int psshFlags) 
 - 
getEncryptionTypepublic 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 interface- IDvrEncryptionInfo
- Returns:
- encryption type (constants defined in this class)
 
 - 
clonepublic Object clone() throws CloneNotSupportedException- Specified by:
- clonein interface- IDvrEncryptionInfo
- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
 
- 
 
-