コード例 #1
0
        public void ContentKeyCRUD()
        {
            IContentKey key = _mediaContext.ContentKeys.Create(Guid.NewGuid(), new byte[16] {
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
            });

            Assert.IsNotNull(_mediaContext.ContentKeys.Where(c => c.Id == key.Id).FirstOrDefault());
            Assert.AreEqual(ContentKeyType.CommonEncryption, key.ContentKeyType);
            Assert.AreEqual(ProtectionKeyType.X509CertificateThumbprint, key.ProtectionKeyType);
            UpdateDeleteContentKey(key);
            key = _mediaContext.ContentKeys.Create(Guid.NewGuid(), new byte[16] {
                1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
            });
            key.DeleteAsync();
        }