コード例 #1
0
 private void radioButtonHex_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButtonContentKeyHex.Checked)
     {
         textBoxcontentkey.Text = DynamicEncryption.ByteArrayToHexString(Convert.FromBase64String(textBoxcontentkey.Text));
     }
 }
コード例 #2
0
 private void UpdateCalculatedContentKey()
 {
     textBoxContentKeyCalculated.Text = string.Empty;
     if (!multiassets && this.PlayReadyKeyId != null)
     {
         if (!string.IsNullOrEmpty(this.PlayReadyKeySeed))
         {
             try
             {
                 byte[] bytecontentkey = DynamicEncryption.GeneratePlayReadyContentKey(Convert.FromBase64String(this.PlayReadyKeySeed), (Guid)this.PlayReadyKeyId);
                 if (radioButtonContentKeyBase64.Checked) // base64
                 {
                     textBoxContentKeyCalculated.Text = Convert.ToBase64String(bytecontentkey);
                 }
                 else // HEX
                 {
                     textBoxContentKeyCalculated.Text = DynamicEncryption.ByteArrayToHexString(bytecontentkey);
                 }
             }
             catch
             {
                 textBoxContentKeyCalculated.Text = "(error)";
             }
         }
         else // seed empty, so calulated key is the content key
         {
             textBoxContentKeyCalculated.Text = textBoxcontentkey.Text;
         }
     }
 }
コード例 #3
0
 private void radioButtonKeySeedHex_CheckedChanged(object sender, EventArgs e)
 {
     if (radioButtonKeySeedHex.Checked)
     {
         try
         {
             textBoxkeyseed.Text = DynamicEncryption.ByteArrayToHexString(Convert.FromBase64String(textBoxkeyseed.Text));
         }
         catch
         {
             textBoxkeyseed.Text = string.Empty;
         }
     }
 }