crypto.go errors.go pssh.go request.go response.go
func DecodePrivateKey(pemData []byte) (*rsa.PrivateKey, error)
func EncodeSignedMessage(requestData []byte, privateKey *rsa.PrivateKey) ([]byte, error)
EncodeSignedMessage envelopes the request with an RSA signature.
func GetKey(keys []*KeyContainer, id []byte) ([]byte, error)
GetKey searches for a key by its ID in a slice of KeyContainers. If the key is found, it returns the key and a nil error. If the key is not found, it returns nil and an error.
type KeyContainer struct { Id []byte Iv []byte Key []byte }
func DecodeLicenseResponse(responseData []byte, requestData []byte, privateKey *rsa.PrivateKey) ([]*KeyContainer, error)
LicenseError reflects the structure of the Widevine LicenseError protobuf.
type LicenseError struct { ErrorCode *protobuf.Field }
func (le *LicenseError) Error() string
Error implements the standard Go error interface.
PsshData represents the Widevine-specific protobuf message.
type PsshData struct { KeyIds [][]byte ContentId []byte }
func DecodePsshData(data []byte) (*PsshData, error)
DecodePsshData parses the protobuf wire format into a PsshData struct.
func (p *PsshData) Encode() ([]byte, error)
Encode serializes the PsshData struct into the protobuf wire format.
func (p *PsshData) EncodeLicenseRequest(clientId []byte) ([]byte, error)
EncodeLicenseRequest creates and serializes a LicenseRequest protobuf message.