2002-12-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.Configuration / MachineKeyConfig.cs
1 //
2 // System.Web.Configuration.MachineKeyConfig
3 //
4 // Authors:
5 //      Gonzalo Paniagua Javier (gonzalo@ximian.com)
6 //
7 // (C) 2002 Ximian, Inc (http://www.ximian.com)
8 //
9
10 using System;
11 using System.Collections;
12 using System.Configuration;
13 using System.Xml;
14
15 namespace System.Web.Configuration
16 {
17         class MachineKeyConfig
18         {
19                 static MachineKeyConfig machineKey;
20                 byte [] validationKey;
21                 byte [] decryptionKey;
22                 string validationType;
23
24                 internal MachineKeyConfig (object parent)
25                 {
26                         if (parent is MachineKeyConfig) {
27                                 MachineKeyConfig p = (MachineKeyConfig) parent;
28                                 validationKey = p.validationKey;
29                                 decryptionKey = p.decryptionKey;
30                                 validationType = p.validationType;
31                         }
32                 }
33
34                 internal byte [] ValidationKey {
35                         get { return validationKey; }
36                         set { validationKey = value; }
37                 }
38
39                 internal byte [] DecryptionKey {
40                         get { return decryptionKey; }
41                         set { decryptionKey = value; }
42                 }
43
44                 internal string ValidationType {
45                         get {
46                                 if (validationType == null)
47                                         validationType = "SHA1";
48
49                                 return validationType;
50                         }
51                         set {
52                                 if (value == null)
53                                         return;
54
55                                 validationType = value;
56                         }
57                 }
58
59                 internal static MachineKeyConfig MachineKey {
60                         get { return machineKey; }
61                         set { machineKey = value; }
62                 }
63         }
64 }
65