use of org.xipki.ca.client.api.CertIdOrError in project xipki by xipki.
the class CaClientImpl method parseRevokeCertResult.
private Map<String, CertIdOrError> parseRevokeCertResult(RevokeCertResultType result) throws CaClientException {
Map<String, CertIdOrError> ret = new HashMap<>();
for (ResultEntry re : result.getResultEntries()) {
CertIdOrError certIdOrError;
if (re instanceof RevokeCertResultEntry) {
RevokeCertResultEntry entry = (RevokeCertResultEntry) re;
certIdOrError = new CertIdOrError(entry.getCertId());
} else if (re instanceof ErrorResultEntry) {
ErrorResultEntry entry = (ErrorResultEntry) re;
certIdOrError = new CertIdOrError(entry.getStatusInfo());
} else {
throw new CaClientException("unknown type " + re.getClass().getName());
}
ret.put(re.getId(), certIdOrError);
}
return ret;
}
use of org.xipki.ca.client.api.CertIdOrError in project xipki by xipki.
the class CaClientImpl method removeCert.
private CertIdOrError removeCert(CaConf ca, BigInteger serial, RequestResponseDebug debug) throws CaClientException, PkiErrorException {
ParamUtil.requireNonNull("ca", ca);
ParamUtil.requireNonNull("serial", serial);
final String id = "cert-1";
UnrevokeOrRemoveCertEntry entry = new UnrevokeOrRemoveCertEntry(id, ca.getSubject(), serial);
if (ca.getCmpControl().isRrAkiRequired()) {
entry.setAuthorityKeyIdentifier(ca.getSubjectKeyIdentifier());
}
UnrevokeOrRemoveCertRequest request = new UnrevokeOrRemoveCertRequest();
request.addRequestEntry(entry);
Map<String, CertIdOrError> result = removeCerts(request, debug);
return (result == null) ? null : result.get(id);
}
Aggregations