69 lines
1.8 KiB
Markdown
69 lines
1.8 KiB
Markdown
# SCFS-API-SDK
|
||
|
||
## 使用教程
|
||
|
||
```java
|
||
// 创建配置类
|
||
Profile profile=new RsaProfile.Builder()
|
||
.channel(xx)
|
||
.privateKey(xx)
|
||
.addCertificate(xx)
|
||
.build();
|
||
|
||
// 创建 http 客户端
|
||
ApiClient apiClient=new DefaultApiClientBuilder()
|
||
.profile(profile)
|
||
.build();
|
||
|
||
// 发起调用
|
||
EchoService echoService=new EchoService(apiClient);
|
||
echoService.
|
||
|
||
echo();
|
||
```
|
||
|
||
* [scfs-api-core](scfs-api-core) 核心模块,封装http请求,抽象加密/加密/加签等
|
||
* [scfs-api-service](scfs-api-service) 业务模型模块
|
||
* [scfs-api-rsa](scfs-api-rsa) rsa/aes加密算法实现
|
||
* [scfs-api-sm](scfs-api-sm) 国密实现模块,sm2/sm4
|
||
* [scfs-api-spring-boot-starter](scfs-api-spring-boot-starter) springboot 集成模块
|
||
|
||
## 生成私钥/证书
|
||
|
||
### 通过openSSL生成RSA证书
|
||
|
||
* https://slproweb.com/products/Win32OpenSSL.htm
|
||
|
||
```shell
|
||
# 私钥
|
||
openssl genrsa -out rsa_private_key.pem 2048
|
||
|
||
# 证书请求文件
|
||
openssl req -utf8 -new -out rsa_csr.pem -key rsa_private_key.pem
|
||
# Country Name (2 letter code) [AU]:CN
|
||
# State or Province Name (full name) [Some-State]:浙江省
|
||
# Locality Name (eg, city) []:杭州市
|
||
# Organization Name (eg, company) [Internet Widgits Pty Ltd]:浙江稠州商业银行
|
||
# Organizational Unit Name (eg, section) []:数字金融部
|
||
# Common Name (e.g. server FQDN or YOUR name) []:scfs.czcb.com.cn
|
||
# Email Address []:
|
||
|
||
# Please enter the following 'extra' attributes
|
||
# to be sent with your certificate request
|
||
# A challenge password []:
|
||
# An optional company name []:
|
||
|
||
# 证书
|
||
openssl x509 -req -days 3650 -in rsa_csr.pem -signkey rsa_private_key.pem -out rsa_certificate.pem
|
||
```
|
||
|
||
## 更新版本号
|
||
|
||
```shell
|
||
# 快照版本
|
||
mvn versions:set -DnewVersion=dev-snapshot
|
||
|
||
# 正式版本,版本号加一
|
||
mvn versions:set -DnewVersion=2.0.0
|
||
```
|