Search in sources :

Example 6 with QueryCertResult

use of com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult in project spring-cloud-digital-sign by SpringForAll.

the class RaService method queryCertByCertId.

/**
 * 通过CERT_ID查询证书
 *
 * @Title: queryCertByCertId
 * @Description: TODO(通过CERT_ID查询证书 )
 * @param certId
 *            证书ID
 * @return JSONObject 返回结果信息
 * @throws JSONException
 */
public JSONObject queryCertByCertId(int certId) throws JSONException {
    JSONObject ret = new JSONObject();
    String json = "";
    if (certId == 0) {
        ret.put("code", "10010107");
        ret.put("msg", errorCode.getErrorCode().get(10010107));
        return ret;
    }
    try {
        if (CERT_ISKMC != null) {
            json = "{'certKmcReq2':'" + (CERT_ISKMC.equals("false") ? "" : "kmcClientVersion=20150130") + "','certValidity':'" + CERT_REQ_CHALLENGE + "'}";
        }
        UserAPIServicePortTypeProxy proxy = axisUtil.getProxyNow();
        QueryCertResult result = proxy.queryCertByCertId(certId, ACCOUNT_HASH, json);
        ret.put("code", "0");
        ret.put("msg", "");
        ret.put("result", result);
    } catch (Exception e) {
        ret.put("code", "20010101");
        ret.put("msg", errorCode.getErrorCode().get(20010101) + ":" + e.getMessage());
        return ret;
    }
    return ret;
}
Also used : JSONObject(org.json.JSONObject) UserAPIServicePortTypeProxy(com.liumapp.digitalsign.test.ca.tianwei.proxy.UserAPIServicePortTypeProxy) QueryCertResult(com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult) JSONException(org.json.JSONException)

Aggregations

QueryCertResult (com.liumapp.digitalsign.test.ca.tianwei.query.QueryCertResult)6 RaServiceUnavailable (com.liumapp.digitalsign.test.ca.tianwei.error.RaServiceUnavailable)3 UserAPIServicePortTypeProxy (com.liumapp.digitalsign.test.ca.tianwei.proxy.UserAPIServicePortTypeProxy)3 QName (javax.xml.namespace.QName)3 JSONException (org.json.JSONException)3 JSONObject (org.json.JSONObject)2