2004-04-05 Bernie Solomon <bernard@ugsolutions.com>
[mono.git] / mcs / class / corlib / System.Security.Cryptography / ProtectedMemory.cs
1 //
2 // ProtectedMemory.cs: Protect (encrypt) memory without (user involved) key management
3 //
4 // Author:
5 //      Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
8 //
9
10 #if NET_1_2
11
12 using System;
13
14 namespace System.Security.Cryptography {
15
16         // References:
17         // a.   Windows Data Protection
18         //      http://msdn.microsoft.com/library/en-us/dnsecure/html/windataprotection-dpapi.asp?frame=true
19
20         public sealed class ProtectedMemory {
21
22                 [MonoTODO]
23                 public static void Protect (byte[] userData, MemoryProtectionScope scope) 
24                 {
25                         if (userData == null)
26                                 throw new ArgumentNullException ("userData");
27                         if (userData.Length % 16 != 0)
28                                 throw new CryptographicException ("not a multiple of 16 bytes");
29
30                         // on Windows this is supported only under XP and later OS
31                         throw new PlatformNotSupportedException ();
32                 }
33
34                 [MonoTODO]
35                 public static void Unprotect (byte[] encryptedData, MemoryProtectionScope scope) 
36                 {
37                         if (encryptedData == null)
38                                 throw new ArgumentNullException ("encryptedData");
39                         if (encryptedData.Length % 16 != 0)
40                                 throw new CryptographicException ("not a multiple of 16 bytes");
41
42                         // on Windows this is supported only under XP and later OS
43                         throw new PlatformNotSupportedException ();
44                 }
45         } 
46 }
47
48 #endif