1
0
mirror of https://e.coding.net/circlecloud/AuthMe.git synced 2025-11-27 21:56:26 +00:00

init project...

Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
502647092
2015-10-12 15:26:15 +08:00
commit a1176afa15
165 changed files with 19619 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package fr.xephi.authme.security.crypts;
import java.security.NoSuchAlgorithmException;
/**
* <p>
* Public interface for Custom Password encryption method
* </p>
* <p>
* The getHash function is called when we need to crypt the password (/register
* usually)
* </p>
* <p>
* The comparePassword is called when we need to match password (/login usually)
* </p>
*/
public interface EncryptionMethod {
/**
* @param hash
* @param password
* @param playerName
* @return true if password match, false else
* @throws NoSuchAlgorithmException
*/
boolean comparePassword(String hash, String password, String playerName) throws NoSuchAlgorithmException;
/**
* @param password
* @param salt
* (can be an other data like playerName;salt , playerName,
* etc... for customs methods)
* @return Hashing password
* @throws NoSuchAlgorithmException
*/
String getHash(String password, String salt, String name) throws NoSuchAlgorithmException;
}