|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.schlichtherle.key.AbstractKeyProvider
de.schlichtherle.key.PromptingKeyProvider
de.schlichtherle.key.PromptingAesKeyProvider
public class PromptingAesKeyProvider
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.
Field Summary |
---|
Fields inherited from interface de.schlichtherle.key.AesKeyProvider |
---|
KEY_STRENGTH_128, KEY_STRENGTH_192, KEY_STRENGTH_256 |
Fields inherited from interface de.schlichtherle.key.KeyProvider |
---|
MIN_KEY_RETRY_DELAY |
Constructor Summary | |
---|---|
PromptingAesKeyProvider()
|
Method Summary | |
---|---|
int |
getKeyStrength()
Returns the cipher key strength for the AES encryption. |
protected String |
getUIClassID()
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. |
protected void |
onReset()
Resets the key strength to 256 bits. |
void |
setKeyStrength(int keyStrength)
Sets the cipher key strength for the AES encryption. |
String |
toString()
Returns the current key strength. |
Methods inherited from class de.schlichtherle.key.PromptingKeyProvider |
---|
addToKeyManager, getCreateKeyImpl, getOpenKeyImpl, getResourceID, invalidOpenKeyImpl, removeFromKeyManager, reset |
Methods inherited from class de.schlichtherle.key.AbstractKeyProvider |
---|
cloneKey, getCreateKey, getKey, getOpenKey, invalidOpenKey, resetKey, setKey |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.schlichtherle.key.KeyProvider |
---|
getCreateKey, getOpenKey, invalidOpenKey |
Constructor Detail |
---|
public PromptingAesKeyProvider()
Method Detail |
---|
public int getKeyStrength()
AesKeyProvider
getKeyStrength
in interface AesKeyProvider
KEY_STRENGTH_128
,
KEY_STRENGTH_192
or KEY_STRENGTH_256
.public void setKeyStrength(int keyStrength)
AesKeyProvider
setKeyStrength
in interface AesKeyProvider
keyStrength
- One of KEY_STRENGTH_128
,
KEY_STRENGTH_192
or KEY_STRENGTH_256
.protected String getUIClassID()
PromptingKeyProvider
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.
getUIClassID
in class PromptingKeyProvider
protected void onReset()
onReset
in class PromptingKeyProvider
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |