- java.lang.Object
-
- java.lang.Enum<PosixFile.CryptAlgorithm>
-
- com.aoapps.io.posix.PosixFile.CryptAlgorithm
-
- All Implemented Interfaces:
Serializable
,Comparable<PosixFile.CryptAlgorithm>
- Enclosing class:
- PosixFile
public static enum PosixFile.CryptAlgorithm extends Enum<PosixFile.CryptAlgorithm>
The set of supported crypt algorithms.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateSalt(SecureRandom secureRandom)
Generates a random salt for this algorithm.int
getSaltLength()
Gets the number of characters in the salt, not including the prefix.String
getSaltPrefix()
static PosixFile.CryptAlgorithm
valueOf(String name)
Returns the enum constant of this type with the specified name.static PosixFile.CryptAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DES
@Deprecated public static final PosixFile.CryptAlgorithm DES
Deprecated.This is the old-school weakest form, do not use unless somehow absolutely required.DES algorithm.
-
MD5
@Deprecated public static final PosixFile.CryptAlgorithm MD5
MD5 algorithm.
-
SHA256
public static final PosixFile.CryptAlgorithm SHA256
SHA-256 algorithm requires glibc 2.7+.
-
SHA512
public static final PosixFile.CryptAlgorithm SHA512
SHA-512 algorithm requires glibc 2.7+.
-
-
Method Detail
-
values
public static PosixFile.CryptAlgorithm[] 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 (PosixFile.CryptAlgorithm c : PosixFile.CryptAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PosixFile.CryptAlgorithm valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getSaltPrefix
public String getSaltPrefix()
-
getSaltLength
public int getSaltLength()
Gets the number of characters in the salt, not including the prefix.
-
generateSalt
public String generateSalt(SecureRandom secureRandom)
Generates a random salt for this algorithm.
-
-