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 Details

  • 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

      public void setEncKeyBytesList(List<byte[]> keyBytesList)
    • setKeyRotationType

      public void setKeyRotationType(int keyRotationType)
    • getKeyRotationType

      public int getKeyRotationType()
    • getIsRotatingKeys

      public boolean getIsRotatingKeys()
    • generateRandomKID

      public String generateRandomKID()
    • updateKey

      public void updateKey(long chunkId, int chunkDurationTarget)
    • setKeyPairs

      public void setKeyPairs(Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair> keyPairs)
    • getKeyPairs

      public Map<Integer,com.wowza.wms.drm.cenc.CencInfo.KeyPair> getKeyPairs()
    • setKeyRotationInterval

      public void setKeyRotationInterval(int interval)
    • getEncKeyBytes

      public byte[] getEncKeyBytes()
      Specified by:
      getEncKeyBytes in interface com.wowza.wms.httpstreamer.util.IEncryptionInfo
    • isIVInChunklist

      public boolean isIVInChunklist()
    • setIVInChunklist

      public void setIVInChunklist(boolean ivInChunklist)
    • getURL

      public String getURL()
    • setURL

      public void setURL(String url)
    • getKeyFormat

      public String getKeyFormat()
    • setKeyFormat

      public void setKeyFormat(String keyFormat)
    • getKeyFormatVersion

      public String getKeyFormatVersion()
    • setKeyFormatVersion

      public void setKeyFormatVersion(String keyFormatVersion)
    • getEncKeyBytesList

      public List<byte[]> getEncKeyBytesList()
    • getEncKeyString

      public String getEncKeyString()
    • setIVBytes

      public void setIVBytes(byte[] encIVBytes)
    • getEncIVBytes

      public byte[] getEncIVBytes()
      Specified by:
      getEncIVBytes in interface com.wowza.wms.httpstreamer.util.IEncryptionInfo
    • swapKIDBytes

      public static byte[] swapKIDBytes(byte[] KID)
    • setKID

      public 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
    • setKID

      public void setKID(byte[] KIDbytes)
      Sets the encryption key id.
      Parameters:
      KIDbytes - key id byte array
    • setKIDsList

      public void setKIDsList(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
    • getKID

      public String getKID()
    • getKIDBytes

      public byte[] getKIDBytes()
    • getKIDBytesSwapped

      public byte[] getKIDBytesSwapped()
    • getKIDsList

      public List<String> getKIDsList()
    • getKIDsBytesList

      public List<byte[]> getKIDsBytesList()
    • getKIDsBytesListSwapped

      public List<byte[]> getKIDsBytesListSwapped()
    • getAlgorithm

      public int getAlgorithm()
    • setScheme

      public void setScheme(String scheme)
    • getScheme

      public String getScheme()
    • isValid

      public boolean isValid()
    • getNameSpaceString

      public String getNameSpaceString()
    • getCencMp4ProtSchemeString

      public String getCencMp4ProtSchemeString()
    • getCencMpegTsProtSchemeString

      public String getCencMpegTsProtSchemeString()
    • addDRM

      public 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 systemId

      Example hashKey: "myDRM:12345678-1234-1234-1234-123456789123"

      Parameters:
      hashKey - hash key
      drm - the drm info instance
    • getDRMs

      public Map<String,ICencDRMInfo> getDRMs()
    • getEncRepeaterBytes

      public byte[] getEncRepeaterBytes()
    • setEncRepeaterBytes

      public void setEncRepeaterBytes(byte[] encRepeaterBytes)
    • setAppInstance

      public void setAppInstance(IApplicationInstance appInstance)
    • formatKID

      public static String formatKID(String KID)
    • loadFromKeyFile

      public static boolean loadFromKeyFile(IApplicationInstance appInstance, String streamName, CencInfo cencInfo, long chunkId, int contentType, int chunkDurationTarget, String keyFileParamPrefix)
    • loadHLSKEYParameters

      public static void loadHLSKEYParameters(Map<String,String> keyMap, String keyFileParamPrefix, CencInfo cencInfo)
    • getSerializeSize

      public int getSerializeSize()
      Description copied from interface: IDvrEncryptionInfo
      Return number of bytes required to serialize this encryption info.
      Specified by:
      getSerializeSize in interface IDvrEncryptionInfo
      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 interface IDvrEncryptionInfo
      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 interface IDvrEncryptionInfo
      Parameters:
      buffer - buffer to serialize to
      pos - position to start serializing
      Returns:
      new position into buffer
    • deserialize

      public static CencInfo deserialize(byte[] data)
    • deserialize

      public static CencInfo deserialize(ByteBuffer buffer)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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 interface IDvrEncryptionInfo
      Returns:
      encryption type (constants defined in this class)
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface IDvrEncryptionInfo
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • doIVRandom

      public void doIVRandom()