Create and sign a license service message
This article is a part of a DRM Quick Start Guide.
Before you can send an Entitlement Message to the License Service, you have to wrap it into a so called License Service Message and make a signed JWT token out of it.
License Service Message is a JSON data structure used as an envelope. Here is a minimalistic version (additionally, you can specify a time period of validity of the enclosed Entitlement Message):
{
"version": 1,
"com_key_id": communicationKeyId,
"message": entitlementMessage
}
Here communicationKeyId
is a value you received as a part of your DRM configuration (check My Mosaic / DRM), and an entitlementMessage
is a JSON you generated in the previous section.
We highly recommend also setting a short expiration_date
to limit unintended re-use of the tokens.
To create a JWT, use the License Service Message above as a payload and sign it with HMAC-SHA256 algorithm using your Communication Key
as a signing key. Then apply base64 encoding.
The easiest way to do it: copy your JSON to the DRM Video Playback Tool under "License Service Message" and click the "License Service Message -> JWT" button (add your Communication Key and Communication Key ID to the corresponding fields).
To generate a JWT programmatically, check Signing a License Service Message article. It shows how to create and sign the JWT in many programming languages, including JavaScript, C#, PHP, Python, Rust, Go, C++, Swift, Scala, Java.
To send your JWT to Axinom DRM License Service use one of the methods described in License Service Message.
Next steps​
See also​
- License Service Message - definition of the data structure; how to send it to a License Service
- DRM Video Playback Tool - allows to create and sign a JWT based on your JSON and communication key
- Signing a License Service Message - how to create a License Service Message, convert it to JWT and sign programmatically with examples in many programming languages