You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by di...@apache.org on 2009/05/19 21:30:45 UTC

svn commit: r776426 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs

Author: digy
Date: Tue May 19 19:30:44 2009
New Revision: 776426

URL: http://svn.apache.org/viewvc?rev=776426&view=rev
Log:
LUCENENET-175 Add FIPS compliance to lucene.Net

Modified:
    incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs

Modified: incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
URL: http://svn.apache.org/viewvc/incubator/lucene.net/trunk/C%23/src/Lucene.Net/SupportClass.cs?rev=776426&r1=776425&r2=776426&view=diff
==============================================================================
--- incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs (original)
+++ incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs Tue May 19 19:30:44 2009
@@ -1257,4 +1257,22 @@
 
     #endregion
 
+    public class Cryptography
+    {
+        static public bool FIPSCompliant = false;
+
+        static public System.Security.Cryptography.HashAlgorithm GetHashAlgorithm()
+        {
+            if (FIPSCompliant)
+            {
+                //LUCENENET-175
+                //No Assumptions should be made on the HashAlgorithm. It may change in time.
+                //SHA256 SHA384 SHA512 etc.
+                return System.Security.Cryptography.SHA1.Create();
+            }
+            return System.Security.Cryptography.MD5.Create();
+        }
+    }
+
+
 }