Add new 4.5 api
authorMarek Safar <marek.safar@gmail.com>
Thu, 7 Jun 2012 08:30:08 +0000 (09:30 +0100)
committerMarek Safar <marek.safar@gmail.com>
Thu, 7 Jun 2012 10:38:53 +0000 (11:38 +0100)
mcs/class/corlib/System.Security.Cryptography/CryptoStream.cs
mcs/class/corlib/System.Security.Cryptography/RandomNumberGenerator.cs

index 7b98be5a75c0c0ff742c3c725cc33e2578682993..e749a7cd7199fd511bcea91fcb80770c118c2ee9 100644 (file)
 using System.Globalization;
 using System.IO;
 using System.Runtime.InteropServices;
+#if NET_4_5
+using System.Threading;
+using System.Threading.Tasks;
+#endif
 
 namespace System.Security.Cryptography {
 
@@ -357,10 +361,28 @@ namespace System.Security.Cryptography {
                                }
                        }
                }
+               
 #if NET_4_0
                public bool HasFlushedFinalBlock {
                        get { return _flushedFinalBlock; }
                }
 #endif
+               
+#if NET_4_5
+               public override Task FlushAsync (CancellationToken cancellationToken)
+               {
+                       return base.FlushAsync (cancellationToken);
+               }
+               
+               public override Task<int> ReadAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+               {
+                       return base.ReadAsync (buffer, offset, count, cancellationToken);
+               }
+               
+               public override Task WriteAsync (byte[] buffer, int offset, int count, CancellationToken cancellationToken)
+               {
+                       return base.WriteAsync (buffer, offset, count, cancellationToken);
+               }
+#endif
        }
 }
index 4ae6491f2c8bf8a5a87f41b7728ce9ea24208076..c8160ad4b72da23c02340976becca6fb2125aaa7 100644 (file)
@@ -57,7 +57,16 @@ namespace System.Security.Cryptography {
 
                public abstract void GetBytes (byte[] data);
 
+#if NET_4_5
+               public virtual void GetNonZeroBytes (byte[] data)
+               {
+                       throw new NotImplementedException ();
+               }
+#else
                public abstract void GetNonZeroBytes (byte[] data);
+#endif
+               
+               
 #if NET_4_0 || MOONLIGHT
                public void Dispose ()
                {