Class SaltedPasswordValidationProviderV1Impl
- java.lang.Object
-
- org.onebusaway.users.impl.validation.SaltedPasswordValidationProviderV1Impl
-
- All Implemented Interfaces:
KeyValidationProvider
public class SaltedPasswordValidationProviderV1Impl extends Object implements KeyValidationProvider
ThisKeyValidationProvideris 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 toisValidKey(String, String...), while the password is expected as the first optional argument.- Author:
- bdferris
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROVIDER_ID
-
Constructor Summary
Constructors Constructor Description SaltedPasswordValidationProviderV1Impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgenerateKey(String input, String... arguments)StringgetId()voidgetKeyInfo(Map<String,String> info, String subKey, String... arguments)booleanisValidKey(String key, String... arguments)
-
-
-
Field Detail
-
PROVIDER_ID
public static final String PROVIDER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceKeyValidationProvider
-
generateKey
public String generateKey(String input, String... arguments)
- Specified by:
generateKeyin interfaceKeyValidationProvider
-
isValidKey
public boolean isValidKey(String key, String... arguments)
- Specified by:
isValidKeyin interfaceKeyValidationProvider
-
getKeyInfo
public void getKeyInfo(Map<String,String> info, String subKey, String... arguments)
- Specified by:
getKeyInfoin interfaceKeyValidationProvider
-
-