Enum Class CipherStrategy

java.lang.Object
java.lang.Enum<CipherStrategy>
com.saperion.common.crypto.CipherStrategy
All Implemented Interfaces:
Serializable, Comparable<CipherStrategy>, Constable

public enum CipherStrategy extends Enum<CipherStrategy>

CipherStrategy enumerates the few strategies for a Cipher used by SAPERION.

It defines the encryption algorithm, block mode, padding type and key size to use.

If a new strategy is really needed, a new entry must be made and a new corresponding Cipher-implementation must be provided.

Author:
agz
See Also:
  • Enum Constant Details

    • AES_128

      public static final CipherStrategy AES_128
      Algorithm = "AES"
      Mode = "CBC"
      Padding = "PKCS5Padding"
      KeySize = 128
    • RSA_2048

      public static final CipherStrategy RSA_2048
      Algorithm = "RSA"
      Mode = "ECB"
      Padding = "PKCS1Padding"
      KeySize = 2048
  • Method Details

    • values

      public static CipherStrategy[] 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 CipherStrategy 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
    • getAlgorithm

      public String getAlgorithm()
      Returns the name of the encryption algorithm of this CipherStrategy.
      Returns:
      the encryption algorithm
    • getMode

      public String getMode()
      Returns the name of the mode of this CipherStrategy.
      Returns:
      the mode
    • getPadding

      public String getPadding()
      Returns the name of the padding of this CipherStrategy.
      Returns:
      the padding
    • getKeySize

      public int getKeySize()
      Returns the key size (number of bits) of this CipherStrategy.
      Returns:
      the key size