RSA算法实现数据加密签名传输与数据解密代码实(12)

package com.sxy.rsademo; import com.sxy.rsademo.rsa.RsaUtils; import com.sxy.rsademo.utils.HttpClientUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import java.util.Map; @Slf4j @SpringBootApplication public class RsaDemoApplication { public static void main(String[] args) { SpringApplication.run(RsaDemoApplication.class, args); // 初始化密钥对,并持久化存储 RsaUtils.initKey(); try { // 获取持久化密钥对 Map<String,Object> keyMap = RsaUtils.getLastingKeyPair(); for (Map.Entry<String,Object> entry :keyMap.entrySet()){ log.info("keyMap==》 "+entry.getKey()+": "+entry.getValue()); } } catch (Exception e) { e.printStackTrace(); } // 发送数据进行测试 HttpClientUtils.main(args); } }

RsaDemoApplication.java

pom.xml  maven依赖文件:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/7465a0bce2263cbc0d8e543992cf0ce5.html