Package widevine (v1.7.8) [up] [repository]

Index

Functions

func BuildSignedMessage(msg []byte, privateKey *rsa.PrivateKey) ([]byte, error)

BuildSignedMessage envelopes the request with an RSA signature.

func GetKey(keys []*KeyContainer, id []byte) ([]byte, bool)
func ParsePrivateKey(pemBytes []byte) (*rsa.PrivateKey, error)

Types

type KeyContainer

type KeyContainer struct {
	Id  []byte
	Iv  []byte
	Key []byte
}

Functions

func ParseLicenseResponse(responseData []byte, originalRequestBytes []byte, privateKey *rsa.PrivateKey) ([]*KeyContainer, error)

type LicenseError

LicenseError reflects the structure of the Widevine LicenseError protobuf.

type LicenseError struct {
	ErrorCode *protobuf.Field
}

Methods

func (le *LicenseError) Error() string

Error implements the standard Go error interface.

type PsshData

PsshData represents the Widevine-specific protobuf message.

type PsshData struct {
	KeyIds    [][]byte
	ContentId []byte
}

Methods

func (p *PsshData) BuildLicenseRequest(clientId []byte) ([]byte, error)

BuildLicenseRequest creates and serializes a LicenseRequest protobuf message.

func (p *PsshData) Marshal() ([]byte, error)

Marshal serializes the PsshData struct into the protobuf wire format.

func (p *PsshData) Unmarshal(data []byte) error

Unmarshal parses the protobuf wire format into the PsshData struct.