use of org.xipki.audit.AuditEvent in project xipki by xipki.
the class X509Ca method revokeCa.
// method shouldPublishToDeltaCrlCache
public void revokeCa(CertRevocationInfo revocationInfo, String msgId) throws OperationException {
ParamUtil.requireNonNull("revocationInfo", revocationInfo);
caInfo.setRevocationInfo(revocationInfo);
if (caInfo.isSelfSigned()) {
AuditEvent event = newPerfAuditEvent(CaAuditConstants.TYPE_revoke_cert, msgId);
boolean successful = true;
try {
X509CertWithRevocationInfo ret = revokeCertificate0(caInfo.getSerialNumber(), revocationInfo.getReason(), revocationInfo.getInvalidityTime(), true, event);
successful = (ret != null);
} finally {
finish(event, successful);
}
}
boolean failed = false;
for (IdentifiedX509CertPublisher publisher : publishers()) {
NameId ident = publisher.getIdent();
boolean successful = publisher.caRevoked(caCert, revocationInfo);
if (successful) {
LOG.info("published event caRevoked of CA {} to publisher {}", caIdent, ident);
} else {
failed = true;
LOG.error("could not publish event caRevoked of CA {} to publisher {}", caIdent, ident);
}
}
if (failed) {
final String message = "could not event caRevoked of CA " + caIdent + " to at least one publisher";
throw new OperationException(ErrorCode.SYSTEM_FAILURE, message);
}
}
use of org.xipki.audit.AuditEvent in project xipki by xipki.
the class X509Ca method removeCertificate.
// method unrevokeCertificate
public X509CertWithDbId removeCertificate(BigInteger serialNumber, String msgId) throws OperationException {
if (caInfo.isSelfSigned() && caInfo.getSerialNumber().equals(serialNumber)) {
throw new OperationException(ErrorCode.NOT_PERMITTED, "insufficient permission remove CA certificate");
}
AuditEvent event = newPerfAuditEvent(CaAuditConstants.TYPE_remove_cert, msgId);
boolean successful = true;
try {
X509CertWithDbId ret = removeCertificate0(serialNumber, event);
successful = (ret != null);
return ret;
} finally {
finish(event, successful);
}
}
use of org.xipki.audit.AuditEvent in project xipki by xipki.
the class X509Ca method generateCrl.
// method generateCrlOnDemand
private X509CRL generateCrl(boolean deltaCrl, Date thisUpdate, Date nextUpdate, String msgId) throws OperationException {
boolean successful = false;
AuditEvent event = newPerfAuditEvent(CaAuditConstants.TYPE_gen_crl, msgId);
try {
X509CRL crl = generateCrl0(deltaCrl, thisUpdate, nextUpdate, event, msgId);
successful = true;
return crl;
} finally {
finish(event, successful);
}
}
use of org.xipki.audit.AuditEvent in project xipki by xipki.
the class X509Ca method revokeSuspendedCerts.
// method removeExpirtedCerts
private int revokeSuspendedCerts(String msgId) throws OperationException {
LOG.debug("revoking suspended certificates");
AuditEvent event = newPerfAuditEvent(CaAuditConstants.TYPE_revoke_suspendedCert, msgId);
boolean successful = false;
try {
int num = revokeSuspendedCerts0(event, msgId);
LOG.info("revoked {} suspended certificates of CA {}", num, caIdent);
successful = true;
return num;
} finally {
finish(event, successful);
}
}
use of org.xipki.audit.AuditEvent in project xipki by xipki.
the class X509Ca method generateCertificate.
private X509CertificateInfo generateCertificate(GrantedCertTemplate gct, RequestorInfo requestor, boolean keyUpdate, RequestType reqType, byte[] transactionId, String msgId) throws OperationException {
AuditEvent event = newPerfAuditEvent(CaAuditConstants.TYPE_gen_cert, msgId);
boolean successful = false;
try {
X509CertificateInfo ret = generateCertificate0(gct, requestor, keyUpdate, reqType, transactionId, event);
successful = (ret != null);
return ret;
} finally {
finish(event, successful);
}
}
Aggregations