
net.java.truecommons.key.console.ConsoleAesPbeKeyManagerMapModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truecommons-key-console Show documentation
Show all versions of truecommons-key-console Show documentation
Prompts the user for passwords via a console based dialog, if available.
The newest version!
/*
* Copyright (C) 2005-2015 Schlichtherle IT Services.
* All rights reserved. Use is subject to license terms.
*/
package net.java.truecommons.key.console;
import java.util.Map;
import javax.annotation.concurrent.Immutable;
import net.java.truecommons.annotations.ServiceImplementation;
import net.java.truecommons.key.spec.KeyManager;
import net.java.truecommons.key.spec.common.AesPbeParameters;
import net.java.truecommons.key.spec.prompting.PromptingKeyManager;
import net.java.truecommons.key.spec.spi.KeyManagerMapModifier;
/**
* A service provider for a console prompting key manager for
* {@link AesPbeParameters}.
*
* @since TrueCommons 2.2
* @author Christian Schlichtherle
*/
@Immutable
@ServiceImplementation
public final class ConsoleAesPbeKeyManagerMapModifier
extends KeyManagerMapModifier {
@Override
public Map, KeyManager>> apply(final Map, KeyManager>> map) {
if (null != System.console())
map.put(AesPbeParameters.class,
new PromptingKeyManager<>(new ConsoleAesPbeParametersView()));
return map;
}
/** @return -300 */
@Override
public int getPriority() { return -300; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy