[ https://issues.apache.org/jira/browse/CXF-6715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15066528#comment-15066528 ]
Colm O hEigeartaigh commented on CXF-6715: ------------------------------------------ The problem is that the EncryptedKey does not contain a KeyInfo, and hence the code doesn't know where to get a private key from to decrypt the key. I've updated the code a bit to use the default identifier in the Crypto instance if no KeyInfo is available. You can specify this with: org.apache.wss4j.crypto.merlin.keystore.alias=X > SAMLProtocolResponseValidator fails to decrypt an assertion > ----------------------------------------------------------- > > Key: CXF-6715 > URL: https://issues.apache.org/jira/browse/CXF-6715 > Project: CXF > Issue Type: Bug > Components: JAX-RS Security > Affects Versions: 3.0.7 > Reporter: Michal Sabo > Assignee: Colm O hEigeartaigh > Attachments: samlResponse.xml > > > During the decryption of the SAML assertion a WSSecurityException exception > is thrown, when it fails to load X509 certificate for an EncryptedKey element > (org.apache.cxf.rs.security.saml.sso.SAMLProtocolResponseValidator:451). > However it seems that the EncryptedKey element is correct according to the > XML Encryption Syntax schema. > This is the problematic EncryptedKey element (part of the whole SAML response > attached): > {{<xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" > Id="id-dG6qwCA9nALpsqno8mQK3XEyx2c-"><xenc:EncryptionMethod > Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/><xenc:CipherData><xenc:CipherValue>U4sqaCa/VuWVwBDuGXLwu8mzjVW6iJ1+GUEpyGFWE/gfXJ0hWFOu/Y+1qSjNweyEaRPimjppGMMqD9HBV0ieGazKNXftSGSoRoUXC+Uq1F9BVN5f5HgF5Ga/z2MYCfDaItQuMVuar53CBSxTPkRmgU/Pej8C5kpJNRS029FxWAYeHlTB03YqjR0xFFEhqf2vRzQjX5IglOQP7rSKeQhgacmkVz3/r3TA6JeCZ9TBDb5xIPNq7kJYn8jZYpGV/iV68cPBdjDmcva3E6NVCK4D/Sa3biV8fBFxvvIBoXeCRXwNwnqoowrqUxSb+qCtYxeuV+BVLe1OrDuqrzkipRiAIw==</xenc:CipherValue></xenc:CipherData><xenc:ReferenceList><xenc:DataReference > > URI="#id-23qweVuzWC19vHEC-8kpWmk-4bY-"/></xenc:ReferenceList></xenc:EncryptedKey>}} -- This message was sent by Atlassian JIRA (v6.3.4#6332)