Package org.craftercms.commons.crypto
Interface SecretKeyRepository
-
- All Known Implementing Classes:
SecretKeyRepositoryImpl
public interface SecretKeyRepository
Repository for storing/retrieving encryption keys.- Author:
- avasquez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SecretKey
getKey(String name, boolean create)
Returns the secret key for the specified key namevoid
saveKey(String name, SecretKey key)
Saves the secret key in the repository, with the specified name
-
-
-
Method Detail
-
getKey
SecretKey getKey(String name, boolean create) throws CryptoException
Returns the secret key for the specified key name- Parameters:
name
- the key's name in the repositorycreate
- true to create new key if there's no key with the specified name in the repository.- Returns:
- the key
- Throws:
CryptoException
-
saveKey
void saveKey(String name, SecretKey key) throws CryptoException
Saves the secret key in the repository, with the specified name- Parameters:
name
- the key's name in the repositorykey
- the key to save- Throws:
CryptoException
-
-