Source code

    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 * Unless required by applicable law or agreed to in writing, software
    012 * distributed under the License is distributed on an "AS IS" BASIS,
    013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 * See the License for the specific language governing permissions and
    015 * limitations under the License.
    016 */
    017
    018package org.apache.commons.codec.digest;
    019
    020import java.security.MessageDigest;
    021
    022/**
    023 * Standard {@link MessageDigest} algorithm names from the <cite>Java Cryptography Architecture Standard Algorithm Name
    024 * Documentation</cite>.
    025 * <p>
    026 * This class is immutable and thread-safe.
    027 * </p>
    028 * TODO This should be an enum.
    029 *
    030 * @see <a href="http://docs.oracle.com/javase/6/docs/technotes/guides/security/StandardNames.html">Java Cryptography
    031 *      Architecture Standard Algorithm Name Documentation</a>
    032 * @since 1.7
    033 * @version $Id: MessageDigestAlgorithms.java 1585867 2014-04-09 00:12:36Z ggregory $
    034 */
    035public class MessageDigestAlgorithms {
    036
    037    private MessageDigestAlgorithms() {
    038        // cannot be instantiated.
    039    }
    040
    041    /**
    042     * The MD2 message digest algorithm defined in RFC 1319.
    043     */
    044    public static final String MD2 = "MD2";
    045
    046    /**
    047     * The MD5 message digest algorithm defined in RFC 1321.
    048     */
    049    public static final String MD5 = "MD5";
    050
    051    /**
    052     * The SHA-1 hash algorithm defined in the FIPS PUB 180-2.
    053     */
    054    public static final String SHA_1 = "SHA-1";
    055
    056    /**
    057     * The SHA-256 hash algorithm defined in the FIPS PUB 180-2.
    058     */
    059    public static final String SHA_256 = "SHA-256";
    060
    061    /**
    062     * The SHA-384 hash algorithm defined in the FIPS PUB 180-2.
    063     */
    064    public static final String SHA_384 = "SHA-384";
    065
    066    /**
    067     * The SHA-512 hash algorithm defined in the FIPS PUB 180-2.
    068     */
    069    public static final String SHA_512 = "SHA-512";
    070
    071}