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.EncryptPayloadNested classes/interfaces inherited from interface org.codehaus.plexus.components.secdispatcher.DispatcherMeta
DispatcherMeta.Field -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMasterDispatcher(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 StringgetMasterCipher(Map<String, String> source, boolean config) protected StringgetMasterPassword(Map<String, String> config) name()The name of the dispatcher.protected CipherrequireCipher(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, waitMethods 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:DispatcherMetaThe name of the dispatcher.- Specified by:
namein interfaceDispatcherMeta
-
displayName
Description copied from interface:DispatcherMetaReturns the display (human) name of the dispatcher.- Specified by:
displayNamein interfaceDispatcherMeta
-
fields
Description copied from interface:DispatcherMetaReturns the configuration fields of the dispatcher.- Specified by:
fieldsin interfaceDispatcherMeta
-
encrypt
public Dispatcher.EncryptPayload encrypt(String str, Map<String, String> attributes, Map<String, throws SecDispatcherExceptionString> config) Description copied from interface:DispatcherEncrypt given plaintext string. Implementation must return at least same attributes it got, but may add more attributes to returned payload.- Specified by:
encryptin interfaceDispatcher- Parameters:
str- string to encrypt, nevernullattributes- attributes, nevernullconfig- 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:DispatcherDecrypt given encrypted string.- Specified by:
decryptin interfaceDispatcher- Parameters:
str- string to decrypt, nevernullattributes- attributes, nevernullconfig- configuration from settings-security.xml, nevernull- Returns:
- decrypted string
- Throws:
SecDispatcherException
-
validateConfiguration
Description copied from interface:DispatcherValidates dispatcher configuration.- Specified by:
validateConfigurationin interfaceDispatcher
-
getMasterPassword
- Throws:
SecDispatcherException
-
getMasterCipher
protected String getMasterCipher(Map<String, String> source, boolean config) throws SecDispatcherException- Throws:
SecDispatcherException
-
requireCipher
-