Imported Upstream version 4.3.2.467

Former-commit-id: 9c2cb47f45fa221e661ab616387c9cda183f283d
This commit is contained in:
Xamarin Public Jenkins
2016-02-22 11:00:01 -05:00
parent f302175246
commit f3e3aab35a
4097 changed files with 122406 additions and 82300 deletions

View File

@ -18,6 +18,7 @@ namespace System.ServiceModel.Security
using System.Net.Security;
using System.Runtime;
using System.Security;
using System.Security.Authentication;
using System.Security.Authentication.ExtendedProtection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
@ -105,6 +106,28 @@ namespace System.ServiceModel.Security
}
}
static class SslProtocolsHelper
{
internal static bool IsDefined(SslProtocols value)
{
SslProtocols allValues = SslProtocols.None;
foreach (var protocol in Enum.GetValues(typeof(SslProtocols)))
{
allValues |= (SslProtocols)protocol;
}
return (value & allValues) == value;
}
internal static void Validate(SslProtocols value)
{
if (!IsDefined(value))
{
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value,
typeof(SslProtocols)));
}
}
}
static class TokenImpersonationLevelHelper
{
internal static bool IsDefined(TokenImpersonationLevel value)