2010-06-03 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.ServiceModel / System.ServiceModel.Channels / LocalClientSecuritySettings.cs
blobef58f946dff47038fb7ba7205b1bcf65e850b9ff
1 //
2 // LocalClientSecuritySettings.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.
28 using System;
29 using System.ServiceModel.Security;
31 namespace System.ServiceModel.Channels
33 [MonoTODO]
34 public sealed class LocalClientSecuritySettings
36 #if !NET_2_1
37 bool cache_cookies = true;
38 int cookie_renewal = 60;
39 bool detect_replays = true;
40 IdentityVerifier verifier = IdentityVerifier.CreateDefault ();
41 TimeSpan max_cookie_cache_time = TimeSpan.MaxValue;
42 bool reconnect = true;
43 int replay_cache_size = 900000;
44 TimeSpan renewal_interval = TimeSpan.FromHours (10);
45 TimeSpan rollover_interval = TimeSpan.FromMinutes (5);
46 #endif
48 public LocalClientSecuritySettings ()
50 MaxClockSkew = TimeSpan.FromMinutes (5);
51 ReplayWindow = TimeSpan.FromMinutes (5);
52 TimestampValidityDuration = TimeSpan.FromMinutes (5);
55 public TimeSpan MaxClockSkew { get; set; }
56 public TimeSpan ReplayWindow { get; set; }
57 public TimeSpan TimestampValidityDuration { get; set; }
59 #if !NET_2_1
60 public bool CacheCookies {
61 get { return cache_cookies; }
62 set { cache_cookies = value; }
64 public int CookieRenewalThresholdPercentage {
65 get { return cookie_renewal; }
66 set { cookie_renewal = value; }
68 public bool DetectReplays {
69 get { return detect_replays; }
70 set { detect_replays = value; }
72 public IdentityVerifier IdentityVerifier {
73 get { return verifier; }
74 set { verifier = value; }
76 public TimeSpan MaxCookieCachingTime {
77 get { return max_cookie_cache_time; }
78 set { max_cookie_cache_time = value; }
80 public bool ReconnectTransportOnFailure {
81 get { return reconnect; }
82 set { reconnect = value; }
84 public int ReplayCacheSize {
85 get { return replay_cache_size; }
86 set { replay_cache_size = value; }
88 public TimeSpan SessionKeyRenewalInterval {
89 get { return renewal_interval; }
90 set { renewal_interval = value; }
92 public TimeSpan SessionKeyRolloverInterval {
93 get { return rollover_interval; }
94 set { rollover_interval = value; }
96 #endif
98 [MonoTODO ("What happens to IdentityVerifier?")]
99 public LocalClientSecuritySettings Clone ()
101 return (LocalClientSecuritySettings) MemberwiseClone ();