You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2016/05/18 02:09:41 UTC

svn commit: r1744344 - /commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java

Author: ggregory
Date: Wed May 18 02:09:41 2016
New Revision: 1744344

URL: http://svn.apache.org/viewvc?rev=1744344&view=rev
Log:
[CODEC-213] Support JEP 287: SHA-3 Hash Algorithms.

Modified:
    commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java

Modified: commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java?rev=1744344&r1=1744343&r2=1744344&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java (original)
+++ commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithms.java Wed May 18 02:09:41 2016
@@ -25,7 +25,13 @@ import java.security.MessageDigest;
  * <p>
  * This class is immutable and thread-safe.
  * </p>
- *
+ * <p>
+ * Java 8 and up: SHA-224.
+ * </p>
+ * <p>
+ * Java 9 and up: SHA3-224, SHA3-256, SHA3-384, SHA3-512.
+ * </p>
+ * 
  * @see <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html">Java Cryptography
  *      Architecture Standard Algorithm Name Documentation</a>
  * @since 1.7 // * @deprecated Use the enum {@link MessageDigestAlgorithm}.
@@ -75,13 +81,53 @@ public class MessageDigestAlgorithms {
     public static final String SHA_512 = "SHA-512";
 
     /**
+     * The SHA3-224 hash algorithm defined in the FIPS PUB 180-4.
+     * <p>
+     * Present in Oracle Java 9.
+     * </p>
+     * 
+     * @since 1.11
+     */
+    public static final String SHA3_224 = "SHA3_224";
+
+    /**
+     * The SHA3-256 hash algorithm defined in the FIPS PUB 180-4.
+     * <p>
+     * Present in Oracle Java 9.
+     * </p>
+     * 
+     * @since 1.11
+     */
+    public static final String SHA3_256 = "SHA3-256";
+
+    /**
+     * The SHA3-384 hash algorithm defined in the FIPS PUB 180-4.
+     * <p>
+     * Present in Oracle Java 9.
+     * </p>
+     * 
+     * @since 1.11
+     */
+    public static final String SHA3_384 = "SHA3-384";
+
+    /**
+     * The SHA3-512 hash algorithm defined in the FIPS PUB 180-4.
+     * <p>
+     * Present in Oracle Java 9.
+     * </p>
+     * 
+     * @since 1.11
+     */
+    public static final String SHA3_512 = "SHA3-512";
+
+    /**
      * Gets all constant values defined in this class.
      * 
      * @return all constant values defined in this class.
      * @since 1.11
      */
     public static String[] values() {
-        return new String[] { MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512 };
+        return new String[] { MD2, MD5, SHA_1, SHA_224, SHA_256, SHA_384, SHA_512, SHA3_224, SHA3_256, SHA3_384, SHA3_512 };
     }
 
     private MessageDigestAlgorithms() {