|
|
@ -130,7 +130,7 @@ public class SignUtils { |
|
|
// 填充
|
|
|
// 填充
|
|
|
Map<String,String> payload= new HashMap<>(); |
|
|
Map<String,String> payload= new HashMap<>(); |
|
|
payload.put("iss",(String)xmap.get("pem_token")); |
|
|
payload.put("iss",(String)xmap.get("pem_token")); |
|
|
//payload.put("exp",expireDate.toString()); //过期
|
|
|
payload.put("exp",expireDate.toString()); //过期
|
|
|
payload.put("iat",cal.getTime().toString());//发行日期
|
|
|
payload.put("iat",cal.getTime().toString());//发行日期
|
|
|
|
|
|
|
|
|
// 如果是用户
|
|
|
// 如果是用户
|
|
|
@ -139,9 +139,15 @@ public class SignUtils { |
|
|
} |
|
|
} |
|
|
//私钥存放位置
|
|
|
//私钥存放位置
|
|
|
String private_key_path = (String) xmap.get("private_key"); |
|
|
String private_key_path = (String) xmap.get("private_key"); |
|
|
|
|
|
// 公钥存放位置
|
|
|
|
|
|
String pub_key_path = (String) xmap.get("public_key"); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
// 私钥
|
|
|
// 私钥
|
|
|
RSAPrivateKey rsaPrivateKey = getPrivateKey(ChConstant.WORK_DIR + "/" + private_key_path); |
|
|
RSAPrivateKey rsaPrivateKey = getPrivateKey(ChConstant.WORK_DIR + "/" + private_key_path); |
|
|
|
|
|
// 公钥
|
|
|
|
|
|
RSAPublicKey rsaPublicKey = getPublicKey(ChConstant.WORK_DIR + "/" +pub_key_path); |
|
|
|
|
|
|
|
|
JWTCreator.Builder builder = JWT.create(); |
|
|
JWTCreator.Builder builder = JWT.create(); |
|
|
// 头部信息
|
|
|
// 头部信息
|
|
|
Map<String,Object> a = new HashMap<>(payload); |
|
|
Map<String,Object> a = new HashMap<>(payload); |
|
|
|