@ThreadSafe public final class AesCipherParametersView extends Object implements PromptingKeyProvider.View<AesCipherParameters>
| Modifier and Type | Class and Description |
|---|---|
private static class |
AesCipherParametersView.PromptingLock
Used to lock out concurrent prompting.
|
| Modifier and Type | Field and Description |
|---|---|
private static String |
CLASS_NAME |
(package private) static Console |
con
The console to use for I/O.
|
private static URI |
lastResource
The last resource ID used when prompting.
|
private static AesCipherParametersView.PromptingLock |
lock
Used to lock out prompting by multiple threads.
|
private static int |
MIN_PASSWD_LEN
The minimum acceptable length of a password.
|
private static String |
NO |
(package private) static ResourceBundle |
resources |
private static String |
YES |
| Constructor and Description |
|---|
AesCipherParametersView() |
| Modifier and Type | Method and Description |
|---|---|
void |
promptReadKey(PromptingKeyProvider.Controller<AesCipherParameters> controller,
boolean invalid)
Prompts the user for the key for reading the contents of an
existing protected resource.
|
void |
promptWriteKey(PromptingKeyProvider.Controller<AesCipherParameters> controller)
Prompts the user for the key for (over)writing the contents of a
new or existing protected resource.
|
private static final String CLASS_NAME
static final ResourceBundle resources
static final Console con
null, the prompt methods are never called, so it's
safe to assume that it's not null in these methods.private static final AesCipherParametersView.PromptingLock lock
private static final int MIN_PASSWD_LEN
private static URI lastResource
private static final String YES
private static final String NO
public final void promptWriteKey(PromptingKeyProvider.Controller<AesCipherParameters> controller)
PromptingKeyProvider.Viewkey property of the given
controller.
If the implementation has called PromptingKeyProvider.Controller.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key.
Otherwise, prompting for a key is permanently disabled and each
subsequent call to SafeKeyProvider.getWriteKey() or SafeKeyProvider.getReadKey(boolean)
results in a KeyPromptingCancelledException until
PromptingKeyProvider.resetCancelledKey() or PromptingKeyProvider.resetUnconditionally() gets
called.
promptWriteKey in interface PromptingKeyProvider.View<AesCipherParameters>controller - The key controller for storing the result.public void promptReadKey(PromptingKeyProvider.Controller<AesCipherParameters> controller, boolean invalid)
PromptingKeyProvider.Viewkey property of the given
controller.
If the implementation has called PromptingKeyProvider.Controller.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key.
Otherwise, if the implementation has called PromptingKeyProvider.Controller.setKey(K)
with a null parameter or throws a
KeyPromptingCancelledException, then prompting for the key
is permanently disabled and each subsequent call to
SafeKeyProvider.getWriteKey() or SafeKeyProvider.getReadKey(boolean) results in a
KeyPromptingCancelledException until
PromptingKeyProvider.resetCancelledKey() or PromptingKeyProvider.resetUnconditionally() gets
called.
Otherwise, the state of the key provider is not changed and this method gets called again.
promptReadKey in interface PromptingKeyProvider.View<AesCipherParameters>controller - The key controller for storing the result.invalid - true iff a previous call to this method
resulted in an invalid key.Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.