Documentation ¶
Index ¶
Constants ¶
const WidevineSystemID = "edef8ba979d64acea3c827dcd51d21ed"
WidevineSystemID is the system ID of Widevine.
Variables ¶
var ServiceCertificateRequest = []byte{0x08, 0x04}
ServiceCertificateRequest is the constant request for getting the service certificate from the Widevine license server.
Functions ¶
func DecryptMP4 ¶
DecryptMP4 decrypts a fragmented MP4 file with the given key. Supports CENC and CBCS schemes.
func ParseServiceCert ¶
func ParseServiceCert(serviceCert []byte) (*wvpb.DrmCertificate, error)
ParseServiceCert parses a service certificate which can be used in privacy mode.
Types ¶
type CDM ¶
type CDM struct {
// contains filtered or unexported fields
}
CDM implements the Widevine CDM protocol.
func (*CDM) GetLicenseChallenge ¶
func (c *CDM) GetLicenseChallenge(pssh *PSSH, typ wvpb.LicenseType, privacyMode bool, serviceCert ...*wvpb.DrmCertificate) ([]byte, func(b []byte) ([]*Key, error), error)
GetLicenseChallenge returns the license challenge for the given PSSH.
Set privacyMode to true to enable privacy mode, and you must provide a service certificate.
type CDMOption ¶
type CDMOption func(*CDM)
func WithRandom ¶
WithRandom sets the random source of the CDM.
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device represents a Widevine device.
func NewDevice ¶
func NewDevice(src DeviceSource) (*Device, error)
NewDevice creates a Device from a DeviceSource.
func (*Device) ClientID ¶
func (d *Device) ClientID() *wvpb.ClientIdentification
ClientID returns the client ID of the device.
func (*Device) DrmCertificate ¶
func (d *Device) DrmCertificate() *wvpb.DrmCertificate
DrmCertificate returns the DRM certificate of the device.
func (*Device) PrivateKey ¶
func (d *Device) PrivateKey() *rsa.PrivateKey
PrivateKey returns the private key of the device.
type DeviceSource ¶
DeviceSource is a function that returns a Device.
func FromRaw ¶
func FromRaw(clientID, privateKey []byte) DeviceSource
FromRaw creates a Device from raw client ID and private key data.
type Key ¶
type Key struct { // Type is the type of key. Type wvpb.License_KeyContainer_KeyType // IV is the initialization vector of the key. IV []byte // ID is the ID of the key. ID []byte // Key is the key. Key []byte }