IAIK PKCS#11 Provider API Documentation
version 1.6

iaik.apps.util.passphrase
Class NewPassphraseHolder

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

public class NewPassphraseHolder
extends java.lang.Object
implements NewPassphrasePrompt

This is an implementation of a passphrase prompt that gets its passphrase(s) simply from a char array.


Constructor Summary
NewPassphraseHolder()
          Default constructor.
NewPassphraseHolder(char[] oldPassphrase, char[] newPassphrase)
          Constructor takgin the old and the new passphrase.
NewPassphraseHolder(PassphrasePrompt oldPassphrasePrompt, char[] newPassphrase)
          Constructor taking the new passphrase and a prompt for getting the old passphrase if required.
 
Method Summary
 char[] getNewPassphrase()
          Gets the new passphrase.
 char[] getOldPassphrase()
          Gets the old passphrase.
 boolean isCancelAllowed()
          False.
 char[][] promptNewPassphrase()
          Returns the new passphrase and the old if required.
 void setCancelAllowed(boolean allowCancel)
          This method does nothing.
 void setMessage(java.lang.Object promptMessageObject)
          This method does nothing.
 void setNewPassphrase(char[] newPassphrase)
          Sets the new passphrase.
 void setOldPassphrase(char[] oldPassphrase)
          Sets the old passphrase.
 void setOldPassphraseRequired(boolean oldPassphraseRequired)
          Set if the old password is required.
 void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
          This method does nothing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewPassphraseHolder

public NewPassphraseHolder()
Default constructor.


NewPassphraseHolder

public NewPassphraseHolder(char[] oldPassphrase,
                           char[] newPassphrase)
Constructor takgin the old and the new passphrase.

Parameters:
oldPassphrase - The old passphrase.
newPassphrase - The new passphrase.

NewPassphraseHolder

public NewPassphraseHolder(PassphrasePrompt oldPassphrasePrompt,
                           char[] newPassphrase)
Constructor taking the new passphrase and a prompt for getting the old passphrase if required.

Parameters:
oldPassphrasePrompt - The prompt for getting the old passphrase if required.
newPassphrase - The new passphrase.
Method Detail

getNewPassphrase

public char[] getNewPassphrase()
Gets the new passphrase.

Returns:
The new passphrase.

setOldPassphrase

public void setOldPassphrase(char[] oldPassphrase)
Sets the old passphrase.

Parameters:
oldPassphrase - The old passphrase.

getOldPassphrase

public char[] getOldPassphrase()
Gets the old passphrase.

Returns:
The old passphrase.

setNewPassphrase

public void setNewPassphrase(char[] newPassphrase)
Sets the new passphrase.

Parameters:
newPassphrase - The new passphrase.

setOldPassphraseRequired

public void setOldPassphraseRequired(boolean oldPassphraseRequired)
Set if the old password is required.

Specified by:
setOldPassphraseRequired in interface NewPassphrasePrompt
Parameters:
oldPassphraseRequired - True, if the old password is required.

promptNewPassphrase

public char[][] promptNewPassphrase()
Returns the new passphrase and the old if required. If the old is required but unavailable, the method will use the set old passphrase prompt. 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.
Postconditions
(not isCancelAllowed()) implies ((result <> null) and (result.length == 2))

isCancelAllowed

public boolean isCancelAllowed()
False.

Specified by:
isCancelAllowed in interface PassphraseInterfacce
Returns:
False.
Postconditions
(result == false)

setCancelAllowed

public void setCancelAllowed(boolean allowCancel)
This method does nothing.

Specified by:
setCancelAllowed in interface PassphraseInterfacce
Parameters:
allowCancel - Ignored.

setMessage

public void setMessage(java.lang.Object promptMessageObject)
This method does nothing.

Specified by:
setMessage in interface PassphraseInterfacce
Parameters:
promptMessageObject - Ignored.

setProtectedResourceInfo

public void setProtectedResourceInfo(java.lang.Object protectedResourceInfo)
This method does nothing.

Specified by:
setProtectedResourceInfo in interface PassphraseInterfacce
Parameters:
protectedResourceInfo - Ignored.

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