IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.apps.util.passphrase
Class NewPassphraseConsoleDialog

java.lang.Object
  extended by iaik.apps.util.passphrase.NewPassphraseConsoleDialog
All Implemented Interfaces:
NewPassphrasePrompt, PassphraseInterfacce

public class NewPassphraseConsoleDialog
extends java.lang.Object
implements NewPassphrasePrompt

A dialog for prompting a new passphrase via the console.


Field Summary
static java.lang.String LINE_SEPARATOR
           
 
Constructor Summary
NewPassphraseConsoleDialog()
          default constructor
 
Method Summary
 boolean isCancelAllowed()
          True, if this prompt can be canceled by the user; i.e. the user need not enter a passphrase.
 char[][] promptNewPassphrase()
          Prompt the new passphrase and the old passphrase if required from the user.
 void setCancelAllowed(boolean allowCancel)
          Set this prompt object to allow cancelling or not.
 void setMessage(java.lang.Object promptMessageObject)
          Set the prompt object that should be presented to the user as information what passphrase is required.
 void setOldPassphraseRequired(boolean oldPassphraseRequired)
          Set if the use must enter the old passphrase in addition to the new.
 void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
          Set the object that specifies the protectd resource; i.e. the resource to which the user needs to authenticate; e.g. the name of the smart card for which a PIN is required.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static final java.lang.String LINE_SEPARATOR
Constructor Detail

NewPassphraseConsoleDialog

public NewPassphraseConsoleDialog()
default constructor

Method Detail

setOldPassphraseRequired

public void setOldPassphraseRequired(boolean oldPassphraseRequired)
Description copied from interface: NewPassphrasePrompt
Set if the use must enter the old passphrase in addition to the new.

Specified by:
setOldPassphraseRequired in interface NewPassphrasePrompt
Parameters:
oldPassphraseRequired - True, the use must enter the old passphrase in addition to the new.

promptNewPassphrase

public char[][] promptNewPassphrase()
Description copied from interface: NewPassphrasePrompt
Prompt the new passphrase and the old passphrase if required from the user. Display the prompt message to him. Block, until user has finished. If user is allowed to cancel the dialog, and the user cancels the dialog, then return null.

Specified by:
promptNewPassphrase in interface NewPassphrasePrompt
Returns:
An arrray of two char arrays. The first array is the old passphrase or null, if this has not been requested. The second is the new passphrase. This is null, if the user canceled the input.

isCancelAllowed

public boolean isCancelAllowed()
True, if this prompt can be canceled by the user; i.e. the user need not enter a passphrase.

Specified by:
isCancelAllowed in interface PassphraseInterfacce
Returns:
True, if this prompt can be canceled without entering a passphrase.
Postconditions
((result == false) implies (promptPassphrase() <> null))

setCancelAllowed

public void setCancelAllowed(boolean allowCancel)
Set this prompt object to allow cancelling or not.

Specified by:
setCancelAllowed in interface PassphraseInterfacce
Parameters:
allowCancel - If true, canceling the prompt is allowed.
Postconditions
(allowedCancel == false) implies (promptPassphrase() <> null)

setMessage

public void setMessage(java.lang.Object promptMessageObject)
Set the prompt object that should be presented to the user as information what passphrase is required. It is recommended that the toString() method of this object provides a telling output for the user. If the implementation knows the concrete class of the object it may use different means to create a message from the given object.

Specified by:
setMessage in interface PassphraseInterfacce
Parameters:
promptMessageObject - The object from which the implementation can get a human readable string that gives information what passphrase the user should enter.

setProtectedResourceInfo

public void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
Set the object that specifies the protectd resource; i.e. the resource to which the user needs to authenticate; e.g. the name of the smart card for which a PIN is required. The PKCS#11 provider may provide a TokenInfo object.

Specified by:
setProtectedResourceInfo in interface PassphraseInterfacce
Parameters:
protectedResourceInfo - The object that specifies the protected resource in more detail; e.g. the smart card. The PKCS#11 provider may provide a TokenInfo object.

IAIK PKCS#11 Provider API Documentation
version 1.6

IAIK JavaSecurity Website http://jce.iaik.tugraz.at/

IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2004, IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved.
version 1.6