2 changed files with 39 additions and 1 deletions
@ -0,0 +1,38 @@ |
|||||
|
package cn.chjyj.szwh; |
||||
|
|
||||
|
import cn.chjyj.szwh.constant.ChConstant; |
||||
|
import cn.chjyj.szwh.utils.SzFileUtils; |
||||
|
import org.junit.Test; |
||||
|
import org.springframework.boot.test.context.SpringBootTest; |
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.io.FileReader; |
||||
|
import java.util.Properties; |
||||
|
|
||||
|
/** |
||||
|
* jwt token 测试 |
||||
|
*/ |
||||
|
@SpringBootTest |
||||
|
public class JwtRsaTokenTests { |
||||
|
|
||||
|
/** |
||||
|
* 委托系统token测试 |
||||
|
*/ |
||||
|
@Test |
||||
|
public void entrTokenTest(){ |
||||
|
// 资源文件
|
||||
|
String dbconf = ChConstant.WORK_DIR + ChConstant.SZWH_CONF; |
||||
|
Properties prop = new Properties(); |
||||
|
try { |
||||
|
prop.load(new FileReader(dbconf)); |
||||
|
// 委托系统 密钥
|
||||
|
String entr_prikey=prop.getProperty("entrust.pem.prikey.path");//私钥路径
|
||||
|
// 私钥
|
||||
|
String prinote = SzFileUtils.getKeyFromFile(ChConstant.WORK_DIR + "/" + entr_prikey); |
||||
|
System.out.println("文件内容"+prinote); |
||||
|
}catch (Exception ex){ |
||||
|
ex.printStackTrace(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue