public interface SecretRepository
The implementation of this interface can be different from one SecretRepository to another depending on its requirements and behaviour.
Modifier and Type | Method and Description |
---|---|
byte[] |
decrypt(byte[] cipherText)
An implementation of this method should provide the relevant decryption logic.
|
byte[] |
encrypt(byte[] plainText)
An implementation of this method should provide the relevant encryption logic.
|
void |
init(SecretRepositoryConfiguration secretRepositoryConfiguration,
MasterKeyReader masterKeyReader)
This method will be called with a
SecretRepositoryConfiguration , a MasterKeyReader . |
void |
loadSecrets(SecretRepositoryConfiguration secretRepositoryConfiguration)
An implementation of this method should load the secrets from underlying secret repository.
|
void |
persistSecrets(SecretRepositoryConfiguration secretRepositoryConfiguration)
An implementation of this method should persist the secrets to the underlying secret repository.
|
char[] |
resolve(String alias)
An implementation of this method should provide the plain text secret for a given alias.
|
void init(SecretRepositoryConfiguration secretRepositoryConfiguration, MasterKeyReader masterKeyReader) throws SecureVaultException
SecretRepositoryConfiguration
, a MasterKeyReader
.
An implementation of this method should initialize the SecretRepository
, which make the
SecretRepository ready for loadSecrets
and persistSecrets
secretRepositoryConfiguration
- SecretRepositoryConfiguration
masterKeyReader
- an initialized MasterKeyReader
SecureVaultException
- on an error while trying to initialize the SecretRepositoryvoid loadSecrets(SecretRepositoryConfiguration secretRepositoryConfiguration) throws SecureVaultException
secretRepositoryConfiguration
- SecretRepositoryConfiguration
SecureVaultException
- on an error while trying to load secretsvoid persistSecrets(SecretRepositoryConfiguration secretRepositoryConfiguration) throws SecureVaultException
secretRepositoryConfiguration
- SecretRepositoryConfiguration
SecureVaultException
- on an error while trying to persis secretschar[] resolve(String alias)
alias
- alias of the secretbyte[] encrypt(byte[] plainText) throws SecureVaultException
plainText
- plain text as a byte arraySecureVaultException
- on an error while trying to encrypt.byte[] decrypt(byte[] cipherText) throws SecureVaultException
cipherText
- cipher text as a byte arraySecureVaultException
- on an error while trying to encrypt.Copyright © 2017 WSO2. All rights reserved.