- java.lang.Object
-
- io.github.mmm.crypto.CryptoConfig
-
- io.github.mmm.crypto.algorithm.CryptoAlgorithmConfig
-
- io.github.mmm.crypto.key.KeyConfig
-
- All Implemented Interfaces:
CryptoAlgorithm
,AbstractGetKeyLength
- Direct Known Subclasses:
SymmetricKeyConfig
public abstract class KeyConfig extends CryptoAlgorithmConfig implements AbstractGetKeyLength
Abstract base class of analgorithm configuration
for dealing withKey
s.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
- See Also:
KeyCreatorFactory
,KeyCreator
-
-
Field Summary
-
Fields inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmConfig
algorithm
-
Fields inherited from class io.github.mmm.crypto.CryptoConfig
provider
-
-
Constructor Summary
Constructors Constructor Description KeyConfig(String algorithm, SecurityProvider provider, int keyLength)
The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getKeyLength()
-
Methods inherited from class io.github.mmm.crypto.algorithm.CryptoAlgorithmConfig
getAlgorithm
-
Methods inherited from class io.github.mmm.crypto.CryptoConfig
getProvider
-
-
-
-
Constructor Detail
-
KeyConfig
public KeyConfig(String algorithm, SecurityProvider provider, int keyLength)
The constructor.- Parameters:
algorithm
- thealgorithm
.provider
- theSecurityProvider
.keyLength
- thekey length
in bits.
-
-
Method Detail
-
getKeyLength
public int getKeyLength()
- Specified by:
getKeyLength
in interfaceAbstractGetKeyLength
- Returns:
- the length of the key in bits. The bigger the key length the stronger and more secure the encryption but
also the more performance is required for computation. Reasonable values depend on the
algorithm
: A recent value for RSA is 4096 bits while for PBKDF2 256 is sufficient. However, recommended and secure values change over time as computing power is increasing. Therefore you should research the web to find an accurate value.
-
-