Skip to content

Commit ef6dbe6

Browse files
committed
Merge pull request #107 from elfogre
* pr/107: Polish "Allow to sign SOAP attachments" Allow to sign SOAP attachments Closes gh-107
2 parents b4324d2 + 90ff94a commit ef6dbe6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spring-ws-security/src/main/java/org/springframework/ws/soap/security/wss4j2/Wss4jSecurityInterceptor.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ public class Wss4jSecurityInterceptor extends AbstractWsSecurityInterceptor impl
199199

200200
private CallbackHandler samlCallbackHandler;
201201

202+
private CallbackHandler attachmentCallbackHandler;
203+
202204
// Allow RSA 15 to maintain default behavior
203205
private boolean allowRSA15KeyTransportAlgorithm = true;
204206

@@ -458,6 +460,15 @@ public void setSecurementSamlCallbackHandler(CallbackHandler samlCallbackHandler
458460
this.samlCallbackHandler = samlCallbackHandler;
459461
}
460462

463+
/**
464+
* Set the {@link CallbackHandler} to use to sign/encrypt attachments.
465+
* @param attachmentCallbackHandler the attachment callback handler
466+
* @since 4.1.0
467+
*/
468+
public void setAttachmentCallbackHandler(CallbackHandler attachmentCallbackHandler) {
469+
this.attachmentCallbackHandler = attachmentCallbackHandler;
470+
}
471+
461472
/**
462473
* Sets the server-side time to live.
463474
*/
@@ -710,6 +721,9 @@ protected RequestData initializeRequestData(MessageContext messageContext) {
710721
if (this.samlCallbackHandler != null) {
711722
messageContext.setProperty(WSHandlerConstants.SAML_CALLBACK_REF, this.samlCallbackHandler);
712723
}
724+
if (this.attachmentCallbackHandler != null) {
725+
requestData.setAttachmentCallbackHandler(this.attachmentCallbackHandler);
726+
}
713727

714728
// allow for qualified password types for .Net interoperability
715729
requestData.setAllowNamespaceQualifiedPasswordTypes(true);

0 commit comments

Comments
 (0)