You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ws.apache.org by "coheigea (via GitHub)" <gi...@apache.org> on 2025/01/29 16:00:40 UTC
Re: [PR] WSS-714 RecipientKeyInfo improved [ws-wss4j]
coheigea commented on code in PR #418:
URL: https://github.com/apache/ws-wss4j/pull/418#discussion_r1934158091
##########
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:
What's the reason here not to use XMLSignatureFactory as before?
--
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-unsubscribe@ws.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ws.apache.org
For additional commands, e-mail: dev-help@ws.apache.org