Skip to content

Latest commit

 

History

History

BasicAESClearKey

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Dynamically encrypt your content with AES-128

This sample demonstrates how to dynamically encrypt your content with AES-128. It shows how to perform the following tasks:

  1. Creates a transform with built-in content aware encoding preset
  2. Submits a job
  3. Creates a ContentKeyPolicy using a secret key
  4. Associates the ContentKeyPolicy with StreamingLocator
  5. Gets a token and print a url for playback

When a stream is requested by a player, Media Services uses the specified key to dynamically encrypt your content with AES-128 and Azure Media Player uses the token to decrypt.

Prerequisites

Required Assemblies:

  • Azure.Identity
  • Azure.ResourceManager.Media
  • Microsoft.Extensions.Hosting
  • Microsoft.IdentityModel.Tokens
  • System.IdentityModel.Tokens.Jwt
  • System.Security.Claims

An Azure Media Services account. See the steps described in Create a Media Services account.

Build and run

Update the settings in appsettings.json in the root folder to match your Azure subscription, resource group and Media Services account. Then build and run the sample in Visual Studio or VS Code.

The sample will authenticate using any of the methods supported by DefaultAzureCredential.

Key concepts

Next steps