public class DefaultSecretRepository extends AbstractSecretRepository
SecretRepository
. This is the default
implementation for secret repository in Secure Vault. The secrets are taken form the secrets.properties file and
encryption/decryption is based on the Java KeyStore.
This component registers a SecretRepository as an OSGi service.
Constructor and Description |
---|
DefaultSecretRepository() |
Modifier and Type | Method and Description |
---|---|
void |
activate() |
void |
deactivate() |
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 . |
loadSecrets, persistSecrets, resolve
public void activate()
public void deactivate()
public void init(SecretRepositoryConfiguration secretRepositoryConfiguration, MasterKeyReader masterKeyReader) throws SecureVaultException
SecretRepository
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 SecretRepositorypublic byte[] encrypt(byte[] plainText) throws SecureVaultException
SecretRepository
plainText
- plain text as a byte arraySecureVaultException
- on an error while trying to encrypt.public byte[] decrypt(byte[] cipherText) throws SecureVaultException
SecretRepository
cipherText
- cipher text as a byte arraySecureVaultException
- on an error while trying to encrypt.Copyright © 2017 WSO2. All rights reserved.