use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class PublisherAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
if (conf == null && confFile != null) {
conf = new String(IoUtil.read(confFile));
}
PublisherEntry entry = new PublisherEntry(new NameId(null, name), type, conf);
String msg = "publisher " + name;
try {
caManager.addPublisher(entry);
println("added " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not add " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class PublisherUpdateCmd method execute0.
@Override
protected Object execute0() throws Exception {
if (type == null && conf == null && confFile == null) {
throw new IllegalCmdParamException("nothing to update");
}
if (conf == null && confFile != null) {
conf = new String(IoUtil.read(confFile));
}
String msg = "publisher " + name;
try {
caManager.changePublisher(name, type, conf);
println("updated " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not update " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class RequestorAddCmd method execute0.
@Override
protected Object execute0() throws Exception {
String base64Cert = IoUtil.base64Encode(IoUtil.read(certFile), false);
RequestorEntry entry = new RequestorEntry(new NameId(null, name), base64Cert);
String msg = "CMP requestor " + name;
if (entry.getCert() == null) {
throw new CmdFailure("could not add " + msg + ", error: could not get requestor certificate");
}
try {
caManager.addRequestor(entry);
println("added " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not add " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class RequestorRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "CMP requestor " + name;
try {
caManager.removeRequestor(name);
println("removed " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not remove " + msg + ", error: " + ex.getMessage(), ex);
}
}
use of org.xipki.console.karaf.CmdFailure in project xipki by xipki.
the class ResponderRemoveCmd method execute0.
@Override
protected Object execute0() throws Exception {
String msg = "CMP responder " + name;
try {
caManager.removeResponder(name);
println("removed " + msg);
return null;
} catch (CaMgmtException ex) {
throw new CmdFailure("could not remove " + msg + ", error: " + ex.getMessage(), ex);
}
}
Aggregations