Search in sources :

Example 11 with PublisherEntry

use of org.xipki.ca.server.mgmt.api.PublisherEntry 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);
    }
}
Also used : CaMgmtException(org.xipki.ca.server.mgmt.api.CaMgmtException) PublisherEntry(org.xipki.ca.server.mgmt.api.PublisherEntry) NameId(org.xipki.ca.api.NameId) CmdFailure(org.xipki.console.karaf.CmdFailure)

Aggregations

PublisherEntry (org.xipki.ca.server.mgmt.api.PublisherEntry)11 CaMgmtException (org.xipki.ca.server.mgmt.api.CaMgmtException)5 CmdFailure (org.xipki.console.karaf.CmdFailure)5 NameId (org.xipki.ca.api.NameId)3 AddUserEntry (org.xipki.ca.server.mgmt.api.AddUserEntry)3 CaHasRequestorEntry (org.xipki.ca.server.mgmt.api.CaHasRequestorEntry)3 CaHasUserEntry (org.xipki.ca.server.mgmt.api.CaHasUserEntry)3 CertprofileEntry (org.xipki.ca.server.mgmt.api.CertprofileEntry)3 CmpControlEntry (org.xipki.ca.server.mgmt.api.CmpControlEntry)3 RequestorEntry (org.xipki.ca.server.mgmt.api.RequestorEntry)3 ResponderEntry (org.xipki.ca.server.mgmt.api.ResponderEntry)3 UserEntry (org.xipki.ca.server.mgmt.api.UserEntry)3 ScepEntry (org.xipki.ca.server.mgmt.api.x509.ScepEntry)3 X509CaEntry (org.xipki.ca.server.mgmt.api.x509.X509CaEntry)3 X509CrlSignerEntry (org.xipki.ca.server.mgmt.api.x509.X509CrlSignerEntry)3 IOException (java.io.IOException)2 CertificateEncodingException (java.security.cert.CertificateEncodingException)2 X509Certificate (java.security.cert.X509Certificate)2 PreparedStatement (java.sql.PreparedStatement)2 SQLException (java.sql.SQLException)2