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


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.svs.request.GetCrlRequest;
import cn.unitid.matrix.pkiservice.sdk.svs.response.GetCrlResponse;

public class GetCrlTest {

    public static void main(String[] args) {
        // 提供的URL
        String url = "http://172.16.6.76:20402";

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

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

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

        GetCrlRequest request = new GetCrlRequest();

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

        // 清理资源
        pkiClient.destroy();
    }

}
