- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
-
- io.github.mmm.crypto.random.RandomFactoryImpl
-
- All Implemented Interfaces:
AbstractCryptoFactory
,CryptoAlgorithm
,RandomConstants
,RandomFactory
public class RandomFactoryImpl extends AbstractCryptoAlgorithmWithProvider implements RandomFactory
Implementation ofRandomFactory
.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Field Summary
-
Fields inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
provider
-
Fields inherited from interface io.github.mmm.crypto.random.RandomConstants
RANDOM_ALGORITHM_SHA1_PRNG
-
-
Constructor Summary
Constructors Constructor Description RandomFactoryImpl(RandomConfig config)
The constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAlgorithm()
RandomCreator
newRandomCreator()
SecureRandom
newSecureRandom()
static RandomFactoryImpl
ofStrong()
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
getProvider
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
creationFailedException, creationFailedException, creationFailedException, creationFailedException, getAlgorithm, toString
-
-
-
-
Constructor Detail
-
RandomFactoryImpl
public RandomFactoryImpl(RandomConfig config)
The constructor.- Parameters:
config
- theRandomConfig
.
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceCryptoAlgorithm
- Returns:
- the name of the underlying algorithm (e.g. "RSA", "NONEwithECDSA", etc.).
- See Also:
Key.getAlgorithm()
,Signature.getAlgorithm()
,MessageDigest.getAlgorithm()
,SecureRandom.getAlgorithm()
,Cipher.getAlgorithm()
-
newRandomCreator
public RandomCreator newRandomCreator()
- Specified by:
newRandomCreator
in interfaceRandomFactory
- Returns:
- the new
RandomCreator
instance.
-
newSecureRandom
public SecureRandom newSecureRandom()
- Specified by:
newSecureRandom
in interfaceRandomFactory
- Returns:
- the new unwrapped
SecureRandom
.
-
ofStrong
public static RandomFactoryImpl ofStrong()
- Returns:
RandomFactoryImpl
forSecureRandom.getInstanceStrong()
.
-
-