程序员

安卓版,国密网站通信, JSSE,SM2,国密证书,国密http

2021-08-04  本文已影响0人  雨邪

介绍:开源国密通信纯 Java JSSE 实现,国密https网站访问,安卓版 HttpsURLConnection协议访问国密网站,SM2,SM3,SM4

1.使用案例:

//本地测试链接  SM2单证书
public static final String nativeUrl = "https://192.168.10.35:9400/index.html";
//沃通 RSA和SM2双证书
public static final String ovsslUrl = "https://sm2test.ovssl.cn/";
//中国银行 SM2单证书
public static final String bocUrl = "https://ebssec.boc.cn/";
//GDCA 测试链接 RSA和SM2双证书
public static final String gdcaUrl = "https://gmssl.trustauth.cn/";

//更多国密测试链接,见:HttpsURLConnectionUtils
String url = HttpsURLConnectionUtils.gdcaUrl;
HttpsURLConnectionUtils.get(this, url, new RequestCallBack() {
      @Override
     public void onError(Exception e) {
     }

     @Override
     public void onFail(String msg) {
     }

     @Override
     public void onSuccess(String content) {
     }
});

2.demo地址:

演示demo下载地址

3.github开源地址:

开源地址: https://github.com/yuxie2025/guomi_demo.git

4.访问日志截图

log.png

5.app主页截图

home.png
上一篇下一篇

猜你喜欢

热点阅读