[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlrpc-user
Subject:    [jira] [Commented] (WSS-558) org.apache.ws.security.message.WSSecSignature can't support custom prov
From:       "Colm O hEigeartaigh (JIRA)" <jira () apache ! org>
Date:       2015-10-12 11:18:05
Message-ID: JIRA.12904144.1444648380000.12720.1444648685200 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/WSS-558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952940#comment-14952940 \
] 

Colm O hEigeartaigh commented on WSS-558:
-----------------------------------------


Could you attach a patch?

Colm.

> org.apache.ws.security.message.WSSecSignature can't support custom provider
> ---------------------------------------------------------------------------
> 
> Key: WSS-558
> URL: https://issues.apache.org/jira/browse/WSS-558
> Project: WSS4J
> Issue Type: Bug
> Components: WSS4J Core
> Affects Versions: 1.6.18
> Reporter: Sergey Smith
> Assignee: Colm O hEigeartaigh
> Priority: Minor
> 
> WSSecSignature().init not flexible to use custom java.security.Provider
> Which leads to the exceptions to use non-standard implementations of encryption \
> algorithms Current code:
> {code:title=WSSecSignature.java|borderStyle=solid}
> public WSSecSignature() {
> super();
> init();
> }
> 
> public WSSecSignature(WSSConfig config) {
> super(config);
> init();
> }
> 
> private void init() {
> // Try to install the Santuario Provider - fall back to the JDK provider if this \
> does // not work
> try {
> signatureFactory = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig");
> } catch (NoSuchProviderException ex) {
> signatureFactory = XMLSignatureFactory.getInstance("DOM");
> }
> try {
> keyInfoFactory = KeyInfoFactory.getInstance("DOM", "ApacheXMLDSig");
> } catch (NoSuchProviderException ex) {
> keyInfoFactory = KeyInfoFactory.getInstance("DOM");
> }
> }
> {code}
> My example of solution:
> {code:title=WSSecSignature.java|borderStyle=solid}
> public CustomWSSecSignature() {
> super();
> init(null);
> }
> 
> public CustomWSSecSignature(Provider povider) {
> super();
> init(povider);
> }
> 
> private void init(Provider povider) {
> 	if (povider == null)
> 		try {
> 			// Try to install the Santuario Provider - fall back to the JDK provider if this \
> does  // not work
> 			signatureFactory = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig");
> 		} catch (NoSuchProviderException ex) {
> 			signatureFactory = XMLSignatureFactory.getInstance("DOM");
> 		}
> 	else
> 		signatureFactory = XMLSignatureFactory.getInstance("DOM", povider);
> 	KeyInfoFactory keyInfoFactory = signatureFactory.getKeyInfoFactory();
> }
> {code}
> It will be very useful to use in vss4j



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic