5 // Implementation of the
\r
6 // System.Configuration.Assemblies.AssemblyHash
\r
7 // class for the Mono Class Library
\r
10 // Tomas Restrepo (tomasr@mvps.org)
\r
13 namespace System.Configuration.Assemblies {
\r
16 public struct AssemblyHash : System.ICloneable
\r
18 private AssemblyHashAlgorithm _algorithm;
\r
19 private byte[] _value;
\r
21 public static readonly AssemblyHash Empty =
\r
22 new AssemblyHash(AssemblyHashAlgorithm.None,null);
\r
28 public AssemblyHashAlgorithm Algorithm {
\r
29 get { return _algorithm; }
\r
30 set { _algorithm = value; }
\r
37 public AssemblyHash ( AssemblyHashAlgorithm algorithm, byte[] value )
\r
39 _algorithm = algorithm;
\r
41 if ( value != null )
\r
43 int size = value.Length;
\r
44 _value = new byte[size];
\r
45 System.Array.Copy ( value, _value, size );
\r
49 public AssemblyHash ( byte[] value )
\r
50 : this(AssemblyHashAlgorithm.SHA1, value)
\r
54 public object Clone()
\r
56 return new AssemblyHash(_algorithm,_value);
\r
59 public byte[] GetValue()
\r
63 public void SetValue ( byte[] value )
\r
68 } // class AssemblyHash
\r
70 } // namespace System.Configuration.Assemblies
\r