#358 Add future interface methods, remove exception throwing
- Create Utils class for a common implementation of md5/sha1 - Create "foolproof" way of getting the MessageDigest for md5 etc. (MessageDigestAlgorithm enum) - Create description annotations to annotate algorithms with usage recommendation and salt type
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package fr.xephi.authme.security;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
|
||||
/**
|
||||
* The Java-supported names to get a {@link MessageDigest} instance with.
|
||||
*
|
||||
* @see <a href="http://docs.oracle.com/javase/1.5.0/docs/guide/security/CryptoSpec.html#AppA">
|
||||
* Crypto Spec Appendix A: Standard Names</a>
|
||||
*/
|
||||
public enum MessageDigestAlgorithm {
|
||||
|
||||
MD5("MD5"),
|
||||
|
||||
SHA1("SHA-1"),
|
||||
|
||||
SHA256("SHA-256"),
|
||||
|
||||
SHA512("SHA-512");
|
||||
|
||||
private final String key;
|
||||
|
||||
MessageDigestAlgorithm(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user