final List<WSDataRef> encryptedSignedRefs = new LinkedList<WSDataRef>();
for (WSDataRef encryptedRef : encryptedRefs) {
final Iterator<WSDataRef> signedRefsIt = signedRefs.iterator();
while (signedRefsIt.hasNext()) {
final WSDataRef signedRef = signedRefsIt.next();
if (isSignedEncryptionRef(encryptedRef, signedRef)) {
final WSDataRef encryptedSignedRef = new WSDataRef();
encryptedSignedRef.setWsuId(signedRef.getWsuId());
encryptedSignedRef.setContent(false);
encryptedSignedRef.setName(encryptedRef.getName());
encryptedSignedRef.setProtectedElement(encryptedRef
.getProtectedElement());
// This value is the ID of the encrypted element, not
// the value of the ID in the decrypted content
// (WSS4J 1.5.8). Therefore, passing it along does
// not provide much value.
//encryptedSignedRef.setWsuId(encryptedRef.getWsuId());
encryptedSignedRef.setXpath(encryptedRef.getXpath());
encryptedSignedRefs.add(encryptedSignedRef);
}
}
}