Class MasterDispatcher
java.lang.Object
org.codehaus.plexus.components.secdispatcher.internal.dispatchers.MasterDispatcher
- All Implemented Interfaces:
Dispatcher
,DispatcherMeta
@Singleton
@Named("master")
public class MasterDispatcher
extends Object
implements Dispatcher, DispatcherMeta
This dispatcher is logically equivalent (but much more secure) that Maven3 "master password" encryption.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.codehaus.plexus.components.secdispatcher.Dispatcher
Dispatcher.EncryptPayload
Nested classes/interfaces inherited from interface org.codehaus.plexus.components.secdispatcher.DispatcherMeta
DispatcherMeta.Field
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMasterDispatcher
(Map<String, Cipher> masterCiphers, Map<String, MasterSource> masterSources) -
Method Summary
Modifier and TypeMethodDescriptionDecrypt given encrypted string.Returns the display (human) name of the dispatcher.Encrypt given plaintext string.fields()
Returns the configuration fields of the dispatcher.protected String
getMasterCipher
(Map<String, String> source, boolean config) protected String
getMasterPassword
(Map<String, String> config) name()
The name of the dispatcher.protected Cipher
requireCipher
(String name) validateConfiguration
(Map<String, String> config) Validates dispatcher configuration.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.plexus.components.secdispatcher.DispatcherMeta
isHidden
-
Field Details
-
NAME
- See Also:
-
masterCiphers
-
masterSources
-
-
Constructor Details
-
MasterDispatcher
-
-
Method Details
-
name
Description copied from interface:DispatcherMeta
The name of the dispatcher.- Specified by:
name
in interfaceDispatcherMeta
-
displayName
Description copied from interface:DispatcherMeta
Returns the display (human) name of the dispatcher.- Specified by:
displayName
in interfaceDispatcherMeta
-
fields
Description copied from interface:DispatcherMeta
Returns the configuration fields of the dispatcher.- Specified by:
fields
in interfaceDispatcherMeta
-
encrypt
public Dispatcher.EncryptPayload encrypt(String str, Map<String, String> attributes, Map<String, throws SecDispatcherExceptionString> config) Description copied from interface:Dispatcher
Encrypt given plaintext string. Implementation must return at least same attributes it got, but may add more attributes to returned payload.- Specified by:
encrypt
in interfaceDispatcher
- Parameters:
str
- string to encrypt, nevernull
attributes
- attributes, nevernull
config
- configuration from settings-security.xml, nevernull
- Returns:
- encrypted string and attributes in
Dispatcher.EncryptPayload
- Throws:
SecDispatcherException
-
decrypt
public String decrypt(String str, Map<String, String> attributes, Map<String, throws SecDispatcherExceptionString> config) Description copied from interface:Dispatcher
Decrypt given encrypted string.- Specified by:
decrypt
in interfaceDispatcher
- Parameters:
str
- string to decrypt, nevernull
attributes
- attributes, nevernull
config
- configuration from settings-security.xml, nevernull
- Returns:
- decrypted string
- Throws:
SecDispatcherException
-
validateConfiguration
Description copied from interface:Dispatcher
Validates dispatcher configuration.- Specified by:
validateConfiguration
in interfaceDispatcher
-
getMasterPassword
- Throws:
SecDispatcherException
-
getMasterCipher
protected String getMasterCipher(Map<String, String> source, boolean config) throws SecDispatcherException- Throws:
SecDispatcherException
-
requireCipher
-