- java.lang.Object
-
- java.lang.Enum<RngAlgorithm>
-
- io.github.astrapi69.crypto.algorithm.RngAlgorithm
-
- All Implemented Interfaces:
Algorithm
,java.io.Serializable
,java.lang.Comparable<RngAlgorithm>
public enum RngAlgorithm extends java.lang.Enum<RngAlgorithm> implements Algorithm
The enumRngAlgorithm
provides algorithms for generation of random number generator (RNG) that are used with theSecureRandom
object.
Note: See what algorithm can be used with your operating system.
For more info see: https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SecureRandomImp
-
-
Enum Constant Summary
Enum Constants Enum Constant Description NativePRNG
The Native PRNG.NativePRNGBlocking
The Native PRNG blocking.NativePRNGNonBlocking
The Native PRNG non blocking.PKCS11
The pkcs11.SHA1PRNG
The sha1prng.Windows_PRNG
The Windows PRNG.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAlgorithm()
Gets the algorithm for encryption or decryption.static RngAlgorithm
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static RngAlgorithm[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NativePRNG
public static final RngAlgorithm NativePRNG
The Native PRNG.
-
NativePRNGBlocking
public static final RngAlgorithm NativePRNGBlocking
The Native PRNG blocking.
-
NativePRNGNonBlocking
public static final RngAlgorithm NativePRNGNonBlocking
The Native PRNG non blocking.
-
PKCS11
public static final RngAlgorithm PKCS11
The pkcs11.
-
SHA1PRNG
public static final RngAlgorithm SHA1PRNG
The sha1prng.
-
Windows_PRNG
public static final RngAlgorithm Windows_PRNG
The Windows PRNG.
-
-
Method Detail
-
values
public static RngAlgorithm[] 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 (RngAlgorithm c : RngAlgorithm.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RngAlgorithm 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
-
getAlgorithm
public java.lang.String getAlgorithm()
Description copied from interface:Algorithm
Gets the algorithm for encryption or decryption.- Specified by:
getAlgorithm
in interfaceAlgorithm
- Returns:
- the algorithm
-
-