Package de.xima.fc.cryptography
Class SecureRandomFactory
- java.lang.Object
-
- de.xima.fc.cryptography.SecureRandomFactory
-
public final class SecureRandomFactory extends Object
Factory for creating instances ofSecureRandom. This class attempts to use a preferred algorithm to maximize security and performance.The factory prioritizes a list of preferred algorithms and falls back to the default algorithm if none of the preferred ones are available. The preferred algorithm is determined during class initialization.
- Since:
- 09.04.25
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static SecureRandomgetInstance()Returns an instance ofSecureRandom.
-
-
-
Method Detail
-
getInstance
public static SecureRandom getInstance()
Returns an instance ofSecureRandom. If a preferred algorithm is available, it will be used; otherwise, the default algorithm will be returned.- Returns:
- A
SecureRandominstance. - Throws:
IllegalStateException- If the preferred algorithm is unexpectedly unavailable.
-
-