Package com.evolveum.midpoint.init
Class ConfigurableProtector
java.lang.Object
com.evolveum.midpoint.prism.impl.crypto.BaseProtector
com.evolveum.midpoint.prism.impl.crypto.KeyStoreBasedProtectorImpl
com.evolveum.midpoint.init.ConfigurableProtector
- All Implemented Interfaces:
KeyStoreBasedProtector
,Protector
,SecretsResolver
TODO better name (also for factory)
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.prism.crypto.Protector
XMLSEC_ENCRYPTION_ALGORITHM_AES128_CBC, XMLSEC_ENCRYPTION_ALGORITHM_AES256_CBC, XMLSEC_ENCRYPTION_NS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSecretsProvider
(@NotNull SecretsProvider<?> provider) <T> void
decrypt
(ProtectedData<T> protectedData) protected <T> byte[]
decryptBytes
(ProtectedData<T> protectedData) decryptString
(ProtectedData<String> protectedString) <T> void
encrypt
(ProtectedData<T> protectedData) @NotNull List<SecretsProvider<?>>
void
removeSecretsProvider
(@NotNull SecretsProvider<?> provider) @NotNull ByteBuffer
resolveSecretBinary
(@NotNull String provider, @NotNull String key) @NotNull String
resolveSecretString
(@NotNull String provider, @NotNull String key) Methods inherited from class com.evolveum.midpoint.prism.impl.crypto.KeyStoreBasedProtectorImpl
areEquivalent, compareCleartext, getEncryptionAlgorithm, getKeyStore, getKeyStorePath, getRequestedJceProviderName, getSecretKeyDigest, getTrustManagers, hash, init, isEncryptedByCurrentKey, setEncryptionAlgorithm, setEncryptionKeyAlias, setFixedSalt, setKeyStorePassword, setKeyStorePath, setRequestedJceProviderName
Methods inherited from class com.evolveum.midpoint.prism.impl.crypto.BaseProtector
encryptString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.prism.crypto.Protector
encryptString
-
Constructor Details
-
ConfigurableProtector
public ConfigurableProtector()
-
-
Method Details
-
addSecretsProvider
- Specified by:
addSecretsProvider
in interfaceSecretsResolver
- Parameters:
provider
- Initialized provider to be added to the list of usable providers.
-
removeSecretsProvider
- Specified by:
removeSecretsProvider
in interfaceSecretsResolver
- Parameters:
provider
- Initialized provider to be removed from the list of usable providers.
-
getSecretsProviders
- Specified by:
getSecretsProviders
in interfaceSecretsResolver
- Returns:
- List of usable secret providers.
-
resolveSecretString
@NotNull public @NotNull String resolveSecretString(@NotNull @NotNull String provider, @NotNull @NotNull String key) throws EncryptionException - Specified by:
resolveSecretString
in interfaceSecretsResolver
- Throws:
EncryptionException
-
resolveSecretBinary
@NotNull public @NotNull ByteBuffer resolveSecretBinary(@NotNull @NotNull String provider, @NotNull @NotNull String key) throws EncryptionException - Specified by:
resolveSecretBinary
in interfaceSecretsResolver
- Throws:
EncryptionException
-
decrypt
- Specified by:
decrypt
in interfaceProtector
- Overrides:
decrypt
in classBaseProtector
- Throws:
EncryptionException
SchemaException
-
decryptString
- Specified by:
decryptString
in interfaceProtector
- Overrides:
decryptString
in classBaseProtector
- Returns:
- decrypted String from protectedString object
- Throws:
EncryptionException
- this is thrown probably in case JRE/JDK doesn't have JCE installed
-
decryptBytes
protected <T> byte[] decryptBytes(ProtectedData<T> protectedData) throws SchemaException, EncryptionException - Overrides:
decryptBytes
in classKeyStoreBasedProtectorImpl
- Throws:
SchemaException
EncryptionException
-
encrypt
- Specified by:
encrypt
in interfaceProtector
- Overrides:
encrypt
in classKeyStoreBasedProtectorImpl
- Throws:
EncryptionException
-