2004-03-09 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / class / corlib / System.Security.Cryptography / ProtectedData.cs
1 //
2 // ProtectedData.cs: Protect (encrypt) data 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 ProtectedData {
21
22                 // FIXME: interop could be important under windows - if one application protect some data using
23                 // mono and another one unprotects it using ms.net
24
25                 [MonoTODO ("interop with MS implementation ?")]
26                 public static byte[] Protect (byte[] userData, byte[] optionalEntropy, DataProtectionScope scope) 
27                 {
28                         if (userData == null)
29                                 throw new ArgumentNullException ("userData");
30
31                         // on Windows this is supported only under 2000 and later OS
32                         throw new PlatformNotSupportedException ();
33                 }
34
35                 [MonoTODO ("interop with MS implementation ?")]
36                 public static byte[] Unprotect (byte[] encryptedData, byte[] optionalEntropy, DataProtectionScope scope) 
37                 {
38                         if (encryptedData == null)
39                                 throw new ArgumentNullException ("encryptedData");
40
41                         // on Windows this is supported only under 2000 and later OS
42                         throw new PlatformNotSupportedException ();
43                 }
44         } 
45 }
46
47 #endif