This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git
The following commit(s) were added to refs/heads/master by this push:
new 96a9a914e Using AttachmentUtil as well for attachment signature
transform
96a9a914e is described below
commit 96a9a914e32ece32e58d77fc8a98ced5a9fed605
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Sep 22 14:00:32 2026 +0100
Using AttachmentUtil as well for attachment signature transform
---
.../wss4j/dom/transform/AttachmentCompleteSignatureTransform.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git
a/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
b/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
index 861c44e2e..78d617426 100644
---
a/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
+++
b/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/AttachmentCompleteSignatureTransform.java
@@ -25,6 +25,7 @@ import java.io.OutputStream;
import org.apache.jcp.xml.dsig.internal.dom.ApacheOctetStreamData;
import org.apache.wss4j.common.ext.Attachment;
+import org.apache.wss4j.common.ext.WSSecurityException;
import org.apache.wss4j.common.util.AttachmentUtils;
import org.apache.wss4j.dom.WSConstants;
@@ -54,7 +55,12 @@ public class AttachmentCompleteSignatureTransform extends
AttachmentContentSigna
public Data transform(Data data, XMLCryptoContext context, OutputStream
os) throws TransformException {
String attachmentUri = ((ApacheOctetStreamData) data).getURI();
- String attachmentId = attachmentUri.substring(4);
+ String attachmentId;
+ try {
+ attachmentId = AttachmentUtils.getAttachmentId(attachmentUri);
+ } catch (WSSecurityException e) {
+ throw new TransformException(e);
+ }
AttachmentTransformParameterSpec attachmentTransformParameterSpec =
getAttachmentTransformParameterSpec();