public ContentInfo servicePkiOperation(CMSSignedData requestContent, String certprofileName,
String msgId, AuditEvent event) throws MessageDecodingException, OperationException {
if (!isOnService()) {
LOG.warn("SCEP {} is not active", caIdent.getName());
throw new OperationException(ErrorCode.SYSTEM_UNAVAILABLE);
}
DecodedPkiMessage req = DecodedPkiMessage.decode(requestContent, envelopedDataDecryptor, null);
PkiMessage rep = servicePkiOperation0(requestContent, req, certprofileName, msgId, event);
audit(event, CaAuditConstants.NAME_SCEP_pki_status, rep.getPkiStatus().toString());
if (rep.getPkiStatus() == PkiStatus.FAILURE) {
event.setStatus(AuditStatus.FAILED);
}
if (rep.getFailInfo() != null) {
audit(event, CaAuditConstants.NAME_SCEP_fail_info, rep.getFailInfo().toString());
}
return encodeResponse(rep, req);
}