mhaeusler commented on code in PR #418: URL: https://github.com/apache/ws-wss4j/pull/418#discussion_r1934364683
########## ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java: ########## @@ -276,27 +275,42 @@ private CertificateResult getPublicKey(Element keyValueElement, RequestData data X509Certificate[] certs = getCertificatesFromX509Data(keyValueElement, data); builder.certificates(certs); if (certs == null || certs.length == 0) { - XMLSignatureFactory signatureFactory; - if (provider == null) { - // Try to install the Santuario Provider - fall back to the JDK provider if this does - // not work - try { - signatureFactory = XMLSignatureFactory.getInstance("DOM", "ApacheXMLDSig"); - } catch (NoSuchProviderException ex) { - signatureFactory = XMLSignatureFactory.getInstance("DOM"); - } - } else { - signatureFactory = XMLSignatureFactory.getInstance("DOM", provider); - } - - PublicKey publicKey = X509Util.parseKeyValue((Element) keyValueElement.getParentNode(), - signatureFactory); + PublicKey publicKey = getPublicKeyFromKeyValue(keyValueElement); Review Comment: because it does not work at all. in XMLSignatureFactory there is a check for the xml element ` if ("Signature".equals(tag) && XMLSignature.XMLNS.equals(namespace)) {` this is obviously not the case here and will always throw an exception `throw new MarshalException("Invalid Signature tag: " + namespace + ":" + tag);` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@ws.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ws.apache.org For additional commands, e-mail: dev-h...@ws.apache.org