Package net.lingala.zip4j.model.enums
Enum AesKeyStrength
- java.lang.Object
-
- java.lang.Enum<AesKeyStrength>
-
- net.lingala.zip4j.model.enums.AesKeyStrength
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AesKeyStrength>
public enum AesKeyStrength extends java.lang.Enum<AesKeyStrength>
Indicates the AES encryption key length
-
-
Enum Constant Summary
Enum Constants Enum Constant Description KEY_STRENGTH_128128-bit AES key lengthKEY_STRENGTH_192192-bit AES key lengthKEY_STRENGTH_256256-bit AES key length
-
Field Summary
Fields Modifier and Type Field Description private intkeyLengthprivate intmacLengthprivate intrawCodeprivate intsaltLength
-
Constructor Summary
Constructors Modifier Constructor Description privateAesKeyStrength(int rawCode, int saltLength, int macLength, int keyLength)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AesKeyStrengthgetAesKeyStrengthFromRawCode(int code)Get a AesKeyStrength given a code from the ZIP fileintgetKeyLength()Get the key length in bytes that this AesKeyStrength representsintgetMacLength()intgetRawCode()Get the code written to the ZIP fileintgetSaltLength()static AesKeyStrengthvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AesKeyStrength[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
KEY_STRENGTH_128
public static final AesKeyStrength KEY_STRENGTH_128
128-bit AES key length
-
KEY_STRENGTH_192
public static final AesKeyStrength KEY_STRENGTH_192
192-bit AES key length
-
KEY_STRENGTH_256
public static final AesKeyStrength KEY_STRENGTH_256
256-bit AES key length
-
-
Method Detail
-
values
public static AesKeyStrength[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AesKeyStrength c : AesKeyStrength.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AesKeyStrength valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
getRawCode
public int getRawCode()
Get the code written to the ZIP file- Returns:
- the code written the ZIP file
-
getSaltLength
public int getSaltLength()
-
getMacLength
public int getMacLength()
-
getKeyLength
public int getKeyLength()
Get the key length in bytes that this AesKeyStrength represents- Returns:
- the key length in bytes
-
getAesKeyStrengthFromRawCode
public static AesKeyStrength getAesKeyStrengthFromRawCode(int code)
Get a AesKeyStrength given a code from the ZIP file- Parameters:
code- the code from the ZIP file- Returns:
- the AesKeyStrength that represents the given code, or null if the code does not match
-
-