Package com.castlabs.android.player
Class DrmKeyStorage
java.lang.Object
com.castlabs.android.player.DrmKeyStorage
Represents a storage for DRM key information.
This class handles the encoding and decoding of DRM key data,
including key set ID, timing information, and flags.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal byteAdditional flags associated with the DRM key.final byte[]The ID of the key set.final longThe timestamp in milliseconds until which the key is valid.final longThe offset in milliseconds between the server time and the local time.final longThe elapsed time in milliseconds since the last synchronization.final longThe local time in milliseconds when the last synchronization occurred. -
Constructor Summary
ConstructorsConstructorDescriptionDrmKeyStorage(byte[] encoded) Constructs a DrmKeyStorage object from an encoded byte array.DrmKeyStorage(byte[] keySetId, long serverToLocalOffsetMs, long keyValidUntilMs, long syncLocalTime, long syncElapsedTime, byte flags) Constructs a DrmKeyStorage object with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrmKeyStoragecreateWithoutTimingInfo(byte[] keySetId) Creates a DrmKeyStorage object without timing information.byte[]encode()Encodes the DrmKeyStorage object into a byte array.toString()
-
Field Details
-
keySetId
public final byte[] keySetIdThe ID of the key set. -
serverToLocalOffsetMs
public final long serverToLocalOffsetMsThe offset in milliseconds between the server time and the local time. -
keyValidUntilMs
public final long keyValidUntilMsThe timestamp in milliseconds until which the key is valid. -
syncLocalTime
public final long syncLocalTimeThe local time in milliseconds when the last synchronization occurred. -
syncElapsedTime
public final long syncElapsedTimeThe elapsed time in milliseconds since the last synchronization. -
flags
public final byte flagsAdditional flags associated with the DRM key.
-
-
Constructor Details
-
DrmKeyStorage
public DrmKeyStorage(byte[] keySetId, long serverToLocalOffsetMs, long keyValidUntilMs, long syncLocalTime, long syncElapsedTime, byte flags) Constructs a DrmKeyStorage object with the specified parameters.- Parameters:
keySetId- The key set ID to be used in the DrmKeyStorage object.serverToLocalOffsetMs- The offset from server time to local time in milliseconds.keyValidUntilMs- The time until which the key is valid, in milliseconds.syncLocalTime- The local time when the last synchronization occurred, in milliseconds.syncElapsedTime- The elapsed time since the last synchronization, in milliseconds.flags- Additional flags for the DrmKeyStorage object.
-
DrmKeyStorage
public DrmKeyStorage(byte[] encoded) Constructs a DrmKeyStorage object from an encoded byte array. The byte array should be in the format defined by the encode() method.- Parameters:
encoded- The byte array to decode into a DrmKeyStorage object.- Throws:
IllegalArgumentException- if the byte array does not match the expected format.
-
-
Method Details
-
toString
-
encode
public byte[] encode()Encodes the DrmKeyStorage object into a byte array.- Returns:
- byte array representation of the DrmKeyStorage object.
-
createWithoutTimingInfo
Creates a DrmKeyStorage object without timing information.- Parameters:
keySetId- The key set ID to be used in the DrmKeyStorage object.- Returns:
- A new DrmKeyStorage object with the provided keySetId and default values for timing information.
-