use of org.xipki.ocsp.server.impl.jaxb.FileOrValueType in project xipki by xipki.
the class OcspServerImpl method initSigner.
private ResponderSigner initSigner(SignerType signerType) throws InvalidConfException {
X509Certificate[] explicitCertificateChain = null;
X509Certificate explicitResponderCert = null;
if (signerType.getCert() != null) {
explicitResponderCert = parseCert(signerType.getCert());
}
if (explicitResponderCert != null) {
Set<X509Certificate> caCerts = null;
if (signerType.getCaCerts() != null) {
caCerts = new HashSet<>();
for (FileOrValueType certConf : signerType.getCaCerts().getCaCert()) {
caCerts.add(parseCert(certConf));
}
}
explicitCertificateChain = X509Util.buildCertPath(explicitResponderCert, caCerts);
}
String responderSignerType = signerType.getType();
String responderKeyConf = signerType.getKey();
List<String> sigAlgos = signerType.getAlgorithms().getAlgorithm();
List<ConcurrentContentSigner> singleSigners = new ArrayList<>(sigAlgos.size());
for (String sigAlgo : sigAlgos) {
try {
ConcurrentContentSigner requestorSigner = securityFactory.createSigner(responderSignerType, new SignerConf("algo=" + sigAlgo + "," + responderKeyConf), explicitCertificateChain);
singleSigners.add(requestorSigner);
} catch (ObjectCreationException ex) {
throw new InvalidConfException(ex.getMessage(), ex);
}
}
try {
return new ResponderSigner(singleSigners);
} catch (CertificateException | IOException ex) {
throw new InvalidConfException(ex.getMessage(), ex);
}
}
Aggregations