Package org.craftercms.commons.crypto
Interface SecretKeyRepository
-
- All Known Implementing Classes:
SecretKeyRepositoryImpl
public interface SecretKeyRepositoryRepository for storing/retrieving encryption keys.- Author:
- avasquez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SecretKeygetKey(String name, boolean create)Returns the secret key for the specified key namevoidsaveKey(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
-
-