org.onebusaway.users.impl.validation
Class SaltedPasswordValidationProviderV1Impl

java.lang.Object
  extended by org.onebusaway.users.impl.validation.SaltedPasswordValidationProviderV1Impl
All Implemented Interfaces:
KeyValidationProvider

public class SaltedPasswordValidationProviderV1Impl
extends Object
implements KeyValidationProvider

This KeyValidationProvider is used to validate passwords. A password is salted with a randomly-generated salt and then an SHA-256 digest of the salt + password is generated as the key. This key is appropriate for long-term storage, as the salt hopefully prevents against rainbow attacks. The key can then be used to validate a password in the future. When validating, the key is expected as the primary argument to isValidKey(String, String...), while the password is expected as the first optional argument.

Author:
bdferris

Field Summary
static String PROVIDER_ID
           
 
Constructor Summary
SaltedPasswordValidationProviderV1Impl()
           
 
Method Summary
 String generateKey(String input, String... arguments)
           
 String getId()
           
 void getKeyInfo(Map<String,String> info, String subKey, String... arguments)
           
 boolean isValidKey(String key, String... arguments)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDER_ID

public static final String PROVIDER_ID
See Also:
Constant Field Values
Constructor Detail

SaltedPasswordValidationProviderV1Impl

public SaltedPasswordValidationProviderV1Impl()
Method Detail

getId

public String getId()
Specified by:
getId in interface KeyValidationProvider

generateKey

public String generateKey(String input,
                          String... arguments)
Specified by:
generateKey in interface KeyValidationProvider

isValidKey

public boolean isValidKey(String key,
                          String... arguments)
Specified by:
isValidKey in interface KeyValidationProvider

getKeyInfo

public void getKeyInfo(Map<String,String> info,
                       String subKey,
                       String... arguments)
Specified by:
getKeyInfo in interface KeyValidationProvider


Copyright © 2012 OneBusAway. All Rights Reserved.