com.ibm.passwordrules.standard
Class StandardGenerator

java.lang.Object
  |
  +--com.ibm.passwordrules.standard.StandardGenerator
All Implemented Interfaces:
PasswordGenerator

public class StandardGenerator
extends java.lang.Object
implements PasswordGenerator

Default generator used to generate passwords using a random number algorithm. The IBM Tivoli Identity Manager standard password generator will generate a random string of characters using a configurable set of seed characters. The set of seed characters starts with a base set which is specified in the passwordrules.properties file. This set is specified as a space separated list of integer values after the property key ‘generator.com.ibm.passwordrules.standard.StandardGenerator’. If this property is not specified then the standard password generator will default to the set of lower and uppercase characters uppercase characters 'a', 'b', 'c', ..., 'z', 'A', 'B', 'C', ..., 'Z'. When a new password is generated, characters will be added or removed from the base set as needed to satisfy certain password rules. For instance, if a password rule specifies that one or more numeric characters must appear in the password then the characters ‘0’, ‘1’, … , ‘9’ will be added to the set of seed characters. Similarly, if a password rule specifies that a specific set of characters must appear in each password then these characters will be added to the set of seed characters. The length of the generated string is determined using the minimum and maximum length constraints specified in the password policy. Once the standard password generator creates a candidate password, that password will be compared with the password policy for the target account. If the password is not valid, a new password candidate will be generated. If after a fixed number of attempts, the password generator fails to generate a valid password, one or more error messages will be logged or displayed. For instance, when creating a new password policy the message “CTGIME011E: A conflict was detected while joining password rules” is displayed if the generator fails to create a valid password. See the problem determination guide for an explanation of each password related error message.


Field Summary
static int DEFAULT_LENGTH
          The default length of the password.
 
Fields inherited from interface com.ibm.passwordrules.PasswordGenerator
LAST_CHARACTER_INDEX
 
Constructor Summary
StandardGenerator()
          Default constructor
 
Method Summary
 void addChars(char[] list)
          Add a set of characters to be used by the password generator.
 void allLowerCase()
          Make sure that only the lower case characters are used by the password generator.
 void allUpperCase()
          Make sure that only the upper case characters are used by the password generator.
 java.lang.String generate()
          Generate a random password.
 void initialize(java.lang.String parameter)
          Initialize the password generator.
 void removeChars(char[] charList)
          Remove a set of characters from being used by the password generator.
 void setCharListAt(char[] chars, int startIndex, int endIndex)
          Constrain the set of characters to be used by the password generator at a given character possition in the generated password.
 void setLength(int length)
          Set the fixed length of passwords to be generated.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LENGTH

public static final int DEFAULT_LENGTH
The default length of the password.

See Also:
Constant Field Values
Constructor Detail

StandardGenerator

public StandardGenerator()
Default constructor

Method Detail

generate

public java.lang.String generate()
Generate a random password.

Specified by:
generate in interface PasswordGenerator
Returns:
String object representing the generated password in plain text.

setLength

public void setLength(int length)
Set the fixed length of passwords to be generated.

Specified by:
setLength in interface PasswordGenerator
Parameters:
length - requested length of password.

addChars

public void addChars(char[] list)
Add a set of characters to be used by the password generator.

Specified by:
addChars in interface PasswordGenerator
Parameters:
list - of additional allowed characters from which the generate password.

removeChars

public void removeChars(char[] charList)
Remove a set of characters from being used by the password generator. Note, that his method is not implemented and will do nothing.

Specified by:
removeChars in interface PasswordGenerator
Parameters:
charList - List of characters none of which may be used in the generated password.

allUpperCase

public void allUpperCase()
Make sure that only the upper case characters are used by the password generator.

Specified by:
allUpperCase in interface PasswordGenerator

allLowerCase

public void allLowerCase()
Make sure that only the lower case characters are used by the password generator.

Specified by:
allLowerCase in interface PasswordGenerator

setCharListAt

public void setCharListAt(char[] chars,
                          int startIndex,
                          int endIndex)
Constrain the set of characters to be used by the password generator at a given character possition in the generated password.

Specified by:
setCharListAt in interface PasswordGenerator
Parameters:
chars - array of allowed characters to be used on a given position of the password.
startIndex - start index representing a character position in the generated password to choose one of the given allowed characters for.
endIndex - last index representing a character position in the generated password to choose one of the given characters for.

initialize

public void initialize(java.lang.String parameter)
Initialize the password generator. Method will be called once immediately after the generator instance is created.

Specified by:
initialize in interface PasswordGenerator
Parameters:
parameter - any text data which might be used in initializing the generator


IBM Tivoli Identity Manager 4.6
© Copyright International Business Machines Corporation 2005. All rights reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.