@ThreadSafe public final class AesCipherParametersView extends java.lang.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 java.lang.String |
CLASS_NAME |
(package private) static java.io.Console |
con
The console to use for I/O.
|
private static java.net.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 java.lang.String |
NO |
(package private) static java.util.ResourceBundle |
resources |
private static java.lang.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 java.lang.String CLASS_NAME
static final java.util.ResourceBundle resources
static final java.io.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 java.net.URI lastResource
private static final java.lang.String YES
private static final java.lang.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.