Documentation
¶
Index ¶
- func AESCBCDecrypt(key, iv, cipherText []byte) ([]byte, error)
- func AESCBCEncrypt(key, iv, plainText []byte) ([]byte, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- type ClientInfo
- type ContentKeyResponse
- type ContentKeySpec
- type KeyGoverner
- type LicenseID
- type LicenseMessage
- type LicenseMetadata
- type LicenseResponse
- type Policy
- type Proxy
- type PsshData
- type ServiceVersionInfo
- type SessionState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESCBCDecrypt ¶
AESCBCDecrypt is given key, iv to decrypt the cipherText in AES CBC way.
func AESCBCEncrypt ¶
AESCBCEncrypt is given key, iv to encrypt the plainText in AES CBC way.
func PKCS5Padding ¶
func PKCS5UnPadding ¶
Types ¶
type ClientInfo ¶
type ContentKeyResponse ¶
type ContentKeyResponse struct {
Status string `json:"status"`
DRM []drm `json:"drm"`
Tracks []tracks `json:"tracks"`
AlreadyUsed bool `json:"already_used"`
}
GetContentKeyResponse JSON response from Widevine Cloud. /cenc/getcontentkey/<provider>
type ContentKeySpec ¶
type KeyGoverner ¶
type KeyGoverner interface {
GenerateContentKeyID(contentID []byte) []byte
GenerateContentKey(contentID []byte) []byte
GenerateContentIV(contentID []byte) []byte
GenerateContentKeySpec(contentID []byte, policyConfig map[string]string) (*[]ContentKeySpec, error)
}
KeyGoverner is a business logic for judging the premissions in multi-key protection
type LicenseMessage ¶
type LicenseMessage struct {
Payload string `json:"payload"`
ContentID string `json:"content_id"`
Provider string `json:"provider"`
AllowedTrackTypes string `json:"allowed_track_types"`
ContentKeySpecs []ContentKeySpec `json:"content_key_specs"`
}
type LicenseMetadata ¶
type LicenseResponse ¶
type LicenseResponse struct {
Status string `json:"status"`
StatusMessage string `json:"status_message"`
License string `json:"license"`
LicenseMetadata LicenseMetadata `json:"license_metadata"`
SupportedTracks []interface{} `json:"supported_tracks"`
Make string `json:"make"`
Model string `json:"model"`
SecurityLevel int64 `json:"security_level"`
InternalStatus int64 `json:"internal_status"`
SessionState SessionState `json:"session_state"`
DRMCERTSerialNumber string `json:"drm_cert_serial_number"`
DeviceWhitelistState string `json:"device_whitelist_state"`
MessageType string `json:"message_type"`
Platform string `json:"platform"`
DeviceState string `json:"device_state"`
PsshData PsshData `json:"pssh_data"`
ClientMaxHdcpVersion string `json:"client_max_hdcp_version"`
ClientInfo []ClientInfo `json:"client_info"`
SignatureExpirationSecs int64 `json:"signature_expiration_secs"`
PlatformVerificationStatus string `json:"platform_verification_status"`
ContentOwner string `json:"content_owner"`
ContentProvider string `json:"content_provider"`
SystemID int64 `json:"system_id"`
OEMCryptoAPIVersion int64 `json:"oem_crypto_api_version"`
ResourceRatingTier int64 `json:"resource_rating_tier"`
ServiceVersionInfo ServiceVersionInfo `json:"service_version_info"`
}
LicenseResponse decoded JSON response from Widevine Cloud. /cenc/getlicense
type Proxy ¶
type Proxy struct {
PartnerRootKey []byte
PartnerRootIV []byte
Provider string
ContentKeyGenerator KeyGoverner
Logger *logrus.Logger
// contains filtered or unexported fields
}
Proxy structure.
func NewWidevineProxy ¶
func NewWidevineProxy(key, iv []byte, provider string, keyGenerator KeyGoverner, logger *logrus.Logger) *Proxy
NewWidevineProxy creates an instance for grant widevine license with Widevine Cloud-based services.
func (*Proxy) GetContentKey ¶
func (wp *Proxy) GetContentKey(contentID string, policy Policy) (*ContentKeyResponse, error)
GetContentKey creates a content key giving a contentID.
func (*Proxy) GetLicense ¶
func (wp *Proxy) GetLicense(contentID string, body string) (*LicenseResponse, error)
GetLicense creates a license request used with a proxy server.
type PsshData ¶
type PsshData struct {
KeyID []interface{} `json:"key_id"`
ContentID string `json:"content_id"`
}
type ServiceVersionInfo ¶
Click to show internal directories.
Click to hide internal directories.