using System.Security.Permissions;
using System.Security.Cryptography.X509Certificates;
-#if !NET_2_1 || MONOTOUCH
+#if !MOONLIGHT
using Mono.Security.Authenticode;
#endif
[Serializable]
[MonoTODO ("Serialization format not compatible with .NET")]
-#if NET_2_0
[ComVisible (true)]
-#endif
public sealed class Evidence : ICollection, IEnumerable {
private bool _locked;
private ArrayList hostEvidenceList;
private ArrayList assemblyEvidenceList;
-#if NET_2_0
private int _hashCode;
-#endif
public Evidence ()
{
Merge (evidence);
}
+#if NET_4_0
+ [Obsolete]
+#endif
public Evidence (object[] hostEvidence, object[] assemblyEvidence)
{
if (null != hostEvidence)
// Public Properties
//
+#if NET_4_0
+ [Obsolete]
+#endif
public int Count {
get {
int count = 0;
}
public bool IsSynchronized {
-#if NET_2_0
get { return false; }
-#else
- // LAMESPEC: Always TRUE (not FALSE)
- get { return true; }
-#endif
}
public bool Locked {
// Public Methods
//
+#if NET_4_0
+ [Obsolete]
+#endif
public void AddAssembly (object id)
{
AssemblyEvidenceList.Add (id);
-#if NET_2_0
_hashCode = 0;
-#endif
}
+#if NET_4_0
+ [Obsolete]
+#endif
public void AddHost (object id)
{
if (_locked && SecurityManager.SecurityEnabled) {
new SecurityPermission (SecurityPermissionFlag.ControlEvidence).Demand ();
}
HostEvidenceList.Add (id);
-#if NET_2_0
_hashCode = 0;
-#endif
}
-#if NET_2_0
[ComVisible (false)]
public void Clear ()
{
assemblyEvidenceList.Clear ();
_hashCode = 0;
}
-#endif
+#if NET_4_0
+ [Obsolete]
+#endif
public void CopyTo (Array array, int index)
{
int hc = 0;
assemblyEvidenceList.CopyTo (array, index + hc);
}
-#if NET_2_0
[ComVisible (false)]
public override bool Equals (object obj)
{
return true;
}
-#endif
+#if NET_4_0
+ [Obsolete]
+#endif
public IEnumerator GetEnumerator ()
{
IEnumerator he = null;
return AssemblyEvidenceList.GetEnumerator ();
}
-#if NET_2_0
[ComVisible (false)]
public override int GetHashCode ()
{
}
return _hashCode;
}
-#endif
public IEnumerator GetHostEnumerator ()
{
foreach (object o in evidence.assemblyEvidenceList)
AddAssembly (o);
}
-#if NET_2_0
_hashCode = 0;
-#endif
}
}
-#if NET_2_0
[ComVisible (false)]
public void RemoveType (Type t)
{
}
}
}
-#endif
// Use an icall to avoid multiple file i/o to detect the
// "possible" presence of an Authenticode signature
}
}
}
-#if NET_2_0
// assemblies loaded from the GAC also get a Gac evidence (new in Fx 2.0)
if (a.GlobalAssemblyCache) {
e.AddHost (new GacInstalled ());
e = dommgr.HostSecurityManager.ProvideAssemblyEvidence (a, e);
}
}
-#endif
+
return e;
}