java.lang.Object
dev.orne.config.impl.AbstractConfigCryptoProvider
dev.orne.config.impl.DefaultConfigCryptoProvider
- All Implemented Interfaces:
ConfigCryptoProvider
@API(status=STABLE,
since="1.0")
public class DefaultConfigCryptoProvider
extends AbstractConfigCryptoProvider
Default implementation of
ConfigCryptoProvider based on
ConfigCryptoEngine with synchronized Cipher.- Since:
- 0.2
- Version:
- 1.0, 2020-08
- Author:
- (w) Iker Hernaez
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultConfigCryptoProvider(@NotNull CryptoProviderOptions options) Creates a new instance with specified builder configuration options. -
Method Summary
Methods inherited from class dev.orne.config.impl.AbstractConfigCryptoProvider
checkDestroyed, decrypt, encrypt, getEngine, getSecretKey, isDestroyed, isDestroyEngine
-
Constructor Details
-
DefaultConfigCryptoProvider
@API(status=INTERNAL, since="1.0") public DefaultConfigCryptoProvider(@NotNull @NotNull CryptoProviderOptions options) Creates a new instance with specified builder configuration options.- Parameters:
options- The configured builder options.
-
-
Method Details
-
getCipher
Returns the sharedCipherto use during encryption and decryption.- Returns:
- The
Cipherto use during encryption and decryption - Throws:
ConfigCryptoProviderException- If an error occurs creating the sharedCipher
-
encrypt
Encrypts the specified plain configuration value.- Parameters:
value- The plain configuration value- Returns:
- The encrypted configuration value
- Throws:
ConfigCryptoProviderException- If an exception occurs during the encryption process
-
decrypt
Decrypts the specified encrypted configuration value.- Parameters:
value- The encrypted configuration value- Returns:
- The plain configuration value
- Throws:
ConfigCryptoProviderException- If an exception occurs during the decryption process
-
destroy
public void destroy()Description copied from class:AbstractConfigCryptoProviderDestroys all secret information. Any further call to the instance will throw anIllegalStateException.- Specified by:
destroyin interfaceConfigCryptoProvider- Overrides:
destroyin classAbstractConfigCryptoProvider
-