- 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 StringgetAlgorithm()RandomCreatornewRandomCreator()SecureRandomnewSecureRandom()static RandomFactoryImplofStrong()-
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:
getAlgorithmin 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:
newRandomCreatorin interfaceRandomFactory- Returns:
- the new
RandomCreatorinstance.
-
newSecureRandom
public SecureRandom newSecureRandom()
- Specified by:
newSecureRandomin interfaceRandomFactory- Returns:
- the new unwrapped
SecureRandom.
-
ofStrong
public static RandomFactoryImpl ofStrong()
- Returns:
RandomFactoryImplforSecureRandom.getInstanceStrong().
-
-