Bus springBus = bf.createBus(busFile.toString());
bean.setBus(springBus);
bean.setProperties(properties);
if (streaming) {
XmlSecOutInterceptor encInterceptor = new XmlSecOutInterceptor();
encInterceptor.setEncryptionKeyIdentifierType(encryptionProperties.getEncryptionKeyIdType());
encInterceptor.setSymmetricEncAlgorithm(encryptionProperties.getEncryptionSymmetricKeyAlgo());
encInterceptor.setEncryptionDigestAlgorithm(encryptionProperties.getEncryptionDigestAlgo());
encInterceptor.setEncryptRequest(true);
if (sign) {
encInterceptor.setSignRequest(true);
}
bean.getOutInterceptors().add(encInterceptor);
XmlSecInInterceptor encInInterceptor = new XmlSecInInterceptor();
encInInterceptor.setRequireEncryption(true);
bean.getInInterceptors().add(encInInterceptor);
} else {
if (sign) {
bean.getOutInterceptors().add(new XmlSigOutInterceptor());
}
XmlEncOutInterceptor encInterceptor = new XmlEncOutInterceptor();
encInterceptor.setKeyIdentifierType(encryptionProperties.getEncryptionKeyIdType());
encInterceptor.setSymmetricEncAlgorithm(encryptionProperties.getEncryptionSymmetricKeyAlgo());
encInterceptor.setDigestAlgorithm(encryptionProperties.getEncryptionDigestAlgo());
bean.getOutInterceptors().add(encInterceptor);
bean.getInInterceptors().add(new XmlEncInInterceptor());
if (sign) {
bean.getInInterceptors().add(new XmlSigInInterceptor());