Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CreateLicense(request *CreateLicenseRequest) (response *CreateLicenseResponse, err error)
- func (c *Client) DescribeKeys(request *DescribeKeysRequest) (response *DescribeKeysResponse, err error)
- func (c *Client) StartEncryption(request *StartEncryptionRequest) (response *StartEncryptionResponse, err error)
- type CreateLicenseRequest
- type CreateLicenseResponse
- type DescribeKeysRequest
- type DescribeKeysResponse
- type DrmOutputObject
- type DrmOutputPara
- type DrmSourceObject
- type Key
- type PlaybackPolicy
- type StartEncryptionRequest
- type StartEncryptionResponse
Constants ¶
View Source
const APIVersion = "2018-11-15"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func NewClient ¶
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error)
func NewClientWithSecretId ¶
Deprecated
func (*Client) CreateLicense ¶
func (c *Client) CreateLicense(request *CreateLicenseRequest) (response *CreateLicenseResponse, err error)
本接口用来生成DRM方案对应的播放许可证,开发者需提供DRM方案类型、内容类型参数,后台将生成许可证后返回许可证数据 开发者需要转发终端设备发出的许可证请求信息。
func (*Client) DescribeKeys ¶
func (c *Client) DescribeKeys(request *DescribeKeysRequest) (response *DescribeKeysResponse, err error)
开发者需要指定使用的DRM类型、和需要加密的Track类型,后台返回加密使用的密钥 如果加密使用的ContentID没有关联的密钥信息,后台会自动生成新的密钥返回
func (*Client) StartEncryption ¶
func (c *Client) StartEncryption(request *StartEncryptionRequest) (response *StartEncryptionResponse, err error)
开发者调用该接口,启动一次内容文件的DRM加密工作流
type CreateLicenseRequest ¶
type CreateLicenseRequest struct {
*tchttp.BaseRequest
// DRM方案类型,接口取值:WIDEVINE,FAIRPLAY。
DrmType *string `json:"DrmType,omitempty" name:"DrmType"`
// Base64编码的终端设备License Request数据。
LicenseRequest *string `json:"LicenseRequest,omitempty" name:"LicenseRequest"`
// 内容类型,接口取值:VodVideo,LiveVideo。
ContentType *string `json:"ContentType,omitempty" name:"ContentType"`
// 授权播放的Track列表。
// 该值为空时,默认授权所有track播放。
Tracks []*string `json:"Tracks,omitempty" name:"Tracks" list`
// 播放策略参数。
PlaybackPolicy *PlaybackPolicy `json:"PlaybackPolicy,omitempty" name:"PlaybackPolicy"`
}
func NewCreateLicenseRequest ¶
func NewCreateLicenseRequest() (request *CreateLicenseRequest)
func (*CreateLicenseRequest) FromJsonString ¶
func (r *CreateLicenseRequest) FromJsonString(s string) error
func (*CreateLicenseRequest) ToJsonString ¶
func (r *CreateLicenseRequest) ToJsonString() string
type CreateLicenseResponse ¶
type CreateLicenseResponse struct {
*tchttp.BaseResponse
Response *struct {
// Base64 编码的许可证二进制数据。
License *string `json:"License,omitempty" name:"License"`
// 加密内容的内容ID
ContentId *string `json:"ContentId,omitempty" name:"ContentId"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewCreateLicenseResponse ¶
func NewCreateLicenseResponse() (response *CreateLicenseResponse)
func (*CreateLicenseResponse) FromJsonString ¶
func (r *CreateLicenseResponse) FromJsonString(s string) error
func (*CreateLicenseResponse) ToJsonString ¶
func (r *CreateLicenseResponse) ToJsonString() string
type DescribeKeysRequest ¶
type DescribeKeysRequest struct {
*tchttp.BaseRequest
// 使用的DRM方案类型,接口取值WIDEVINE、FAIRPLAY、NORMALAES。
DrmType *string `json:"DrmType,omitempty" name:"DrmType"`
// 加密的track列表,接口取值VIDEO、AUDIO。
Tracks []*string `json:"Tracks,omitempty" name:"Tracks" list`
// 内容类型。接口取值VodVideo,LiveVideo
ContentType *string `json:"ContentType,omitempty" name:"ContentType"`
// Base64编码的Rsa公钥,用来加密出参中的SessionKey。
// 如果该参数为空,则出参中SessionKey为明文。
RsaPublicKey *string `json:"RsaPublicKey,omitempty" name:"RsaPublicKey"`
// 一个加密内容的唯一标识。
// 如果该参数为空,则后台自动生成
ContentId *string `json:"ContentId,omitempty" name:"ContentId"`
}
func NewDescribeKeysRequest ¶
func NewDescribeKeysRequest() (request *DescribeKeysRequest)
func (*DescribeKeysRequest) FromJsonString ¶
func (r *DescribeKeysRequest) FromJsonString(s string) error
func (*DescribeKeysRequest) ToJsonString ¶
func (r *DescribeKeysRequest) ToJsonString() string
type DescribeKeysResponse ¶
type DescribeKeysResponse struct {
*tchttp.BaseResponse
Response *struct {
// 加密密钥列表
Keys []*Key `json:"Keys,omitempty" name:"Keys" list`
// 用来加密密钥。
// 如果入参中带有RsaPublicKey,则SessionKey为使用Rsa公钥加密后的二进制数据,Base64编码字符串。
// 如果入参中没有RsaPublicKey,则SessionKey为原始数据的字符串形式。
SessionKey *string `json:"SessionKey,omitempty" name:"SessionKey"`
// 内容ID
ContentId *string `json:"ContentId,omitempty" name:"ContentId"`
// Widevine方案的Pssh数据,Base64编码。
// Fairplay方案无该值。
Pssh *string `json:"Pssh,omitempty" name:"Pssh"`
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewDescribeKeysResponse ¶
func NewDescribeKeysResponse() (response *DescribeKeysResponse)
func (*DescribeKeysResponse) FromJsonString ¶
func (r *DescribeKeysResponse) FromJsonString(s string) error
func (*DescribeKeysResponse) ToJsonString ¶
func (r *DescribeKeysResponse) ToJsonString() string
type DrmOutputObject ¶
type DrmOutputObject struct {
// 输出的桶名称。
BucketName *string `json:"BucketName,omitempty" name:"BucketName"`
// 输出的对象名称。
ObjectName *string `json:"ObjectName,omitempty" name:"ObjectName"`
// 输出对象参数。
Para *DrmOutputPara `json:"Para,omitempty" name:"Para"`
}
type DrmOutputPara ¶
type DrmSourceObject ¶
type Key ¶
type Key struct {
// 加密track类型。
Track *string `json:"Track,omitempty" name:"Track"`
// 密钥ID。
KeyId *string `json:"KeyId,omitempty" name:"KeyId"`
// 原始Key使用AES-128 ECB模式和SessionKey加密的后的二进制数据,Base64编码的字符串。
Key *string `json:"Key,omitempty" name:"Key"`
// 原始IV使用AES-128 ECB模式和SessionKey加密的后的二进制数据,Base64编码的字符串。
Iv *string `json:"Iv,omitempty" name:"Iv"`
}
type PlaybackPolicy ¶
type StartEncryptionRequest ¶
type StartEncryptionRequest struct {
*tchttp.BaseRequest
// cos的end point。
CosEndPoint *string `json:"CosEndPoint,omitempty" name:"CosEndPoint"`
// cos api密钥id。
CosSecretId *string `json:"CosSecretId,omitempty" name:"CosSecretId"`
// cos api密钥。
CosSecretKey *string `json:"CosSecretKey,omitempty" name:"CosSecretKey"`
// 使用的DRM方案类型,接口取值WIDEVINE,FAIRPLAY
DrmType *string `json:"DrmType,omitempty" name:"DrmType"`
// 存储在COS上的原始内容信息
SourceObject *DrmSourceObject `json:"SourceObject,omitempty" name:"SourceObject"`
// 加密后的内容存储到COS的对象
OutputObjects []*DrmOutputObject `json:"OutputObjects,omitempty" name:"OutputObjects" list`
}
func NewStartEncryptionRequest ¶
func NewStartEncryptionRequest() (request *StartEncryptionRequest)
func (*StartEncryptionRequest) FromJsonString ¶
func (r *StartEncryptionRequest) FromJsonString(s string) error
func (*StartEncryptionRequest) ToJsonString ¶
func (r *StartEncryptionRequest) ToJsonString() string
type StartEncryptionResponse ¶
type StartEncryptionResponse struct {
*tchttp.BaseResponse
Response *struct {
// 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RequestId *string `json:"RequestId,omitempty" name:"RequestId"`
} `json:"Response"`
}
func NewStartEncryptionResponse ¶
func NewStartEncryptionResponse() (response *StartEncryptionResponse)
func (*StartEncryptionResponse) FromJsonString ¶
func (r *StartEncryptionResponse) FromJsonString(s string) error
func (*StartEncryptionResponse) ToJsonString ¶
func (r *StartEncryptionResponse) ToJsonString() string
Click to show internal directories.
Click to hide internal directories.