Search in sources :

Example 1 with UnrevokeOrRemoveCertRequest

use of org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertRequest in project xipki by xipki.

the class CaClientImpl method unrevokeCert.

private CertIdOrError unrevokeCert(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 = unrevokeCerts(request, debug);
    return (result == null) ? null : result.get(id);
}
Also used : UnrevokeOrRemoveCertRequest(org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertRequest) CertIdOrError(org.xipki.ca.client.api.CertIdOrError) UnrevokeOrRemoveCertEntry(org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertEntry)

Example 2 with UnrevokeOrRemoveCertRequest

use of org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertRequest 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);
}
Also used : UnrevokeOrRemoveCertRequest(org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertRequest) CertIdOrError(org.xipki.ca.client.api.CertIdOrError) UnrevokeOrRemoveCertEntry(org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertEntry)

Aggregations

CertIdOrError (org.xipki.ca.client.api.CertIdOrError)2 UnrevokeOrRemoveCertEntry (org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertEntry)2 UnrevokeOrRemoveCertRequest (org.xipki.ca.client.api.dto.UnrevokeOrRemoveCertRequest)2