| | |
| | | package org.yeshi.utils;
|
| | |
|
| | | import java.io.IOException;
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Method;
|
| | | import java.security.InvalidKeyException;
|
| | | import java.security.MessageDigest;
|
| | | import java.security.NoSuchAlgorithmException;
|
| | | import java.util.regex.Matcher;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import org.apache.commons.codec.binary.Base64;
|
| | | import org.yeshi.utils.encrypt.HmacUtils;
|
| | |
|
| | | import sun.misc.BASE64Encoder;
|
| | |
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | public static String MD5Hmac(String st, String key) {
|
| | | try {
|
| | | return HmacUtils.byte2hex(HmacUtils.encryptHMAC(st, key));
|
| | | } catch (InvalidKeyException e) {
|
| | | e.printStackTrace();
|
| | | } catch (NoSuchAlgorithmException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 将null转为空字符串
|
| | | *
|