| | | 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.ComponentModel; |
| | | 5 | | using System.Configuration; |
| | | 6 | | using CoreWCF.Security; |
| | | 7 | | |
| | | 8 | | namespace CoreWCF.Configuration |
| | | 9 | | { |
| | | 10 | | public class MessageSecurityOverTcpElement : ServiceModelConfigurationElement |
| | | 11 | | { |
| | | 12 | | [ConfigurationProperty(ConfigurationStrings.ClientCredentialType, DefaultValue = MessageCredentialType.Windows)] |
| | | 13 | | public MessageCredentialType ClientCredentialType |
| | | 14 | | { |
| | 9 | 15 | | get { return (MessageCredentialType)base[ConfigurationStrings.ClientCredentialType]; } |
| | 0 | 16 | | set { base[ConfigurationStrings.ClientCredentialType] = value; } |
| | | 17 | | } |
| | | 18 | | |
| | | 19 | | [ConfigurationProperty(ConfigurationStrings.AlgorithmSuite, DefaultValue = ConfigurationStrings.Default)] |
| | | 20 | | [TypeConverter(typeof(SecurityAlgorithmSuiteConverter))] |
| | | 21 | | public SecurityAlgorithmSuite AlgorithmSuite |
| | | 22 | | { |
| | 0 | 23 | | get { return (SecurityAlgorithmSuite)base[ConfigurationStrings.AlgorithmSuite]; } |
| | 0 | 24 | | set { base[ConfigurationStrings.AlgorithmSuite] = value; } |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | internal void ApplyConfiguration(MessageSecurityOverTcp security) |
| | | 28 | | { |
| | 9 | 29 | | if (security == null) |
| | | 30 | | { |
| | 0 | 31 | | throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull(nameof(security)); |
| | | 32 | | } |
| | | 33 | | |
| | 9 | 34 | | security.ClientCredentialType = ClientCredentialType; |
| | | 35 | | |
| | 9 | 36 | | if (PropertyValueOrigin.Default != ElementInformation.Properties[ConfigurationStrings.AlgorithmSuite].ValueO |
| | | 37 | | { |
| | 0 | 38 | | security.AlgorithmSuite = AlgorithmSuite; |
| | | 39 | | } |
| | 9 | 40 | | } |
| | | 41 | | } |
| | | 42 | | } |