use of org.xipki.ca.server.mgmt.api.x509.ChangeScepEntry in project xipki by xipki.
the class ScepUpdateCmd method execute0.
@Override
protected Object execute0() throws Exception {
Boolean realActive;
if (active != null) {
if (inactive != null) {
throw new IllegalCmdParamException("maximal one of --active and --inactive can be set");
}
realActive = Boolean.TRUE;
} else if (inactive != null) {
realActive = Boolean.FALSE;
} else {
realActive = null;
}
ChangeScepEntry entry = new ChangeScepEntry(name);
if (realActive != null) {
entry.setActive(realActive);
}
if (caName != null) {
entry.setCa(new NameId(null, caName));
}
if (responderName != null) {
entry.setResponderName(responderName);
}
if (CollectionUtil.isNonEmpty(profiles)) {
if (profiles.contains("NONE")) {
profiles.clear();
}
}
if (control != null) {
entry.setControl(control);
}
String msg = "SCEP responder " + name;
try {
caManager.changeScep(entry);
println("updated " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not update " + msg + ", error: " + ex.getMessage(), ex);
}
}
Aggregations