de.schlichtherle.key.passwd.console
Class PromptingKeyManager
java.lang.Object
de.schlichtherle.key.KeyManager
de.schlichtherle.key.PromptingKeyManager
de.schlichtherle.key.passwd.console.PromptingKeyManager
public class PromptingKeyManager
- extends PromptingKeyManager
A simple key manager which enables users to enter passwords as keys using
console I/O.
This key manager is used by default if the JVM is running in headless mode
and the API complies to JSE6 (i.e. the class java.io.Console
is available)!
To request it explicitly, set the system property
de.schlichtherle.key.KeyManager to
de.schlichtherle.key.passwd.console.PromptingKeyManager.
This key manager does not support key files and disables prompting if no
console is attached to the JVM.
Note that class loading and instantiation may happen in a JVM shutdown hook,
so class initializers and constructors must behave accordingly.
In particular, it's not permitted to construct or use a Swing GUI there.
This class is thread safe.
- Since:
- TrueZIP 6.4
- Version:
- TrueZIP 6.7
- Author:
- Christian Schlichtherle
| Methods inherited from class de.schlichtherle.key.KeyManager |
forEachKeyProvider, getInstance, getKeyProvider, mapKeyProviderType, moveKeyProvider, resetAndClearKeyProviders, resetAndRemoveKeyProvider, resetAndRemoveKeyProviders, resetKeyProvider, resetKeyProviders, setInstance, setKeyProvider |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PromptingKeyManager
public PromptingKeyManager()
- Constructs a new
PromptingKeyManager.
This instance maps the following key provider UI types using
PromptingKeyManager.mapPromptingKeyProviderUIType(java.lang.String, java.lang.Class):
| uiClassID |
uiClass |
| "PromptingKeyProvider" |
PromptingKeyProviderUI.class |
| "PromptingAesKeyProvider" |
PromptingAesKeyProviderUI.class |
isPromptingImpl
protected boolean isPromptingImpl()
- Description copied from class:
PromptingKeyManager
- Called by
PromptingKeyManager.isPrompting() on the default key manager instance in
order to implement its behaviour and allow subclasses to override it.
Subclasses should call the implementation in this class when
overriding this method.
- Overrides:
isPromptingImpl in class PromptingKeyManager
- See Also:
PromptingKeyManager.setPromptingImpl(boolean),
KeyManager.getInstance()
ensurePromptingImpl
protected void ensurePromptingImpl()
throws KeyPromptingDisabledException
- If no console is attached to this JVM, then this method throws a
KeyPromptingDisabledException.
- Overrides:
ensurePromptingImpl in class PromptingKeyManager
- Throws:
KeyPromptingDisabledException