org.eclipse.ecf.core.security
Class PassphraseCallback

java.lang.Object
  extended by org.eclipse.ecf.core.security.PassphraseCallback
All Implemented Interfaces:
java.io.Serializable, Callback

public class PassphraseCallback
extends java.lang.Object
implements Callback, java.io.Serializable

Callback that handles passphrases

See Also:
Serialized Form

Constructor Summary
PassphraseCallback(java.lang.String prompt)
          Construct a PassphraseCallback with a prompt.
PassphraseCallback(java.lang.String prompt, java.lang.String defaultPassphrase)
          Construct a PassphraseCallback with a prompt and default passphrase.
 
Method Summary
 java.lang.String getDefaultPassphrase()
          Get the default passphrase.
 java.lang.String getPassphrase()
          Get the retrieved passphrase.
 java.lang.String getPrompt()
          Get the prompt.
 void setPassphrase(java.lang.String pw)
          Set the retrieved passphrase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassphraseCallback

public PassphraseCallback(java.lang.String prompt)
Construct a PassphraseCallback with a prompt.

Parameters:
prompt - the prompt used to request the passphrase.
Throws:
java.lang.IllegalArgumentException - if prompt is null.

PassphraseCallback

public PassphraseCallback(java.lang.String prompt,
                          java.lang.String defaultPassphrase)
Construct a PassphraseCallback with a prompt and default passphrase.

Parameters:
prompt - the prompt used to request the information.

defaultPassphrase - the name to be used as the default name displayed with the prompt.
Throws:
java.lang.IllegalArgumentException - if prompt is null.
Method Detail

getPrompt

public java.lang.String getPrompt()
Get the prompt.

Returns:
the prompt.

getDefaultPassphrase

public java.lang.String getDefaultPassphrase()
Get the default passphrase.

Returns:
the default passphrase, or null if this PassphraseCallback was not instantiated with a defaultPassphrase.

setPassphrase

public void setPassphrase(java.lang.String pw)
Set the retrieved passphrase.

Parameters:
pw - the passphrase (which may be null).
See Also:
getPassphrase()

getPassphrase

public java.lang.String getPassphrase()
Get the retrieved passphrase.

Returns:
the retrieved passphrase (which may be null)
See Also:
setPassphrase(java.lang.String)