public static IContentKey CreateTestKeyWithSpecified(string keyIdentifier, CloudMediaContext mediaContext, ContentKeyType contentKeyType, string name = "")
{
var keyId = EncryptionUtils.GetKeyIdAsGuid(keyIdentifier);
SymmetricAlgorithm symmetricAlgorithm = new AesCryptoServiceProvider();
if ((contentKeyType == ContentKeyType.CommonEncryption) ||
(contentKeyType == ContentKeyType.EnvelopeEncryption))
{
symmetricAlgorithm.KeySize = EncryptionUtils.KeySizeInBitsForAes128;
}
else
{
symmetricAlgorithm.KeySize = EncryptionUtils.KeySizeInBitsForAes256;
}
IContentKey contentKey = mediaContext.ContentKeys.Create(keyId, symmetricAlgorithm.Key, name, contentKeyType);
return contentKey;
}