Interface SecDispatcher
- All Known Implementing Classes:
DefaultSecDispatcher
public interface SecDispatcher
This component decrypts a string, passed to it using various dispatchers.
- Author:
- Oleg Gusakov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classThe validation response. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of available dispatcher metadata, nevernull.Decrypt given encrypted string.Encrypt given plaintext string.default booleanReturnstrueif passed in string adheres to "encrypted string" format (current or legacy).booleanisEncryptedString(String str) Returnstrueif passed in string adheres "encrypted string" format.booleanReturnstrueif passed in string adheres to "legacy encrypted string" format.readConfiguration(boolean createIfMissing) Reads the effective configuration, eventually creating new instance if not present.Performs a "deep validation" and reports the status.voidwriteConfiguration(SettingsSecurity configuration) Writes the effective configuration.
-
Field Details
-
DISPATCHER_NAME_ATTR
Attribute that selects a dispatcher. If not present inencrypt(String, Map)attributes, the configured "default dispatcher" is used.- See Also:
-
DISPATCHER_VERSION_ATTR
Attribute for version, added by SecDispatcher for possible upgrade path.- See Also:
-
-
Method Details
-
availableDispatchers
Set<DispatcherMeta> availableDispatchers()Returns the set of available dispatcher metadata, nevernull. -
encrypt
Encrypt given plaintext string.- Parameters:
str- the plaintext to encryptattr- the attributes, may benull- Returns:
- encrypted string
- Throws:
SecDispatcherException- in case of problemIOException
-
decrypt
Decrypt given encrypted string.- Parameters:
str- the encrypted string- Returns:
- decrypted string
- Throws:
SecDispatcherException- in case of problemIOException
-
isAnyEncryptedString
Returnstrueif passed in string adheres to "encrypted string" format (current or legacy).- Since:
- 4.0.1
-
isEncryptedString
Returnstrueif passed in string adheres "encrypted string" format. -
isLegacyEncryptedString
Returnstrueif passed in string adheres to "legacy encrypted string" format. -
readConfiguration
Reads the effective configuration, eventually creating new instance if not present.- Parameters:
createIfMissing- Iftrue, it will create a new empty instance- Returns:
- the configuration, of
nullif it does not exist increateIfMissingisfalse - Throws:
IOException- In case of IO problem
-
writeConfiguration
Writes the effective configuration.- Parameters:
configuration- The configuration to write, may not benull- Throws:
IOException- In case of IO problem
-
validateConfiguration
SecDispatcher.ValidationResponse validateConfiguration()Performs a "deep validation" and reports the status. If return instanceSecDispatcher.ValidationResponse.isValid()istrue, configuration is usable.
-