- All Implemented Interfaces:
Serializable
,Comparable<PosixFile.CryptAlgorithm>
- Enclosing class:
PosixFile
The set of supported crypt algorithms.
-
Enum Constant Summary
Enum ConstantDescriptionDeprecated.This is the old-school weakest form, do not use unless somehow absolutely required.SHA-256 algorithm requires glibc 2.7+.SHA-512 algorithm requires glibc 2.7+. -
Method Summary
Modifier and TypeMethodDescriptiongenerateSalt
(SecureRandom secureRandom) Generates a random salt for this algorithm.int
Gets the number of characters in the salt, not including the prefix.static PosixFile.CryptAlgorithm
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 Details
-
DES
Deprecated.This is the old-school weakest form, do not use unless somehow absolutely required.DES algorithm. -
MD5
MD5 algorithm. -
SHA256
SHA-256 algorithm requires glibc 2.7+. -
SHA512
SHA-512 algorithm requires glibc 2.7+.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getSaltLength
public int getSaltLength()Gets the number of characters in the salt, not including the prefix. -
generateSalt
Generates a random salt for this algorithm.
-