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
ExtendsKeyCreator
for 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 Binary
asBinary(K key)
byte[]
asData(K key)
K
createKey(byte[] key)
K
createKey(String password)
int
getKeyLength(K key)
default void
verifyKey(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
- theSecretKey
asencoded 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
- theSecretKey
to verify.
-
getKeyLength
int getKeyLength(K key)
- Parameters:
key
- theSecretKey
.- Returns:
- the
key length
of the given key.
-
-