Documentation ¶
Index ¶
- Constants
- func DebugCKC(ckcplayback []byte)
- type CKCContainer
- type CKCPayload
- type CkcContentKeyDurationBlock
- type CkcDataIv
- type CkcEncryptedPayload
- type CkcR1
- type ContentKey
- type DFunction
- type DecryptedSKR1Payload
- type Ksm
- type RandomContentKey
- type SKR1TLLVBlock
- type SPCContainer
- type TLLVBlock
Constants ¶
const APPLE_TESTING_ASk = "d87ce7a26081de2e8eb8acef3a6dc179"
const NB_RD = 16
const PRIME = uint32(813416437)
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 Ksm ¶
type Ksm struct { Pub *rsa.PublicKey Pri *rsa.PrivateKey Rck ContentKey Ask []byte // contains filtered or unexported fields }
Ksm represents a ksm object.
type RandomContentKey ¶
type RandomContentKey struct { }
RandomContentKey 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 *rsa.PublicKey, pri *rsa.PrivateKey) (*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.