package com.jeedan.rest.web;
import org.apache.commons.lang3.RandomStringUtils;
import java.security.MessageDigest;
import java.util.Iterator;
import java.util.Map.Entry;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
public class SignatureUtil {
public static final String TOKEN = "9adkcieiq907a2pmli09";//用于生成数字签名
/**
* 创建SHA1签名
* @param params
* @return SHA1签名
*/
public static String createSignature(SortedMap<String, String> params) {
/*String s = sha1Encrypt(sortParams(params));
return s;*/
return sha1Encrypt(sortParams(params));
}
/**
* 创建SHA1签名
* @param timeStamp
* @param nonce
* @param secretId
* @return
*/
public static String createSignature(String timeStamp, String nonce, String secretId) {
SortedMap<String, String> signParams = new TreeMap<String, String>();
signParams.put("token", TOKEN);
signParams.put
java针对sign签名的操作
最新推荐文章于 2024-05-11 14:45:08 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)