lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r776426 - /incubator/lucene.net/trunk/C#/src/Lucene.Net/SupportClass.cs
Date Tue, 19 May 2009 19:30:45 GMT
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();
+        }
+    }
+
+
 }



Mime
View raw message