org.mmbase.util
Class PasswordGenerator

java.lang.Object
  extended byorg.mmbase.util.PasswordGenerator
All Implemented Interfaces:
PasswordGeneratorInterface

public class PasswordGenerator
extends Object
implements PasswordGeneratorInterface

Module for the automatic generation of passwords. Based on the code of Arnold G. Reinhold, Cambridge, MA, USA. This code is under the GNU License as specified by the original author.
The passwords generated by this class are based on a template. A template can exists of a number of characters, which are replaced by the generator as follows:
A : is replaced by a random letter (a - z).
C : is replaced by a random alphanumeric character (0-9, a-z)
H : is replaced by a random hex character (0-9,A-F)
S : is replaced by a random syllable. This, alterating, an element from a set of consonants or an element form a set of vowels. A syllable can be more than one character (i.e. "qu").
6 : is replaced by a random dice-roll (1-6)
9 : is replaced by a random digit (0-9)

Version:
$Id: PasswordGenerator.java,v 1.11 2005/12/18 00:19:21 michiel Exp $
Author:
Rico Jansen, Pierre van Rooden (javadocs)
Warning: License conflict:
uses the GNU license, should be moved external

Constructor Summary
PasswordGenerator()
          Creates the generator
 
Method Summary
 String getModuleInfo()
          Returns a description of the module.
 String getPassword()
          Generate a password, based on the default template for this module.
 String getPassword(String template)
          Generate a password, based on the given template.
static void main(String[] args)
          Entry point when calling from teh command line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordGenerator

public PasswordGenerator()
Creates the generator

Method Detail

main

public static void main(String[] args)
Entry point when calling from teh command line. Used for testing.


getPassword

public String getPassword()
Generate a password, based on the default template for this module.

Specified by:
getPassword in interface PasswordGeneratorInterface
Returns:
the generated password.

getPassword

public String getPassword(String template)
Generate a password, based on the given template.

Specified by:
getPassword in interface PasswordGeneratorInterface
Parameters:
template - the template the password should be based on.
Returns:
the generated password.

getModuleInfo

public String getModuleInfo()
Returns a description of the module.



MMBase build 1.8.1.20060716