TrueZIP Driver ZIP.RAES (TZP) 7.1

de.schlichtherle.truezip.crypto.raes.param.console
Class AesCipherParametersView

java.lang.Object
  extended by de.schlichtherle.truezip.crypto.raes.param.console.AesCipherParametersView
All Implemented Interfaces:
PromptingKeyProvider.View<AesCipherParameters>

@ThreadSafe
public final class AesCipherParametersView
extends Object
implements PromptingKeyProvider.View<AesCipherParameters>

A console based user interface to prompt for passwords.

Author:
Christian Schlichtherle

Nested Class Summary
private static class AesCipherParametersView.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 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 Summary
AesCipherParametersView()
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME

private static final String CLASS_NAME

resources

static final ResourceBundle resources

con

static final Console con
The console to use for I/O. If null, the prompt methods are never called, so it's safe to assume that it's not null in these methods.


lock

private static final AesCipherParametersView.PromptingLock lock
Used to lock out prompting by multiple threads.


MIN_PASSWD_LEN

private static final int MIN_PASSWD_LEN
The minimum acceptable length of a password.

See Also:
Constant Field Values

lastResource

private static URI lastResource
The last resource ID used when prompting. Initialized to the empty string.


YES

private static final String YES

NO

private static final String NO
Constructor Detail

AesCipherParametersView

public AesCipherParametersView()
Method Detail

promptWriteKey

public final void promptWriteKey(PromptingKeyProvider.Controller<AesCipherParameters> controller)
Description copied from interface: PromptingKeyProvider.View
Prompts the user for the key for (over)writing the contents of a new or existing protected resource. Upon return, the implementation should have updated the key 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.

Specified by:
promptWriteKey in interface PromptingKeyProvider.View<AesCipherParameters>
Parameters:
controller - The key controller for storing the result.

promptReadKey

public void promptReadKey(PromptingKeyProvider.Controller<AesCipherParameters> controller,
                          boolean invalid)
Description copied from interface: PromptingKeyProvider.View
Prompts the user for the key for reading the contents of an existing protected resource. Upon return, the implementation should have updated the key 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.

Specified by:
promptReadKey in interface PromptingKeyProvider.View<AesCipherParameters>
Parameters:
controller - The key controller for storing the result.
invalid - true iff a previous call to this method resulted in an invalid key.

TrueZIP Driver ZIP.RAES (TZP) 7.1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.