public class Security extends Object
Modifier and Type | Field and Description |
---|---|
static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
Security() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeString(String strToEncode)
This method will hash
strToEncode using the preferred algorithm. |
static String |
getRandomToken()
This method will generate a random string
|
static boolean |
hashMatches(String hashedPassword,
String passwordToHash)
Compare the given hash and the given string-to-hash to see if they are equal.
|
public static boolean hashMatches(String hashedPassword, String passwordToHash)
hashedPassword
- a stored password that has been hashed previouslypasswordToHash
- a string to encode/hash and compare to hashedPasswordpublic static String encodeString(String strToEncode) throws APIException
strToEncode
using the preferred algorithm. Currently,
OpenMRS's preferred algorithm is hard coded to be SHA-512.strToEncode
- string to encodeAPIException
public static String getRandomToken() throws APIException
APIException
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.