Enum Class Algorithm

java.lang.Object
java.lang.Enum<Algorithm>
net.messagevortex.asn1.encryption.Algorithm
All Implemented Interfaces:
Serializable, Comparable<Algorithm>, Constable

public enum Algorithm extends Enum<Algorithm> implements Serializable
Represents all supported crypto algorithms.
  • Enum Constant Details

    • AES128

      public static final Algorithm AES128
    • AES192

      public static final Algorithm AES192
    • AES256

      public static final Algorithm AES256
    • CAMELLIA128

      public static final Algorithm CAMELLIA128
    • CAMELLIA192

      public static final Algorithm CAMELLIA192
    • CAMELLIA256

      public static final Algorithm CAMELLIA256
    • EC

      public static final Algorithm EC
    • RIPEMD160

      public static final Algorithm RIPEMD160
    • RSA

      public static final Algorithm RSA
    • SHA256

      public static final Algorithm SHA256
    • SHA384

      public static final Algorithm SHA384
    • SHA512

      public static final Algorithm SHA512
    • TWOFISH128

      public static final Algorithm TWOFISH128
    • TWOFISH192

      public static final Algorithm TWOFISH192
    • TWOFISH256

      public static final Algorithm TWOFISH256
  • Field Details

  • Method Details

    • values

      public static Algorithm[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Algorithm valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getAlgorithms

      public static Algorithm[] getAlgorithms(AlgorithmType at)

      Return a list of algorithms of the specified type.

      Parameters:
      at - the algorithm type to generate a list for
      Returns:
      the list of algorithms
    • getById

      public static Algorithm getById(int id)

      Look up an algorithm by id.

      Parameters:
      id - the idto be looked up
      Returns:
      the algorithm or null if not known
    • getByString

      public static Algorithm getByString(String s)

      Look up an algorithm by its identification string.

      The string search is case insensitive.

      Parameters:
      s - the identification string to be looked up
      Returns:
      the algorithm or null if not found
    • getDefault

      public static Algorithm getDefault(AlgorithmType at)

      Look up the default algorithm to be used on the system.

      Parameters:
      at - the type of algorithm to be looked for
      Returns:
      the default type
    • getId

      public int getId()

      Look up the current id.

      Returns:
      the current id
    • getAlgorithmFamily

      public String getAlgorithmFamily()

      The algorithm family.

      This is either the identification string without the key size or identical to the identification string

      Returns:
      the identification string without key size (if any)
    • toString

      public String toString()

      Get the identification string.

      Overrides:
      toString in class Enum<Algorithm>
      Returns:
      the identification string
    • getAlgorithmType

      public AlgorithmType getAlgorithmType()

      Get the type of algorithm.

      Returns:
      the type of algorithm
    • getProvider

      public String getProvider()

      Get the provider string for this algorithm.

      Returns:
      the provider string for this algorithm
    • getKeySize

      public int getKeySize()

      Get the default key size for this algorithm.

      Returns:
      the default key size in bits
    • getKeySize

      public int getKeySize(SecurityLevel sl)

      Get the key size for this algorithm and security level.

      Parameters:
      sl - the security level
      Returns:
      the key size in bits for the security level specified
    • getBlockSize

      public int getBlockSize()

      Get the default key size for this algorithm.

      Returns:
      the default key size in bits
    • getBlockSize

      public int getBlockSize(SecurityLevel sl)

      Get the block size for this algorithm and security level.

      Parameters:
      sl - the security level
      Returns:
      the key size in bits for the security level specified or -1 if not set
    • getParameters

      public AlgorithmParameter getParameters(SecurityLevel sl)

      Get default parameters for the security level specified.

      Parameters:
      sl - the security level
      Returns:
      the default set of parameters for the security level specified
    • getParameters

      public Map<SecurityLevel,AlgorithmParameter> getParameters()

      Get a map of security levels and default parameters for this algorithm.

      Returns:
      The map containing the default parameters