Ejemplo n.º 1
0
        void RMSProtectedStreamCreationCallback_OnSuccess(byte[] drmContentBytes)
        {
            LogUtils.Log("RMSProtectedStreamCreationCallback_OnRMSSuccess");

            DRMContent drmContent = DRMContent.Parse(drmContentBytes);

            OnDecryptSuccess(drmContent, m_UserLicense);
        }
        private void OnDecryptComplete(MSCustomProtectedData data, NSError error)
        {
            try
            {
                LogUtils.Log("OnDecryptComplete");

                if (error != null)
                {
                    throw new Exception(error.ToString());
                }

                NSData nsdata    = data.RetrieveData;
                byte[] dataBytes = new byte[nsdata.Length];
                System.Runtime.InteropServices.Marshal.Copy(nsdata.Bytes, dataBytes, 0, Convert.ToInt32(nsdata.Length));

                DRMContent drmContent = DRMContent.Parse(dataBytes);
                OnDecryptSuccess(drmContent, new EndUserLicense(data.UserPolicy));
            }
            catch (Exception ex)
            {
                LogUtils.Error("Error while decrypting data ", ex);
                OnDecryptError(ex);
            }
        }