Merge pull request #505 from roji/shutdown_flow
[mono.git] / mcs / class / corlib / System.Security.Cryptography / CryptoAPITransform.cs
old mode 100755 (executable)
new mode 100644 (file)
index 64a2207..777017d
@@ -5,7 +5,7 @@
 //     Thomas Neidhart (tome@sbox.tugraz.at)
 //     Sebastien Pouliot (sebastien@ximian.com)
 //
-// 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
 //
 
 using System.Runtime.InteropServices;
+using System.Security.Permissions;
 
 namespace System.Security.Cryptography {
 
        // Note: This class isn't used by Mono as all algorithms are provided with
        // 100% managed implementations.
 
+       [ComVisible (true)]
        public sealed class CryptoAPITransform : ICryptoTransform {
 
                private bool m_disposed;
@@ -43,12 +45,6 @@ namespace System.Security.Cryptography {
                        m_disposed = false;
                }
 
-#if ! NET_2_0
-               ~CryptoAPITransform () 
-               {
-                       Dispose (false);
-               }
-#endif
 
                public bool CanReuseTransform {
                        get { return true; }
@@ -63,6 +59,7 @@ namespace System.Security.Cryptography {
                }
 
                public IntPtr KeyHandle {
+                       [SecurityPermission (SecurityAction.Demand, UnmanagedCode = true)]
                        get { return IntPtr.Zero; }
                }
 
@@ -70,7 +67,11 @@ namespace System.Security.Cryptography {
                        get { return 0; }
                }
 
+#if NET_4_0
+               public void Dispose ()
+#else
                void IDisposable.Dispose () 
+#endif
                {
                        Dispose (true);
                        GC.SuppressFinalize (this);  // Finalization is now unnecessary
@@ -103,11 +104,9 @@ namespace System.Security.Cryptography {
                        return null;
                }
 
-#if NET_2_0
                [ComVisible (false)]
                public void Reset ()
                {
                }
-#endif
        }
 }