public static bool ConfigurationHasDuplicateKeyIdentifiers(RijndaelEncryptionServiceConfig section)
{
// Combine all key identifier values, filter the empty ones, split them
return section
.ExpiredKeys
.Cast<RijndaelExpiredKey>()
.Select(x => x.KeyIdentifier)
.Union(new[]
{
section.KeyIdentifier
})
.Where(x => !string.IsNullOrEmpty(x))
.Select(x => x.Split(';'))
.SelectMany(x => x)
.GroupBy(x => x)
.Any(x => x.Count() > 1);
}