2009-01-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mcs / class / System / System.Net / CredentialCache.cs
index 9b2b9f5b51b6158ad4e566f9a24bd89052b2f5e4..cc2ec8029dff262c8bd3cc01e283d65de4ceba81 100644 (file)
@@ -31,8 +31,12 @@ using System.Collections;
 using System.Runtime.Serialization;
 
 namespace System.Net {
-       public class CredentialCache : ICredentials, IEnumerable {
-               static NetworkCredential empty = new NetworkCredential ("", "", "");
+       public class CredentialCache : ICredentials, IEnumerable
+#if NET_2_0
+                                    , ICredentialsByHost
+#endif
+       {
+               static NetworkCredential empty = new NetworkCredential (String.Empty, String.Empty, String.Empty);
                Hashtable cache;
 
                public CredentialCache () 
@@ -126,6 +130,26 @@ namespace System.Net {
                        cache.Remove (new CredentialCacheKey (uriPrefix, authType));
                }
                
+#if NET_2_0
+               [MonoNotSupported ("")]
+               public void Add (string host, int port, string authenticationType, NetworkCredential credential)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public NetworkCredential GetCredential (string host, int port, string authenticationType)
+               {
+                       throw new NotImplementedException ();
+               }
+
+               [MonoNotSupported ("")]
+               public void Remove (string host, int port, string authenticationType)
+               {
+                       throw new NotImplementedException ();
+               }
+#endif
+
                class CredentialCacheKey {
                        Uri uriPrefix;
                        string authType;
@@ -143,7 +167,7 @@ namespace System.Net {
 
                                this.len = uriPrefix.AbsoluteUri.Length;
                                this.hash = uriPrefix.GetHashCode () 
-                                         + authType.ToString ().GetHashCode ();
+                                         + authType.GetHashCode ();
                        }
                        
                        public int Length {
@@ -181,3 +205,4 @@ namespace System.Net {
        } 
 }
 
+