View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.commons.codec.digest;
19  
20  import java.security.MessageDigest;
21  
22  /**
23   * Standard {@link MessageDigest} algorithm names from the <cite>Java Cryptography Architecture Standard Algorithm Name
24   * Documentation</cite>.
25   * <p>
26   * This class is immutable and thread-safe.
27   * </p>
28   * TODO This should be an enum.
29   *
30   * @see <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html">Java Cryptography
31   *      Architecture Standard Algorithm Name Documentation</a>
32   * @since 1.7
33   * @version $Id: MessageDigestAlgorithms.java 1585867 2014-04-09 00:12:36Z ggregory $
34   */
35  public class MessageDigestAlgorithms {
36  
37      private MessageDigestAlgorithms() {
38          // cannot be instantiated.
39      }
40  
41      /**
42       * The MD2 message digest algorithm defined in RFC 1319.
43       */
44      public static final String MD2 = "MD2";
45  
46      /**
47       * The MD5 message digest algorithm defined in RFC 1321.
48       */
49      public static final String MD5 = "MD5";
50  
51      /**
52       * The SHA-1 hash algorithm defined in the FIPS PUB 180-2.
53       */
54      public static final String SHA_1 = "SHA-1";
55  
56      /**
57       * The SHA-256 hash algorithm defined in the FIPS PUB 180-2.
58       */
59      public static final String SHA_256 = "SHA-256";
60  
61      /**
62       * The SHA-384 hash algorithm defined in the FIPS PUB 180-2.
63       */
64      public static final String SHA_384 = "SHA-384";
65  
66      /**
67       * The SHA-512 hash algorithm defined in the FIPS PUB 180-2.
68       */
69      public static final String SHA_512 = "SHA-512";
70  
71  }