com.izforge.izpack.util
Class PasswordKeystoreValidator

java.lang.Object
  extended by com.izforge.izpack.util.PasswordKeystoreValidator
All Implemented Interfaces:
Validator

public class PasswordKeystoreValidator
extends java.lang.Object
implements Validator

This class based on a simple validator for passwords to demonstrate the implementation of a password validator that cooperates with the password field in the UserInputPanel. Additional validation may be done by utilizing the params added to the password field.

Author:
Elmar Grom, Jeff Gordon

Constructor Summary
PasswordKeystoreValidator()
           
 
Method Summary
private  InstallData getIdata(ProcessingClient client)
           
static java.security.KeyStore getKeyStore(java.lang.String fileName, java.lang.String type, char[] password)
           
private  java.util.Map<java.lang.String,java.lang.String> getParams(ProcessingClient client)
           
private  java.lang.String getPassword(ProcessingClient client)
           
 boolean validate(ProcessingClient client)
          PasswordKeystoreValidator Validates the ability to open a keystore based on the password and parameters provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordKeystoreValidator

public PasswordKeystoreValidator()
Method Detail

validate

public boolean validate(ProcessingClient client)
PasswordKeystoreValidator Validates the ability to open a keystore based on the password and parameters provided. Must specify parameter 'keystoreFile', and optionally 'keystoreType' (defaults to JKS), 'keystoreAlias' (to check for existence of a key), and 'aliasPassword' (for trying to retrieve the key). An additional parameter 'skipValidation' can be set to 'true' in a checkbox and allow the validator framework to run, but not actually do the validation.

Optionally checking the key password of multiple keys within a keystore requires the keystore password (if different from the key password) be set in the keystorePassword parameter.

Specified by:
validate in interface Validator
Parameters:
client - the client object using the services of this validator.
Returns:
true if the validation passes, otherwise false.

getParams

private java.util.Map<java.lang.String,java.lang.String> getParams(ProcessingClient client)

getIdata

private InstallData getIdata(ProcessingClient client)

getPassword

private java.lang.String getPassword(ProcessingClient client)

getKeyStore

public static java.security.KeyStore getKeyStore(java.lang.String fileName,
                                                 java.lang.String type,
                                                 char[] password)