de.schlichtherle.key
Class PromptingAesKeyProvider
java.lang.Object
de.schlichtherle.key.AbstractKeyProvider
de.schlichtherle.key.PromptingKeyProvider
de.schlichtherle.key.PromptingAesKeyProvider
- All Implemented Interfaces:
- AesKeyProvider, KeyProvider
public class PromptingAesKeyProvider
- extends PromptingKeyProvider
- implements AesKeyProvider
An implementation of AesKeyProvider which prompts the user for
a key and allows to select the cipher key strength when creating a new
AES encrypted resource or replacing the entire contents of an already
existing AES encrypted resource.
This class is thread safe.
- Since:
- TrueZIP 6.0
- Version:
- $Id: PromptingAesKeyProvider.java 5e709f50671d 2010/11/05 11:52:07 christian $
- Author:
- Christian Schlichtherle
keyStrength
private int keyStrength
PromptingAesKeyProvider
public PromptingAesKeyProvider()
getKeyStrength
public int getKeyStrength()
- Description copied from interface:
AesKeyProvider
- Returns the cipher key strength for the AES encryption.
- Specified by:
getKeyStrength in interface AesKeyProvider
- Returns:
- One of
KEY_STRENGTH_128,
KEY_STRENGTH_192 or KEY_STRENGTH_256.
setKeyStrength
public void setKeyStrength(int keyStrength)
- Description copied from interface:
AesKeyProvider
- Sets the cipher key strength for the AES encryption.
- Specified by:
setKeyStrength in interface AesKeyProvider
- Parameters:
keyStrength - One of KEY_STRENGTH_128,
KEY_STRENGTH_192 or KEY_STRENGTH_256.
getUIClassID
protected String getUIClassID()
- Description copied from class:
PromptingKeyProvider
- Returns the identifier which is used by the
PromptingKeyManager
to look up an instance of the PromptingKeyProviderUI user
interface class which is then used to prompt the user for a key.
The implementation in this class returns the fully qualified name
of this class.
Subclasses which want to use a custom user interface should overwrite
this method to return the fully qualified name of their respective
class as the identifier and provide a custom
PromptingKeyManager which has registered a
PromptingKeyProviderUI class for this identifier.
- Overrides:
getUIClassID in class PromptingKeyProvider
onReset
protected void onReset()
- Resets the key strength to 256 bits.
- Overrides:
onReset in class PromptingKeyProvider
toString
public String toString()
- Returns the current key strength.
- Overrides:
toString in class Object
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.