[ https://issues.apache.org/jira/browse/CXF-3705?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Colm O hEigeartaigh updated CXF-3705: ------------------------------------- Fix Version/s: 2.4.3 > It's impossible to extend > org.apache.cxf.ws.security.policy.model.AlgorithmSuite with a custom > non-standad algorithms. > ---------------------------------------------------------------------------------------------------------------------- > > Key: CXF-3705 > URL: https://issues.apache.org/jira/browse/CXF-3705 > Project: CXF > Issue Type: Improvement > Components: WS-* Components > Affects Versions: 2.4.1 > Reporter: Sergey Zhemzhitsky > Assignee: Colm O hEigeartaigh > Labels: ws-security > Fix For: 2.4.3 > > > It's hardly possible to extend > org.apache.cxf.ws.security.policy.model.AlgorithmSuite with a custom > non-standad algorithms. > The possible solution is to refactor > org.apache.cxf.ws.security.policy.builders.AlgorithmSuiteBuilder to get all > algorithm suites using cxf extension mechanism, for example, > {code} > public class AlgorithmSuiteBuilder implements AssertionBuilder<Element> { > private Bus bus; > public AlgorithmSuiteBuilder(Bus bus) { > this.bus = bus; > } > public Assertion build(Element element, AssertionBuilderFactory factory) > throws IllegalArgumentException { > SPConstants consts = > SP11Constants.SP_NS.equals(element.getNamespaceURI()) > ? SP11Constants.INSTANCE : SP12Constants.INSTANCE; > Element policyElem = DOMUtils.getFirstElement(element); > String algoSuiteName = > DOMUtils.getFirstElement(policyElem).getLocalName(); > AlgorithmSuiteLoader loader = > bus.getExtension(AlgorithmSuiteLoader.class); > AlgorithmSuite suite = loader.getAlgorithmSuite(algoSuiteName, > consts); > if(suite == null) { > throw new IllegalArgumentException("Algorithm suite \"" + > algoSuiteName + "\" is not registered"); > } > return suite; > } > public QName[] getKnownElements() { > return new QName[]{SP11Constants.ALGORITHM_SUITE, > SP12Constants.ALGORITHM_SUITE}; > } > } > {code} > {code} > public interface AlgorithmSuiteLoader { > AlgorithmSuite getAlgorithmSuite(String localName, SPConstants consts); > } > {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira