ome.security.auth
Class PasswordUtil

java.lang.Object
  extended by ome.security.auth.PasswordUtil

public class PasswordUtil
extends Object

Static methods for dealing with password hashes and the "password" table. Used primarily by AdminImpl

Since:
3.0-Beta1
Author:
Josh Moore, josh.moore at gmx.de
See Also:
SecuritySystem, AdminImpl

Constructor Summary
PasswordUtil(org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc)
           
 
Method Summary
 void changeUserPasswordById(Long id, String password)
           
 String generateRandomPasswd()
           
 String getDnById(Long id)
           
 String getUserPasswordHash(Long id)
           
static void main(String[] args)
          Main method which takes exactly one argument, passes it to preparePassword(String) and prints the results on System.out.
 String passwordDigest(String clearText)
          Creates an MD5 hash of the given clear text and base64 encodes it.
 String preparePassword(String newPassword)
           
 List<String> userGroups(String name)
           
 Long userId(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordUtil

public PasswordUtil(org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc)
Method Detail

main

public static void main(String[] args)
Main method which takes exactly one argument, passes it to preparePassword(String) and prints the results on System.out. This is used by the build system to define the "@ROOTPASS@" placeholder in data.sql.


generateRandomPasswd

public String generateRandomPasswd()

getDnById

public String getDnById(Long id)

changeUserPasswordById

public void changeUserPasswordById(Long id,
                                   String password)

getUserPasswordHash

public String getUserPasswordHash(Long id)

userId

public Long userId(String name)

userGroups

public List<String> userGroups(String name)

preparePassword

public String preparePassword(String newPassword)

passwordDigest

public String passwordDigest(String clearText)
Creates an MD5 hash of the given clear text and base64 encodes it.

To do:
This should almost certainly be configurable as to encoding, algorithm, character encoding, and possibly even the implementation in general.


OmeroJava Api

Version: Beta4.2.1-r8614-Beta4.2-b41

Copyright © 2009 The University of Dundee. All Rights Reserved.