hz-zhhq-app-service/greenH5modul/.svn/pristine/98/98bb4f38894b9b736455aaf26ac...

40 lines
669 B
Plaintext
Raw Normal View History

2025-01-21 13:12:35 +08:00
package com.nationalelectric.greenH5.identityAuth.util;
/**
* TODO DOCUMENT ME!
*
* @author <a href="mailto:93785732@qq.com">ZhengDaHong@fzfx</a>
* @since 2018/2/1 17:19
*/
public enum SignatureType {
MD5("MD5"),
SHA1("SHA1"),
SHA256("SHA256");
private String algorithm;
SignatureType(String algorithm) {
this.algorithm = algorithm;
}
public String getAlgorithm() {
return algorithm;
}
public static SignatureType of(String algorithm){
switch (algorithm){
case "MD5": return MD5;
case "SHA1": return SHA1;
case "SHA256": return SHA256;
default: throw new IllegalArgumentException("Unknown algorithm: " + algorithm);
}
}
}