Module io.github.mmm.crypto
Interface SymmetricKeyCreator<K extends SecretKey>
-
- Type Parameters:
K- type ofSecretKey.
- All Superinterfaces:
CryptoAlgorithm,KeyCreator
- All Known Implementing Classes:
SymmetricKeyCreatorImpl
public interface SymmetricKeyCreator<K extends SecretKey> extends KeyCreator
ExtendsKeyCreatorfor dealing with symmetric cryptographic keys.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
- See Also:
createKey(String)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default BinaryasBinary(K key)byte[]asData(K key)KcreateKey(byte[] key)KcreateKey(String password)intgetKeyLength(K key)default voidverifyKey(K key)Verify that the given key matches the criteria of this key creator such askey length.-
Methods inherited from interface io.github.mmm.crypto.algorithm.CryptoAlgorithm
getAlgorithm
-
Methods inherited from interface io.github.mmm.crypto.key.KeyCreator
getKeyLength
-
-
-
-
Method Detail
-
createKey
K createKey(String password)
- Parameters:
password- the secret password.- Returns:
- the according
SecretKey.
-
createKey
K createKey(byte[] key)
- Parameters:
key- theSecretKeyasencoded data.- Returns:
- the deserialized
SecretKey.
-
verifyKey
default void verifyKey(K key)
Verify that the given key matches the criteria of this key creator such askey length.- Parameters:
key- theSecretKeyto verify.
-
getKeyLength
int getKeyLength(K key)
- Parameters:
key- theSecretKey.- Returns:
- the
key lengthof the given key.
-
-