(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / corlib / System.Configuration.Assemblies / AssemblyHash.cs
blob001da32ba4f34acac784094bad5e517ca6cab4af
2 //
3 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining
6 // a copy of this software and associated documentation files (the
7 // "Software"), to deal in the Software without restriction, including
8 // without limitation the rights to use, copy, modify, merge, publish,
9 // distribute, sublicense, and/or sell copies of the Software, and to
10 // permit persons to whom the Software is furnished to do so, subject to
11 // the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be
14 // included in all copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 // AssemblyHash.cs
28 // Implementation of the
29 // System.Configuration.Assemblies.AssemblyHash
30 // class for the Mono Class Library
32 // Author:
33 // Tomas Restrepo (tomasr@mvps.org)
36 namespace System.Configuration.Assemblies {
38 [Serializable]
39 public struct AssemblyHash : System.ICloneable
41 private AssemblyHashAlgorithm _algorithm;
42 private byte[] _value;
44 public static readonly AssemblyHash Empty =
45 new AssemblyHash(AssemblyHashAlgorithm.None,null);
49 // properties
51 public AssemblyHashAlgorithm Algorithm {
52 get { return _algorithm; }
53 set { _algorithm = value; }
58 // construction
60 public AssemblyHash ( AssemblyHashAlgorithm algorithm, byte[] value )
62 _algorithm = algorithm;
63 _value = null;
64 if ( value != null )
66 int size = value.Length;
67 _value = new byte[size];
68 System.Array.Copy ( value, _value, size );
72 public AssemblyHash ( byte[] value )
73 : this(AssemblyHashAlgorithm.SHA1, value)
77 public object Clone()
79 return new AssemblyHash(_algorithm,_value);
82 public byte[] GetValue()
84 return _value;
86 public void SetValue ( byte[] value )
88 _value = value;
91 } // class AssemblyHash
93 } // namespace System.Configuration.Assemblies