| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Configuration; |
| | | 5 | | |
| | | 6 | | namespace CoreWCF.Configuration |
| | | 7 | | { |
| | | 8 | | public class WSHttpSecurityElement : ServiceModelConfigurationElement |
| | | 9 | | { |
| | | 10 | | [ConfigurationProperty(ConfigurationStrings.Mode, DefaultValue = SecurityMode.Message)] |
| | | 11 | | public SecurityMode Mode |
| | | 12 | | { |
| | 5 | 13 | | get { return (SecurityMode)base[ConfigurationStrings.Mode]; } |
| | 0 | 14 | | set { base[ConfigurationStrings.Mode] = value; } |
| | | 15 | | } |
| | | 16 | | |
| | | 17 | | [ConfigurationProperty(ConfigurationStrings.Transport)] |
| | | 18 | | public WSHttpTransportSecurityElement Transport |
| | | 19 | | { |
| | 2 | 20 | | get { return (WSHttpTransportSecurityElement)base[ConfigurationStrings.Transport]; } |
| | | 21 | | } |
| | | 22 | | |
| | | 23 | | [ConfigurationProperty(ConfigurationStrings.Message)] |
| | | 24 | | public NonDualMessageSecurityOverHttpElement Message |
| | | 25 | | { |
| | 2 | 26 | | get { return (NonDualMessageSecurityOverHttpElement)base[ConfigurationStrings.Message]; } |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | internal void ApplyConfiguration(WSHTTPSecurity security) |
| | | 30 | | { |
| | 2 | 31 | | if (security == null) |
| | | 32 | | { |
| | 0 | 33 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security)); |
| | | 34 | | } |
| | | 35 | | |
| | 2 | 36 | | security.Mode = Mode; |
| | 2 | 37 | | Transport.ApplyConfiguration(security.Transport); |
| | 2 | 38 | | Message.ApplyConfiguration(security.Message); |
| | 2 | 39 | | } |
| | | 40 | | } |
| | | 41 | | } |