use of com.adaptris.security.SecurityServiceFactory in project interlok by adaptris.
the class CoreSecurityService method initService.
@Override
protected final void initService() throws CoreException {
try {
pkPassword = getPrivateKeyPasswordProvider().retrievePrivateKeyPassword();
} catch (PasswordException e) {
throw new CoreException("Could not get password using " + getPrivateKeyPasswordProvider().getClass().getCanonicalName(), e);
}
try {
if (isEmpty(localPartner)) {
throw new CoreException("No Local Partner configured");
}
localPartnerAlias = new Alias(localPartner, pkPassword);
if (isEmpty(remotePartner)) {
log.warn("Remote partner not configured, " + "must be set individually as message metadata");
} else {
remotePartnerAlias = new Alias(remotePartner);
}
SecurityServiceFactory factory = securityFactory;
if (factory == null) {
factory = SecurityServiceFactory.defaultInstance();
}
service = factory.createService();
for (Iterator i = keystoreUrls.iterator(); i.hasNext(); ) {
ConfiguredKeystore url = (ConfiguredKeystore) i.next();
service.registerKeystore(url);
}
service.setEncryptionAlgorithm(encryptionAlgorithm);
if (successId != null && failId != null) {
branchingEnabled = true;
} else {
log.debug("No Success Id or Fail Id, branching disabled");
}
} catch (AdaptrisSecurityException e) {
throw new CoreException(e);
}
}
Aggregations