DrmToken (which is used to get the decryption key)
DrmToken) to the client.sha256, the key distribution service will use a symmetric key to encrypt the content key.sha256, the client will need to use a symmetric key to decrypt the key information obtained before it can decrypt and play the video.DrmTokenDrmToken is essentially a variant of JSON Web Token (JWT). It also consists of three parts: the header, the payload, and the signature. However, unlike JWT, VOD connects the three parts with ~.{"alg": "HS256","typ": "JWT"}
{"type": "DrmToken","appId": 1500014561,"fileId": "387702307091793695","currentTimeStamp": 1650964374,"expireTimeStamp": 2147483647,"random": 4220003655,"protectSchema": "sha256","issuer": "client"}
Parameter | Type | Required | Description |
type | string | Yes | The signature type, which should be set to DrmToken. |
appId | int64 | Yes | The AppId. |
fileId | string | Yes | The file ID. |
issuer | string | Yes | The issuer, which should be set to client. |
currentTimeStamp | int64 | Yes | The current time (Unix timestamp). |
expireTimeStamp | int64 | No | The expiration time (Unix timestamp). If you do not specify this, the signature will not expire. |
random | int64 | No | A random number. |
protectSchema | string | No | The protection mode. This parameter is valid only if the encryption scheme is SimpleAES. If you set this parameter to sha256, sha256(pkey) will be used as the symmetric key to encrypt the content key (pkey is the playback key, and sha256 indicates the SHA-256 algorithm). |
Signature = HMACSHA256(base64UrlEncode(Header) + "." + base64UrlEncode(Payload), pkey)base64UrlEncode, see Base 64 Encoding with URL and Filename Safe Alphabet.pkey) in the VOD console:
DrmToken example{"alg": "HS256","typ": "JWT"}
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9{"type": "DrmToken","appId": 1500014561,"fileId": "387702307091793695","currentTimeStamp": 1650964374,"expireTimeStamp": 2147483647,"random": 4220003655,"protectSchema": "sha256","issuer": "client"}
eyJ0eXBlIjoiRHJtVG9rZW4iLCJhcHBJZCI6MTUwMDAxNDU2MSwiZmlsZUlkIjoiMzg3NzAyMzA3MDkxNzkzNjk1IiwiY3VycmVudFRpbWVTdGFtcCI6MTY1MDk2NDM3NCwiZXhwaXJlVGltZVN0YW1wIjoyMTQ3NDgzNjQ3LCJyYW5kb20iOjQyMjAwMDM2NTUsInByb3RlY3RTY2hlbWEiOiJzaGEyNTYiLCJpc3N1ZXIiOiJjbGllbnQifQdK42jB0KP4sXCd7Dunng9AcQ2WlnANuB87PwxmTc3_g. It is generated using pkey (whose value is JduzsUuRvGVPRHvIYwLv).~ and you will get the DrmToken, which is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9~eyJ0eXBlIjoiRHJtVG9rZW4iLCJhcHBJZCI6MTUwMDAxNDU2MSwiZmlsZUlkIjoiMzg3NzAyMzA3MDkxNzkzNjk1IiwiY3VycmVudFRpbWVTdGFtcCI6MTY1MDk2NDM3NCwiZXhwaXJlVGltZVN0YW1wIjoyMTQ3NDgzNjQ3LCJyYW5kb20iOjQyMjAwMDM2NTUsInByb3RlY3RTY2hlbWEiOiJzaGEyNTYiLCJpc3N1ZXIiOiJjbGllbnQifQ~JZ0sAV214-7vNckjb-llSntnqsIr-qF5oD4Lv7L1qGQ.MediaInfoSet.AdaptiveDynamicStreamingInfo.AdaptiveDynamicStreamingSet.Url).http(s)://xxx.com/xxx/xxx/test.m3u8.http(s)://xxx.com/xxx/xxx/voddrm.token.<DrmToken>.test.m3u8.voddrm.token. is added to the filename, and the value of <DrmToken> is the DrmToken generated above.https://1500014561.vod2.myqcloud.com/4395be81vodtranscq1500014561/8f8e01fb387702307091793695/adp.12.m3u8?t=9ee2bdd0&sign=46f6120466d6e931ad792bad8e4f8dff.DrmToken is eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9~eyJ0eXBlIjoiRHJtVG9rZW4iLCJhcHBJZCI6MTUwMDAxNDU2MSwiZmlsZUlkIjoiMzg3NzAyMzA3MDkxNzkzNjk1IiwiY3VycmVudFRpbWVTdGFtcCI6MTY1MDk2NDM3NCwiZXhwaXJlVGltZVN0YW1wIjoyMTQ3NDgzNjQ3LCJyYW5kb20iOjQyMjAwMDM2NTUsInByb3RlY3RTY2hlbWEiOiJzaGEyNTYiLCJpc3N1ZXIiOiJjbGllbnQifQ~JZ0sAV214-7vNckjb-llSntnqsIr-qF5oD4Lv7L1qGQ.https://1500014561.vod2.myqcloud.com/4395be81vodtranscq1500014561/8f8e01fb387702307091793695/voddrm.token.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9~eyJ0eXBlIjoiRHJtVG9rZW4iLCJhcHBJZCI6MTUwMDAxNDU2MSwiZmlsZUlkIjoiMzg3NzAyMzA3MDkxNzkzNjk1IiwiY3VycmVudFRpbWVTdGFtcCI6MTY1MDk2NDM3NCwiZXhwaXJlVGltZVN0YW1wIjoyMTQ3NDgzNjQ3LCJyYW5kb20iOjQyMjAwMDM2NTUsInByb3RlY3RTY2hlbWEiOiJzaGEyNTYiLCJpc3N1ZXIiOiJjbGllbnQifQ~JZ0sAV214-7vNckjb-llSntnqsIr-qF5oD4Lv7L1qGQ.adp.12.m3u8?t=9ee2bdd0&sign=46f6120466d6e931ad792bad8e4f8dff.CipherContentKey) when it tries to play the video. The request URL is specified by #EXT-X-KEY in the M3U8 file. Below is an example:#EXT-X-KEY:METHOD=AES-128,URI="https://drm.vod2.myqcloud.com/getlicense/v1?drmType=SimpleAES&token=<DrmToken>"
SymmetricKey):SymmetricKey=SHA256(pkey)SHA256 indicates the SHA-256 algorithm, and pkey is the playback key/ContentKey):ContentKey=AES-CBC-Descrypt(CipherContentKey, SymmetricKey, IV)CipherContentKey is the encrypted content key, which is returned by VOD’s key distribution service and does not include IV data. AES-CBC-Descrypt indicates the AES-CBC algorithm. IV is the initialization vector, which is 0x00000000000000000000000000000000.pkey) is JduzsUuRvGVPRHvIYwLv, and the symmetric key (SymmetricKey) is 0xece0bae38fbbd66f79c62acefb9ea994dc834d79b45cc4556962d9f00508b9b3 (32 bytes).CipherContentKey) is 0x68addf7984478a3e4797d3a13ecbb6fb (16 bytes). 0x00000000000000000000000000000000 (16 bytes).ContentKey) would be 0xbed3747b8510b040826163c04956a4c1 (16 bytes).Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan