
net.java.truecommons.key.swing.SwingAesPbeKeyManagerMapModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of truecommons-key-swing Show documentation
Show all versions of truecommons-key-swing Show documentation
Prompts the user for passwords via a Swing 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.swing;
import java.awt.GraphicsEnvironment;
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 Swing prompting key manager for
* {@link AesPbeParameters}.
*
* @since TrueCommons 2.2
* @author Christian Schlichtherle
*/
@Immutable
@ServiceImplementation
public final class SwingAesPbeKeyManagerMapModifier
extends KeyManagerMapModifier {
@Override
public Map, KeyManager>> apply(Map, KeyManager>> map) {
if (!GraphicsEnvironment.isHeadless())
map.put(AesPbeParameters.class,
new PromptingKeyManager<>(new SwingAesPbeParametersView()));
return map;
}
/** @return -200 */
@Override
public int getPriority() { return -200; }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy