1 // created on 20/02/2003
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 // System.Security.Cryptography MD5 Class implementation
28 // Matthew S. Ford (Matthew.S.Ford@Rose-Hulman.Edu)
29 // Sebastien Pouliot (spouliot@motus.com)
31 // Copyright 2001 by Matthew S. Ford.
32 // Portions (C) 2002 Motus Technologies Inc. (http://www.motus.com)
34 // Comment: Adapted to the Project from Mono CVS as Sebastien Pouliot suggested to enable
35 // support of Npgsql MD5 authentication in platforms which don't have support for MD5 algorithm.
49 /// Common base class for all derived MD5 implementations.
51 internal abstract class MD5 : HashAlgorithm
54 /// Called from constructor of derived class.
56 // Why is it protected when others abstract hash classes are public ?
63 /// Creates the default derived class.
65 public static MD5 Create ()
67 //return Create ("System.Security.Cryptography.MD5");
68 return new MD5CryptoServiceProvider();
72 // Commented out because it uses the CryptoConfig which can't be available in all
75 /// Creates a new derived implementation.
77 /// <param name="hashName">Specifies which derived class to create</param>
78 public static new MD5 Create (string hashName)
80 return (MD5) CryptoConfig.CreateFromName (hashName);