Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CKCContainer ¶
type CKCContainer struct { CKCVersion uint32 //0x00000001 Reserved []byte CKCDataInitV []byte //A random 16-byte initialization vector, generated by the KSM CKCPayload []byte //A variable-length set of contiguous TLLV blocks CKCPayloadLength uint32 //The number of bytes in the encrypted CKC payload. }
CKCContainer represents a container to contain CKC message filed.
func (*CKCContainer) Serialize ¶
func (c *CKCContainer) Serialize() []byte
Serialize serializes CKCContainer message byte array.
type CKCPayload ¶
CKCPayload is a object that store ckc payload.
type CkcContentKeyDurationBlock ¶
type CkcContentKeyDurationBlock struct { *TLLVBlock LeaseDuration uint32 // 16-19, The duration of the lease, if any, in seconds. RentalDuration uint32 // 20-23, The duration of the rental, if any, in seconds. KeyType uint32 // 24-27,The key type. }
CkcContentKeyDurationBlock represents a ckc content key duration block structure.
func NewCkcContentKeyDurationBlock ¶
func NewCkcContentKeyDurationBlock(LeaseDuration, RentalDuration uint32) *CkcContentKeyDurationBlock
NewCkcContentKeyDurationBlock creates a new a ckc content key duration block object using the specified lease duration and rental duration.
type CkcEncryptedPayload ¶
type CkcEncryptedPayload struct {
Payload []byte
}
CkcEncryptedPayload represents a ckc encrypted payload structure.
type ContentKey ¶
type ContentKey interface { FetchContentKey(assetId []byte) ([]byte, []byte, error) FetchContentKeyDuration(assetId []byte) (*CkcContentKeyDurationBlock, error) }
ContentKey is a interface that fetch asset content key and duration.
type DecryptedSKR1Payload ¶
type DecryptedSKR1Payload struct { SK []byte //Session key HU []byte R1 []byte IntegrityBytes []byte }
DecryptedSKR1Payload represents a decrypted SKR1 payload structure.
type RandomContentKey ¶
type RandomContentKey struct { }
CKCPayload is a object that implements ContentKey interface.
func (RandomContentKey) FetchContentKey ¶
func (RandomContentKey) FetchContentKey(assetId []byte) ([]byte, []byte, error)
FetchContentKey returns content key and iv for the given assetId.
func (RandomContentKey) FetchContentKeyDuration ¶
func (RandomContentKey) FetchContentKeyDuration(assetId []byte) (*CkcContentKeyDurationBlock, error)
FetchContentKeyDuration returns CkcContentKeyDurationBlock for the given assetId.
type SKR1TLLVBlock ¶
SKR1TLLVBlock represents a SKR1 TLLV block structure.
type SPCContainer ¶
type SPCContainer struct { Version uint32 Reserved []byte AesKeyIV []byte EncryptedAesKey []byte CertificateHash []byte SPCPlayload []byte SPCPlayloadLength uint32 TTLVS map[uint64]TLLVBlock }
SPCContainer represents a container to contain SPC message filed.
func ParseSPCV1 ¶
func ParseSPCV1(playback []byte, pub, pri string) (*SPCContainer, error)
ParseSPCV1 parses playback, public and private key pairs to new a SPCContainer instance. ParseSPCV1 returns an error if playback can't be parsed.
type TLLVBlock ¶
type TLLVBlock struct { Tag uint64 BlockLength uint32 ValueLength uint32 //The number of bytes in the value field. This number may be any amount, including 0x0000 Value []byte }
TLLVBlock represents a TLLV block structure.
func NewTLLVBlock ¶
NewTLLVBlock creates a new TLLVBlock object using the specified tag and value.