package com.nationalelectric.greenH5.identityAuth.util; /** * TODO DOCUMENT ME! * * @author ZhengDaHong@fzfx * @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); } } }