package cn.unitid.matrix.pkiservice.test.kms;

import cn.unitid.matrix.pkiservice.sdk.ApiException;
import cn.unitid.matrix.pkiservice.sdk.PkiClient;
import cn.unitid.matrix.pkiservice.sdk.PkiOkhttpClient;
import cn.unitid.matrix.pkiservice.sdk.kms.request.CertAuditRequest;
import cn.unitid.matrix.pkiservice.sdk.kms.response.CertAuditResponse;

/**
 * @author Shy
 * @className CertAuditTest
 * @description 证书审计测试
 * @date 2022/11/24 18:40
 */
public class CertAuditTest {
    public static void main(String[] args) {
        // 提供的URL
        String url = "http://localhost:9200";

        // 您的appKey
        String appKey = "x8nXm7HhMY";

        // 您的appSecret
        String appSecret = "RtT9HSGbzzYcoZdswLDePx0dFnT6iPOM";

        // 1.原客户端
        PkiClient pkiClient = new PkiOkhttpClient(url, appKey, appSecret);

        CertAuditRequest request = new CertAuditRequest();

        //开始时间
        request.setSize(20);

        try {
            CertAuditResponse response = pkiClient.execute(request);
            // 后续业务
            if (response.isSuccess()) {
                System.out.println("成功响应：" + response.getResult());
            } else {
                System.out.println("失败响应：" + response.getBody());
            }
        } catch (ApiException e) {
            e.printStackTrace();
        }

    }
}
