com.cedarsoft.crypt
Enum Algorithm

java.lang.Object
  extended by java.lang.Enum<Algorithm>
      extended by com.cedarsoft.crypt.Algorithm
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Algorithm>

public enum Algorithm
extends java.lang.Enum<Algorithm>

Represents an algorithm

Author:
Johannes Schneider (js@cedarsoft.com)

Enum Constant Summary
MD5
           
SHA1
           
SHA256
           
SHA512
           
 
Method Summary
static Algorithm getAlgorithm(java.lang.String algorithmString)
          getAlgorithm
 java.util.List<? extends java.lang.String> getAlternativeNames()
          Returns a list containing all alternative names for the given algorithm
 java.security.MessageDigest getMessageDigest()
          Returns the Message Digest algorithm
static Algorithm valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Algorithm[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

MD5

public static final Algorithm MD5

SHA1

public static final Algorithm SHA1

SHA256

public static final Algorithm SHA256

SHA512

public static final Algorithm SHA512
Method Detail

values

public static Algorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Algorithm c : Algorithm.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Algorithm valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getAlgorithm

@NotNull
public static Algorithm getAlgorithm(@NotNull@NonNls
                                             java.lang.String algorithmString)

getAlgorithm

Parameters:
algorithmString - a String object.
Returns:
a Algorithm object.

getAlternativeNames

@NotNull
@NonNls
public java.util.List<? extends java.lang.String> getAlternativeNames()
Returns a list containing all alternative names for the given algorithm

Returns:
the alternative names for the algorithm

getMessageDigest

@NotNull
public java.security.MessageDigest getMessageDigest()
Returns the Message Digest algorithm

Returns:
the message digest


Copyright © 2010 cedarsoft GmbH. All Rights Reserved.