You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,85 @@
|
||||
//------------------------------------------------------------
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//------------------------------------------------------------
|
||||
namespace System.ServiceModel
|
||||
{
|
||||
using System.Runtime;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.ComponentModel;
|
||||
|
||||
public sealed class WebHttpSecurity
|
||||
{
|
||||
internal const WebHttpSecurityMode DefaultMode = WebHttpSecurityMode.None;
|
||||
WebHttpSecurityMode mode;
|
||||
HttpTransportSecurity transportSecurity;
|
||||
bool isModeSet;
|
||||
|
||||
public WebHttpSecurity()
|
||||
{
|
||||
this.transportSecurity = new HttpTransportSecurity();
|
||||
}
|
||||
|
||||
public WebHttpSecurityMode Mode
|
||||
{
|
||||
get { return this.mode; }
|
||||
set
|
||||
{
|
||||
if (!WebHttpSecurityModeHelper.IsDefined(value))
|
||||
{
|
||||
throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("value"));
|
||||
}
|
||||
this.mode = value;
|
||||
this.isModeSet = true;
|
||||
}
|
||||
}
|
||||
|
||||
internal bool IsModeSet
|
||||
{
|
||||
get { return this.isModeSet; }
|
||||
}
|
||||
|
||||
public HttpTransportSecurity Transport
|
||||
{
|
||||
get { return this.transportSecurity; }
|
||||
set
|
||||
{
|
||||
this.transportSecurity = (value == null) ? new HttpTransportSecurity() : value;
|
||||
}
|
||||
}
|
||||
|
||||
internal void DisableTransportAuthentication(HttpTransportBindingElement http)
|
||||
{
|
||||
this.transportSecurity.DisableTransportAuthentication(http);
|
||||
}
|
||||
|
||||
internal void EnableTransportAuthentication(HttpTransportBindingElement http)
|
||||
{
|
||||
this.transportSecurity.ConfigureTransportAuthentication(http);
|
||||
}
|
||||
|
||||
internal void EnableTransportSecurity(HttpsTransportBindingElement https)
|
||||
{
|
||||
this.transportSecurity.ConfigureTransportProtectionAndAuthentication(https);
|
||||
}
|
||||
|
||||
internal bool InternalShouldSerialize()
|
||||
{
|
||||
return this.ShouldSerializeMode()
|
||||
|| this.ShouldSerializeTransport();
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeMode()
|
||||
{
|
||||
return this.Mode != DefaultMode;
|
||||
}
|
||||
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public bool ShouldSerializeTransport()
|
||||
{
|
||||
return this.Transport.InternalShouldSerialize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user