private ASN1Encodable extractGeneralRepContent(PKIMessage response, String expectedType) throws Exception { PKIBody respBody = response.getBody(); int bodyType = respBody.getType(); if (PKIBody.TYPE_ERROR == bodyType) { ErrorMsgContent content = ErrorMsgContent.getInstance(respBody.getContent()); throw new Exception("Server returned PKIStatus: " + buildText(content.getPKIStatusInfo())); } else if (PKIBody.TYPE_GEN_REP != bodyType) { throw new Exception(String.format("unknown PKI body type %s instead the expected [%s, %s]", bodyType, PKIBody.TYPE_GEN_REP, PKIBody.TYPE_ERROR)); } GenRepContent genRep = GenRepContent.getInstance(respBody.getContent()); InfoTypeAndValue[] itvs = genRep.toInfoTypeAndValueArray(); InfoTypeAndValue itv = null; if (itvs != null && itvs.length > 0) { for (InfoTypeAndValue entry : itvs) { if (expectedType.equals(entry.getInfoType().getId())) { itv = entry; break; } } } if (itv == null) { throw new Exception("the response does not contain InfoTypeAndValue " + expectedType); } return itv.getInfoValue(); } // method extractGeneralRepContent
private boolean parseRevocationResult(PKIMessage response, BigInteger serialNumber) throws Exception { PKIBody respBody = response.getBody(); final int bodyType = respBody.getType();
private Map<BigInteger, KeyAndCert> parseEnrollCertResult(PKIMessage response, int resonseBodyType, int numCerts) throws Exception { PKIBody respBody = response.getBody(); final int bodyType = respBody.getType();
int bodyType = respBody.getType(); if (bodyType != PKIBody.TYPE_ERROR) { throw new Exception("response is not signed");
int bodyType = respBody.getType();
int bodyType = respBody.getType(); if (bodyType != PKIBody.TYPE_ERROR) { throw new CmpClientException("response is not signed");
int type = reqBody.getType(); switch (type) { case PKIBody.TYPE_INIT_REQ:
int bodyType = respBody.getType();
List<CertResponse> certResponses = new ArrayList<>(1); boolean kup = (request.getBody().getType() == PKIBody.TYPE_KEY_UPDATE_REQ);
int bodyType = respBody.getType();
final int bodyType = respBody.getType();