|
TrueZIP 6.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schlichtherle.key.KeyManager
de.schlichtherle.key.PromptingKeyManager
de.schlichtherle.key.passwd.swing.PromptingKeyManager
public class PromptingKeyManager
A key manager which enables users to enter passwords or select key files as keys using a Swing GUI. This key manager is used by default unless the JVM is running in headless mode!
If a password is entered, then the run time type of the key is a char array, holding each password character. If a key file is selected, the file size must be 512 bytes or more, of which only the first 512 bytes are used as a byte array.
If this JVM is run in headless mode, all prompting is disabled.
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class de.schlichtherle.key.KeyManager |
|---|
KeyManager.KeyProviderCommand |
| Constructor Summary | |
|---|---|
PromptingKeyManager()
Constructs a new PromptingKeyManager. |
|
| Method Summary | |
|---|---|
protected void |
ensurePromptingImpl()
If this JVM is running in headless mode, then this method throws a KeyPromptingDisabledException with a HeadlessException
as its cause. |
static Window |
getParentWindow()
Returns the parent window of the last focused window. |
protected boolean |
isPromptingImpl()
Called by PromptingKeyManager.isPrompting() on the default key manager instance in
order to implement its behaviour and allow subclasses to override it. |
static void |
setParentWindow(Window w)
Deprecated. You shouldn't use this method any more, but rely on the implementation in getParentWindow(). |
| Methods inherited from class de.schlichtherle.key.PromptingKeyManager |
|---|
getKeyProvider, isPrompting, mapPromptingKeyProviderUIType, register, resetCancelledPrompts, setPrompting, setPromptingImpl |
| 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 |
| Constructor Detail |
|---|
public PromptingKeyManager()
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 |
| Method Detail |
|---|
public static Window getParentWindow()
last focused window.
If no window received the focus yet or is already made eligible for
finalization, then any showing window is used.
In all cases, the first showing parent window which is found by searching the containment hierarchy upwards is preferrably returned.
As a last resort, if no window is showing, then JOptionPane's
root frame is used.
public static void setParentWindow(Window w)
getParentWindow().
w - The parent window to use for key prompting or
null if a default window shall be used.getParentWindow()protected boolean isPromptingImpl()
PromptingKeyManagerPromptingKeyManager.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.
isPromptingImpl in class PromptingKeyManagerPromptingKeyManager.setPromptingImpl(boolean),
KeyManager.getInstance()
protected void ensurePromptingImpl()
throws KeyPromptingDisabledException
KeyPromptingDisabledException with a HeadlessException
as its cause.
ensurePromptingImpl in class PromptingKeyManagerKeyPromptingDisabledException
|
TrueZIP 6.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||