Enum Class AesSpec.Padding

java.lang.Object
java.lang.Enum<AesSpec.Padding>
zeroecho.core.alg.aes.AesSpec.Padding
All Implemented Interfaces:
Serializable, Comparable<AesSpec.Padding>, Constable
Enclosing class:
AesSpec

public static enum AesSpec.Padding extends Enum<AesSpec.Padding>
Padding schemes for CBC mode.

GCM and CTR always use NOPADDING.

Since:
1.0
  • Enum Constant Details

    • NOPADDING

      public static final AesSpec.Padding NOPADDING
      No padding.

      Use only when the plaintext length is an exact multiple of the AES block size (16 bytes). Applicable to CBC; mandatory for GCM/CTR.

    • PKCS5PADDING

      public static final AesSpec.Padding PKCS5PADDING
      PKCS#5 padding (recommended for CBC) available in the Standard JDK21+.
  • Method Details

    • values

      public static AesSpec.Padding[] 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 AesSpec.Padding 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