<div dir="ltr">Hey,<div><br></div><div>i'm working with OpenSAML 3.1 and CXF 3.1.6</div><div><br></div><div>I have to encrypt SAML Tokens and it works well for the first time.</div><div><br></div><div>But after CXF has validated a token, it seems that it's overwriting the config which i have initialized with </div><div>InitializationService.initialize()</div><div><br></div><div>The code for encryption is like:</div><div><div>BasicX509Credential credential = new BasicX509Credential(certificate);</div><div>credential.setUsageType(UsageType.ENCRYPTION);</div><div><br></div><div>DataEncryptionParameters encryptionParameters = new DataEncryptionParameters();<br></div><div><br></div><div>EncryptionConfiguration encryptionConfiguration = ConfigurationService</div><div><span class="" style="white-space:pre">                </span>.get(EncryptionConfiguration.class);</div><div>NamedKeyInfoGeneratorManager manager = encryptionConfiguration</div><div><span class="" style="white-space:pre">          </span>.getDataKeyInfoGeneratorManager();</div><div>KeyInfoGeneratorFactory keyInfoGeneratorFactory = manager</div><div><span class="" style="white-space:pre">         </span>.getDefaultManager().getFactory(credential);</div><div><br></div><div>KeyEncryptionParameters keyEncryptionParameters = new KeyEncryptionParameters();</div><div>keyEncryptionParameters</div><div><span class="" style="white-space:pre">         </span>.setAlgorithm(EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSA15);</div><div>keyEncryptionParameters</div><div><span class="" style="white-space:pre">               </span>.setKeyInfoGenerator(keyInfoGeneratorFactory.newInstance());</div><div>keyEncryptionParameters.setEncryptionCredential(credential);</div><div><span class="" style="white-space:pre">    </span><br></div><div>Encrypter encrypter = new Encrypter(encryptionParameters,</div><div><span class="" style="white-space:pre">         </span>keyEncryptionParameters);</div><div>encrypter.setKeyPlacement(KeyPlacement.INLINE);</div></div><div><br></div><div>Do you have any idea what i can do to use CXF and OpenSAML together? </div><div><div>ConfigurationService.get(EncryptionConfiguration.class) returns null when i call it after CXF has been started.</div></div><div><br></div><div>Thanks,</div><div>Christofer Steingrefer</div></div>