Merge pull request #107 from elfogre

* pr/107:
  Polish "Allow to sign SOAP attachments"
  Allow to sign SOAP attachments

Closes gh-107
This commit is contained in:
Stéphane Nicoll
2025-03-10 06:22:18 +01:00

View File

@@ -199,6 +199,8 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
private CallbackHandler samlCallbackHandler;
private CallbackHandler attachmentCallbackHandler;
// Allow RSA 15 to maintain default behavior
private boolean allowRSA15KeyTransportAlgorithm = true;
@@ -458,6 +460,15 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
this.samlCallbackHandler = samlCallbackHandler;
}
/**
* Set the {@link CallbackHandler} to use to sign/encrypt attachments.
* @param attachmentCallbackHandler the attachment callback handler
* @since 4.1.0
*/
public void setAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler) {
this.attachmentCallbackHandler = attachmentCallbackHandler;
}
/**
* Sets the server-side time to live.
*/
@@ -710,6 +721,9 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
if (this.samlCallbackHandler != null) {
messageContext.setProperty(WSHandlerConstants.SAML_CALLBACK_REF, this.samlCallbackHandler);
}
if (this.attachmentCallbackHandler != null) {
requestData.setAttachmentCallbackHandler(this.attachmentCallbackHandler);
}
// allow for qualified password types for .Net interoperability
requestData.setAllowNamespaceQualifiedPasswordTypes(true);