Skip to content

Commit 59f3ae0

Browse files
elfogresnicoll
authored andcommitted
Allow to sign SOAP attachments
See gh-107
1 parent b4324d2 commit 59f3ae0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 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,14 @@ public void setSecurementSamlCallbackHandler(CallbackHandler samlCallbackHandler
458460
this.samlCallbackHandler = samlCallbackHandler;
459461
}
460462

463+
/**
464+
* Sets the attachment callback handler used for SwA signature/encryption
465+
* @param attachmentCallbackHandler
466+
*/
467+
public void setAttachmentCallbackHandler (CallbackHandler attachmentCallbackHandler) {
468+
this.attachmentCallbackHandler = attachmentCallbackHandler;
469+
}
470+
461471
/**
462472
* Sets the server-side time to live.
463473
*/
@@ -705,6 +715,8 @@ protected RequestData initializeRequestData(MessageContext messageContext) {
705715

706716
requestData.setWssConfig(this.wssConfig);
707717

718+
requestData.setAttachmentCallbackHandler(attachmentCallbackHandler);
719+
708720
messageContext.setProperty(WSHandlerConstants.TTL_TIMESTAMP, Integer.toString(this.securementTimeToLive));
709721

710722
if (this.samlCallbackHandler != null) {

0 commit comments

Comments
 (0)