1 // 2 // LocalServiceSecuritySettings.cs 3 // 4 // Author: 5 // Atsushi Enomoto <atsushi@ximian.com> 6 // 7 // Copyright (C) 2005 Novell, Inc. http://www.novell.com 8 // 9 // Permission is hereby granted, free of charge, to any person obtaining 10 // a copy of this software and associated documentation files (the 11 // "Software"), to deal in the Software without restriction, including 12 // without limitation the rights to use, copy, modify, merge, publish, 13 // distribute, sublicense, and/or sell copies of the Software, and to 14 // permit persons to whom the Software is furnished to do so, subject to 15 // the following conditions: 16 // 17 // The above copyright notice and this permission notice shall be 18 // included in all copies or substantial portions of the Software. 19 // 20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 // 28 using System; 29 using System.Collections.Generic; 30 using System.Collections.ObjectModel; 31 using System.Runtime.Serialization; 32 using System.Transactions; 33 using System.ServiceModel.Security; 34 35 namespace System.ServiceModel.Channels 36 { 37 [MonoTODO] 38 public sealed class LocalServiceSecuritySettings 39 { 40 bool detect_replays; 41 TimeSpan max_clock_skew; 42 bool reconnect; 43 int replay_cache_size; 44 TimeSpan inactivity_timeout, cookie_lifetime, 45 negotiation_timeout, replay_window, renewal_interval, 46 rollover_interval, validity_duration; 47 Collection<Type> claim_types = 48 new Collection<Type> (); 49 int max_sessions, max_negotiations, max_cached_cookies; 50 SecurityStateEncoder encoder; 51 bool send_fault; 52 LocalServiceSecuritySettings()53 public LocalServiceSecuritySettings () 54 { 55 } 56 57 public bool DetectReplays { 58 get { return detect_replays; } 59 set { detect_replays = value; } 60 } 61 62 public TimeSpan InactivityTimeout { 63 get { return inactivity_timeout; } 64 set { inactivity_timeout = value; } 65 } 66 67 public TimeSpan IssuedCookieLifetime { 68 get { return cookie_lifetime; } 69 set { cookie_lifetime = value; } 70 } 71 72 public int MaxCachedCookies { 73 get { return max_cached_cookies; } 74 set { max_cached_cookies = value; } 75 } 76 77 public TimeSpan MaxClockSkew { 78 get { return max_clock_skew; } 79 set { max_clock_skew = value; } 80 } 81 82 public int MaxPendingSessions { 83 get { return max_sessions; } 84 set { max_sessions = value; } 85 } 86 87 public int MaxStatefulNegotiations { 88 get { return max_negotiations; } 89 set { max_negotiations = value; } 90 } 91 92 public TimeSpan NegotiationTimeout { 93 get { return negotiation_timeout; } 94 set { negotiation_timeout = value; } 95 } 96 97 public bool ReconnectTransportOnFailure { 98 get { return reconnect; } 99 set { reconnect = value; } 100 } 101 102 public int ReplayCacheSize { 103 get { return replay_cache_size; } 104 set { replay_cache_size = value; } 105 } 106 107 public TimeSpan ReplayWindow { 108 get { return replay_window; } 109 set { replay_window = value; } 110 } 111 112 public TimeSpan SessionKeyRenewalInterval { 113 get { return renewal_interval; } 114 set { renewal_interval = value; } 115 } 116 117 public TimeSpan SessionKeyRolloverInterval { 118 get { return rollover_interval; } 119 set { rollover_interval = value; } 120 } 121 122 public TimeSpan TimestampValidityDuration { 123 get { return validity_duration; } 124 set { validity_duration = value; } 125 } 126 Clone()127 public LocalServiceSecuritySettings Clone () 128 { 129 LocalServiceSecuritySettings other = (LocalServiceSecuritySettings) MemberwiseClone (); 130 other.claim_types = new Collection<Type> (claim_types); 131 return other; 132 } 133 } 134 } 135