Enum Class Padding

java.lang.Object
java.lang.Enum<Padding>
cloud.opencode.base.crypto.symmetric.Padding
All Implemented Interfaces:
Serializable, Comparable<Padding>, Constable

public enum Padding extends Enum<Padding>
Padding scheme enumeration for block cipher algorithms. 分组密码算法的填充方案枚举。

Features | 主要功能:

  • PKCS5, PKCS7, NoPadding definitions - PKCS5、PKCS7、NoPadding 定义

Usage Examples | 使用示例:

Padding padding = Padding.PKCS5;
String name = padding.paddingName();

Security | 安全性:

  • Thread-safe: Yes - 线程安全: 是
  • Null-safe: Partial - 空值安全: 部分
Since:
JDK 25, opencode-base-crypto V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • NO_PADDING

      public static final Padding NO_PADDING
      No padding - Plaintext must be multiple of block size. 无填充 - 明文必须是块大小的倍数。
    • PKCS5

      public static final Padding PKCS5
      PKCS5 padding scheme. PKCS5 填充方案。
    • PKCS7

      public static final Padding PKCS7
      PKCS7 padding scheme - Recommended. PKCS7 填充方案 - 推荐使用。 Note: JCE uses "PKCS5Padding" which is functionally equivalent to PKCS7 for AES. 注意:JCE 使用 "PKCS5Padding",对于 AES 来说与 PKCS7 功能等效。
    • ISO10126

      public static final Padding ISO10126
      ISO 10126 padding scheme. ISO 10126 填充方案。
  • Method Details

    • values

      public static 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 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
    • getValue

      public String getValue()
      Get the JCE padding scheme name. 获取 JCE 填充方案名称。
      Returns:
      JCE padding scheme name / JCE 填充方案名称