Package playReady (v1.7.6) [repository]

Index

Functions

func UuidOrGuid(data []byte)

Types

type AuxKey

type AuxKey struct {
	Location uint32
	Key      [16]byte
}

type AuxKeys

type AuxKeys struct {
	Count uint16
	Keys  []AuxKey
}

type CertFeatures

type CertFeatures struct {
	Entries  uint32
	Features []uint32
}

Methods

func (c *CertFeatures) Append(data []byte) []byte
func (c *CertFeatures) New(Type uint32)

type CertSignature

type CertSignature struct {
	SignatureType   uint16
	SignatureLength uint16
	// The actual signature bytes
	Signature    []byte
	IssuerLength uint32
	// The public key of the issuer that signed this certificate
	IssuerKey []byte
}

Methods

func (c *CertSignature) New(signature, modelKey []byte) error

type Certificate

type Certificate struct {
	Magic             [4]byte          // 0:4
	Version           uint32           // 4:8
	Length            uint32           // 8:12
	LengthToSignature uint32           // 12:16
	Info              *CertificateInfo // 0x1
	Security          *Ftlv            // 0x11
	Features          *Ftlv            // 0x5
	KeyInfo           *KeyInfo         // 0x6
	Manufacturer      *Ftlv            // 0x7
	Signature         *CertSignature   // 0x8
}

Methods

func (c *Certificate) Append(data []byte) []byte

type CertificateInfo

type CertificateInfo struct {
	CertificateId [16]byte
	SecurityLevel uint32
	Flags         uint32
	InfoType      uint32
	Digest        [32]byte
	Expiry        uint32
	ClientId      [16]byte // Client ID (can be used for license binding)
}

Methods

func (c *CertificateInfo) New(securityLevel uint32, digest []byte)

type Chain

type Chain struct {
	Magic        [4]byte
	Version      uint32
	Length       uint32
	Flags        uint32
	CertCount    uint32
	Certificates []Certificate
}

Methods

func (c *Chain) Decode(data []byte) error

Decode decodes a byte slice into the Chain structure.

func (c *Chain) Encode() []byte
func (c *Chain) Leaf(modelPriv, encryptSignPriv *big.Int) error

they downgrade certs from the cert digest (hash of the signing key)

func (c *Chain) RequestBody(kid []byte, privK *big.Int) ([]byte, error)

type ContentKey

type ContentKey struct {
	KeyId      [16]byte
	KeyType    uint16
	CipherType uint16
	Length     uint16
	Value      []byte
}

type CoordX

type CoordX [32]byte

Methods

func (c *CoordX) Key() []byte
func (c *CoordX) New(x *big.Int)

type EccKey

type EccKey struct {
	Curve  uint16
	Length uint16
	Value  []byte
}

type Ftlv

type Ftlv struct {
	Flag   uint16 // this can be 0 or 1
	Type   uint16
	Length uint32
	Value  []byte
}

Methods

func (f *Ftlv) Append(data []byte) []byte

type KeyData

type KeyData struct {
	KeyType   uint16
	Length    uint16
	Flags     uint32
	PublicKey [64]byte // ECDSA P256 public key (X and Y coordinates)
	Usage     CertFeatures
}

Methods

func (k *KeyData) Append(data []byte) []byte
func (k *KeyData) New(PublicKey []byte, Type uint32)

type KeyInfo

type KeyInfo struct {
	Entries uint32 // can be 1 or 2
	Keys    []KeyData
}

Methods

func (k *KeyInfo) New(encryptSignKey []byte)

type License

type License struct {
	Magic      [4]byte           // 0
	Offset     uint16            // 1
	Version    uint16            // 2
	RightsId   [16]byte          // 3
	ContentKey *ContentKey       // 4.9.10
	EccKey     *EccKey           // 4.9.42
	AuxKeys    *AuxKeys          // 4.9.81
	Signature  *LicenseSignature // 4.11
}

Methods

func (l *License) Decrypt(data []byte, privK *big.Int) (*CoordX, error)

type LicenseSignature

type LicenseSignature struct {
	Type   uint16
	Length uint16
	Data   []byte
}