//
-// System.Security.Policy.HashMembershipCondition
+// System.Security.Policy.HashMembershipCondition.cs
//
// Authors:
// Jackson Harper (Jackson@LatitudeGeo.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2002 Jackson Harper, All rights reserved
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#if !MOONLIGHT
+
using System.Collections;
using System.Globalization;
using System.Reflection;
+using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Security.Cryptography;
namespace System.Security.Policy {
[Serializable]
-#if NET_2_0
+ [ComVisible (true)]
public sealed class HashMembershipCondition : IMembershipCondition, IDeserializationCallback, ISerializable {
-#else
- public sealed class HashMembershipCondition : IMembershipCondition {
-#endif
private readonly int version = 1;
private HashAlgorithm hash_algorithm;
{
}
- public HashMembershipCondition (HashAlgorithm hash_algorithm, byte[] hash_value)
+ public HashMembershipCondition (HashAlgorithm hashAlg, byte[] value)
{
- if (hash_algorithm == null)
- throw new ArgumentNullException ("hash_algorithm");
- if (hash_value == null)
- throw new ArgumentNullException ("hash_value");
+ if (hashAlg == null)
+ throw new ArgumentNullException ("hashAlg");
+ if (value == null)
+ throw new ArgumentNullException ("value");
- this.hash_algorithm = hash_algorithm;
- this.hash_value = (byte[]) hash_value.Clone ();
+ this.hash_algorithm = hashAlg;
+ this.hash_value = (byte[]) value.Clone ();
}
//
public override bool Equals (object o)
{
- HashMembershipCondition other;
- if (!(o is HashMembershipCondition))
+ HashMembershipCondition other = (o as HashMembershipCondition);
+ if (other == null)
return false;
- other = (HashMembershipCondition)o;
-
return ((other.HashAlgorithm == hash_algorithm) &&
Compare (hash_value, other.hash_value));
}
return se;
}
- public void FromXml (SecurityElement element)
+ public void FromXml (SecurityElement e)
{
- FromXml (element, null);
+ FromXml (e, null);
}
public void FromXml (SecurityElement e, PolicyLevel level)
return true;
}
-#if NET_2_0
[MonoTODO ("fx 2.0")]
void IDeserializationCallback.OnDeserialization (object sender)
{
void ISerializable.GetObjectData (SerializationInfo info, StreamingContext context)
{
}
-#endif
}
}
+#endif
+