Enum Class EncryptionMethod

java.lang.Object
java.lang.Enum<EncryptionMethod>
cloud.opencode.base.io.compress.EncryptionMethod
All Implemented Interfaces:
Serializable, Comparable<EncryptionMethod>, Constable

public enum EncryptionMethod extends Enum<EncryptionMethod>
ZIP entry encryption method. ZIP 条目加密方式。

Identifies the algorithm used to encrypt entries in a password-protected ZIP archive. The default NONE disables encryption regardless of any password supplied.

标识口令保护 ZIP 中条目使用的加密算法。默认值 NONE 表示不加密, 即使提供了密码也不会启用加密。

Note | 注意: Implementations of ZipUtil.compress(java.nio.file.Path, java.util.Collection, ZipOptions) accept this value but require callers to provide their own cryptographic stream implementation when AES_128 or AES_256 is requested. The base library does not bundle an AES ZIP encryption engine.

ZipUtil.compress(java.nio.file.Path, java.util.Collection, ZipOptions) 接收本枚举值, 但选择 AES_128 / AES_256 时需要调用方自带 AES ZIP 加密引擎;本类库不内置。

Since:
JDK 25, opencode-base-io V1.0.4
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

    • NONE

      public static final EncryptionMethod NONE
      No encryption. / 不加密。
    • AES_128

      public static final EncryptionMethod AES_128
      AES-128 encryption (requires external engine). / AES-128 加密(需外部引擎)。
    • AES_256

      public static final EncryptionMethod AES_256
      AES-256 encryption (requires external engine). / AES-256 加密(需外部引擎)。
  • Method Details

    • values

      public static EncryptionMethod[] 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 EncryptionMethod 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