- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithProvider
-
- io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithRandom
-
- io.github.mmm.crypto.crypt.CryptorFactoryImpl
-
- All Implemented Interfaces:
AbstractCryptoFactory,CryptoAlgorithm,CryptorFactory
- Direct Known Subclasses:
AsymmetricCryptorFactoryImpl,SymmetricCryptorFactoryImpl
public abstract class CryptorFactoryImpl extends AbstractCryptoAlgorithmWithRandom implements CryptorFactory
The implementation ofCryptorFactorybased onCipher.- 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
-
-
Constructor Summary
Constructors Constructor Description CryptorFactoryImpl(SecurityProvider provider, RandomFactory randomFactory)The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetAlgorithm()abstract CryptorConfiggetConfig()DecryptornewDecryptorUnsafe(Key decryptionKey)Please use typesafenewEncryptormethod instead to avoid mistakes (passing wrongKey).EncryptornewEncryptorUnsafe(Key encryptionKey)Please use typesafenewDecryptormethod instead to avoid mistakes (passing wrongKey).-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractCryptoAlgorithmWithRandom
createSecureRandom, getRandomFactory
-
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
-
CryptorFactoryImpl
public CryptorFactoryImpl(SecurityProvider provider, RandomFactory randomFactory)
The constructor.- Parameters:
provider- the securitySecurityProvider.randomFactory- theRandomFactory.
-
-
Method Detail
-
getConfig
public abstract CryptorConfig getConfig()
- Returns:
- the
CryptorConfig.
-
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()
-
newEncryptorUnsafe
public Encryptor newEncryptorUnsafe(Key encryptionKey)
Description copied from interface:CryptorFactoryPlease use typesafenewDecryptormethod instead to avoid mistakes (passing wrongKey).- Specified by:
newEncryptorUnsafein interfaceCryptorFactory- Parameters:
encryptionKey- theKeyto use for encryption.- Returns:
- the
Encryptorfor encryption.
-
newDecryptorUnsafe
public Decryptor newDecryptorUnsafe(Key decryptionKey)
Description copied from interface:CryptorFactoryPlease use typesafenewEncryptormethod instead to avoid mistakes (passing wrongKey).- Specified by:
newDecryptorUnsafein interfaceCryptorFactory- Parameters:
decryptionKey- theKeyto use for decryption.- Returns:
- the
Decryptorfor decryption.
-
-