Microsoft.WindowsAzure.MediaServices.Client.Tests.JobTests.ShouldSubmitAndFinishPlayReadyProtectionJobWithKey C# (CSharp) Method

ShouldSubmitAndFinishPlayReadyProtectionJobWithKey() private method

        public void ShouldSubmitAndFinishPlayReadyProtectionJobWithKey()
        {
            // Use the published PlayReady Test Key Seed to generate a content key based on a randomly generated Guid.
            // We could also use a cryptographically sound random number generator here like RNGCryptoServiceProvider.
            byte[] keySeed = Convert.FromBase64String("XVBovsmzhP9gRIZxWfFta3VVRPzVEWmJsazEJ46I");
            Guid keyId = Guid.NewGuid();
            byte[] keyValue = CommonEncryption.GeneratePlayReadyContentKey(keySeed, keyId);
            string configuration = File.ReadAllText(WindowsAzureMediaServicesTestConfiguration.PlayReadyConfigWithContentKey);
            configuration = UpdatePlayReadyConfigurationXML(keyId, keyValue, new Uri("http://www.fakeurl.com"), configuration);

            IAsset asset = CreateSmoothAsset();
            IMediaProcessor mediaEncryptor = GetMediaProcessor(_mediaContext, WindowsAzureMediaServicesTestConfiguration.MpEncryptorName);
            IJob job = CreateAndSubmitOneTaskJob(_mediaContext, GenerateName("ShouldSubmitAndFinishPlayReadyProtectionJob"), mediaEncryptor, configuration, asset, TaskOptions.None);
            WaitForJob(job.Id, JobState.Finished, VerifyAllTasksFinished);
        }
JobTests