|
TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.crypto.raes.param.console.AesCipherParametersUI
@ThreadSafe public final class AesCipherParametersUI
A console based user interface to prompt for passwords.
| Nested Class Summary | |
|---|---|
private static class |
AesCipherParametersUI.PromptingLock
Used to lock out concurrent prompting. |
| Field Summary | |
|---|---|
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 AesCipherParametersUI.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 Summary | |
|---|---|
AesCipherParametersUI()
|
|
| Method Summary | |
|---|---|
void |
promptCreateKey(PromptingKeyProvider<? super AesCipherParameters> provider)
Prompts the user for the key which may be used to create a new protected resource or entirely replace the contents of an already existing protected resource. |
void |
promptOpenKey(PromptingKeyProvider<? super AesCipherParameters> provider,
boolean invalid)
Prompts the user for the key which may be used to open an existing protected resource in order to access its contents. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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 AesCipherParametersUI.PromptingLock lock
private static final int MIN_PASSWD_LEN
private static URI lastResource
private static final String YES
private static final String NO
| Constructor Detail |
|---|
public AesCipherParametersUI()
| Method Detail |
|---|
public final void promptCreateKey(PromptingKeyProvider<? super AesCipherParameters> provider)
PromptingKeyProvider.UIkey property of the given provider.
If the implementation has called PromptingKeyProvider.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key of the given provider.
Otherwise, prompting for a key is permanently disabled and each
subsequent call to SafeKeyProvider.getCreateKey() or SafeKeyProvider.getOpenKey(boolean)
results in a KeyPromptingCancelledException until
PromptingKeyProvider.resetCancelledKey() or PromptingKeyProvider.resetUnconditionally() gets
called.
promptCreateKey in interface PromptingKeyProvider.UI<AesCipherParameters>provider - The key provider to store the result in.
public void promptOpenKey(PromptingKeyProvider<? super AesCipherParameters> provider,
boolean invalid)
PromptingKeyProvider.UIkey property of the given provider.
If the implementation has called PromptingKeyProvider.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key of the given provider.
Otherwise, if the implementation has called PromptingKeyProvider.setKey(K) with a
null parameter or throws a
KeyPromptingCancelledException, then prompting for the key
is permanently disabled and each subsequent call to
SafeKeyProvider.getCreateKey() or SafeKeyProvider.getOpenKey(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.
promptOpenKey in interface PromptingKeyProvider.UI<AesCipherParameters>provider - The key provider to store the result in.invalid - true iff a previous call to this method
resulted in an invalid key.
|
TrueZIP Driver TZP (ZIP.RAES) 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||