use of org.xipki.ca.client.api.dto.RevokeCertRequest in project xipki by xipki.
the class CaClientImpl method revokeCert.
private CertIdOrError revokeCert(CaConf ca, BigInteger serial, int reason, Date invalidityDate, RequestResponseDebug debug) throws CaClientException, PkiErrorException {
ParamUtil.requireNonNull("ca", ca);
ParamUtil.requireNonNull("serial", serial);
final String id = "cert-1";
RevokeCertRequestEntry entry = new RevokeCertRequestEntry(id, ca.getSubject(), serial, reason, invalidityDate);
if (ca.getCmpControl().isRrAkiRequired()) {
entry.setAuthorityKeyIdentifier(ca.getSubjectKeyIdentifier());
}
RevokeCertRequest request = new RevokeCertRequest();
request.addRequestEntry(entry);
Map<String, CertIdOrError> result = revokeCerts(request, debug);
return (result == null) ? null : result.get(id);
}
use of org.xipki.ca.client.api.dto.RevokeCertRequest in project xipki by xipki.
the class CaClientImpl method envelopeRevocation.
// method verify
@Override
public byte[] envelopeRevocation(X500Name issuer, BigInteger serial, int reason) throws CaClientException {
ParamUtil.requireNonNull("issuer", issuer);
init0(false);
final String id = "cert-1";
RevokeCertRequestEntry entry = new RevokeCertRequestEntry(id, issuer, serial, reason, null);
RevokeCertRequest request = new RevokeCertRequest();
request.addRequestEntry(entry);
String caName = getCaNameByIssuer(issuer);
X509CmpRequestor cmpRequestor = casMap.get(caName).getRequestor();
try {
PKIMessage pkiMessage = cmpRequestor.envelopeRevocation(request);
return pkiMessage.getEncoded();
} catch (CmpRequestorException | IOException ex) {
throw new CaClientException(ex.getMessage(), ex);
}
}
Aggregations