e79aa3c0ed
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
48 lines
1.7 KiB
C#
48 lines
1.7 KiB
C#
//------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
//------------------------------------------------------------
|
|
namespace System.ServiceModel
|
|
{
|
|
using System.ServiceModel.Channels;
|
|
|
|
public enum BasicHttpSecurityMode
|
|
{
|
|
None,
|
|
Transport,
|
|
Message,
|
|
TransportWithMessageCredential,
|
|
TransportCredentialOnly
|
|
}
|
|
|
|
static class BasicHttpSecurityModeHelper
|
|
{
|
|
internal static bool IsDefined(BasicHttpSecurityMode value)
|
|
{
|
|
return (value == BasicHttpSecurityMode.None ||
|
|
value == BasicHttpSecurityMode.Transport ||
|
|
value == BasicHttpSecurityMode.Message ||
|
|
value == BasicHttpSecurityMode.TransportWithMessageCredential ||
|
|
value == BasicHttpSecurityMode.TransportCredentialOnly);
|
|
}
|
|
|
|
internal static BasicHttpSecurityMode ToSecurityMode(UnifiedSecurityMode value)
|
|
{
|
|
switch (value)
|
|
{
|
|
case UnifiedSecurityMode.None:
|
|
return BasicHttpSecurityMode.None;
|
|
case UnifiedSecurityMode.Transport:
|
|
return BasicHttpSecurityMode.Transport;
|
|
case UnifiedSecurityMode.Message:
|
|
return BasicHttpSecurityMode.Message;
|
|
case UnifiedSecurityMode.TransportWithMessageCredential:
|
|
return BasicHttpSecurityMode.TransportWithMessageCredential;
|
|
case UnifiedSecurityMode.TransportCredentialOnly:
|
|
return BasicHttpSecurityMode.TransportCredentialOnly;
|
|
default:
|
|
return (BasicHttpSecurityMode)value;
|
|
}
|
|
}
|
|
}
|
|
}
|