using System.Security.Permissions;
using System.Security.Cryptography.X509Certificates;
+#if !MOONLIGHT
using Mono.Security.Authenticode;
+#endif
namespace System.Security.Policy {
[Serializable]
- [MonoTODO ("Fix serialization compatibility with MS.NET")]
-#if NET_2_0
+ [MonoTODO ("Serialization format not compatible with .NET")]
[ComVisible (true)]
-#endif
public sealed class Evidence : ICollection, IEnumerable {
private bool _locked;
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);
_hashCode = 0;
}
+#if NET_4_0
+ [Obsolete]
+#endif
public void AddHost (object id)
{
if (_locked && SecurityManager.SecurityEnabled) {
_hashCode = 0;
}
-#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;
he = hostEvidenceList.GetEnumerator ();
IEnumerator ae = null;
if (assemblyEvidenceList != null)
- assemblyEvidenceList.GetEnumerator ();
+ ae = assemblyEvidenceList.GetEnumerator ();
return new EvidenceEnumerator (he, ae);
}
return AssemblyEvidenceList.GetEnumerator ();
}
-#if NET_2_0
[ComVisible (false)]
public override int GetHashCode ()
{
}
return _hashCode;
}
-#endif
public IEnumerator GetHostEnumerator ()
{
}
}
-#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
[MethodImplAttribute (MethodImplOptions.InternalCall)]
static extern bool IsAuthenticodePresent (Assembly a);
-
+#if NET_2_1
+ static internal Evidence GetDefaultHostEvidence (Assembly a)
+ {
+ return new Evidence ();
+ }
+#else
// this avoid us to build all evidences from the runtime
// (i.e. multiple unmanaged->managed calls) and also allows
// to delay their creation until (if) needed
}
}
}
-#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;
}
-
+
+#endif // NET_2_1
+
private class EvidenceEnumerator : IEnumerator {
private IEnumerator currentEnum, hostEnum, assemblyEnum;