This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3_0_x-fixes
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git


The following commit(s) were added to refs/heads/3_0_x-fixes by this push:
     new 5b246209b Using AttachmentUtil as well for attachment signature 
transform
5b246209b is described below

commit 5b246209b7b7a372e2612e3006f5af3616cadf02
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();
 

Reply via email to