Search in sources :

Example 1 with OcspCertPublisher

use of org.xipki.ca.server.impl.ocsp.OcspCertPublisher in project xipki by xipki.

the class CaManagerImpl method createPublisher.

// method createCertprofile
IdentifiedX509CertPublisher createPublisher(PublisherEntry dbEntry) throws CaMgmtException {
    ParamUtil.requireNonNull("dbEntry", dbEntry);
    String type = dbEntry.getType();
    X509CertPublisher publisher;
    IdentifiedX509CertPublisher ret;
    try {
        if ("OCSP".equalsIgnoreCase(type)) {
            publisher = new OcspCertPublisher();
        } else {
            publisher = x509CertPublisherFactoryRegister.newPublisher(type);
        }
        ret = new IdentifiedX509CertPublisher(dbEntry, publisher);
        ret.initialize(securityFactory.getPasswordResolver(), datasources);
        return ret;
    } catch (ObjectCreationException | CertPublisherException | RuntimeException ex) {
        String msg = "invalid configuration for the publisher " + dbEntry.getIdent();
        LogUtil.error(LOG, ex, msg);
        throw new CaMgmtException(msg, ex);
    }
}
Also used : CaMgmtException(org.xipki.ca.server.mgmt.api.CaMgmtException) OcspCertPublisher(org.xipki.ca.server.impl.ocsp.OcspCertPublisher) X509CertPublisher(org.xipki.ca.api.publisher.x509.X509CertPublisher) ObjectCreationException(org.xipki.common.ObjectCreationException) CertPublisherException(org.xipki.ca.api.publisher.CertPublisherException)

Aggregations

CertPublisherException (org.xipki.ca.api.publisher.CertPublisherException)1 X509CertPublisher (org.xipki.ca.api.publisher.x509.X509CertPublisher)1 OcspCertPublisher (org.xipki.ca.server.impl.ocsp.OcspCertPublisher)1 CaMgmtException (org.xipki.ca.server.mgmt.api.CaMgmtException)1 ObjectCreationException (org.xipki.common.ObjectCreationException)1