OpenSAML and CXF
Christofer Steingrefer
csteingrefer at gmail.com
Fri Apr 29 10:56:09 EDT 2016
Hey,
i'm working with OpenSAML 3.1 and CXF 3.1.6
I have to encrypt SAML Tokens and it works well for the first time.
But after CXF has validated a token, it seems that it's overwriting the
config which i have initialized with
InitializationService.initialize()
The code for encryption is like:
BasicX509Credential credential = new BasicX509Credential(certificate);
credential.setUsageType(UsageType.ENCRYPTION);
DataEncryptionParameters encryptionParameters = new
DataEncryptionParameters();
EncryptionConfiguration encryptionConfiguration = ConfigurationService
.get(EncryptionConfiguration.class);
NamedKeyInfoGeneratorManager manager = encryptionConfiguration
.getDataKeyInfoGeneratorManager();
KeyInfoGeneratorFactory keyInfoGeneratorFactory = manager
.getDefaultManager().getFactory(credential);
KeyEncryptionParameters keyEncryptionParameters = new
KeyEncryptionParameters();
keyEncryptionParameters
.setAlgorithm(EncryptionConstants.ALGO_ID_KEYTRANSPORT_RSA15);
keyEncryptionParameters
.setKeyInfoGenerator(keyInfoGeneratorFactory.newInstance());
keyEncryptionParameters.setEncryptionCredential(credential);
Encrypter encrypter = new Encrypter(encryptionParameters,
keyEncryptionParameters);
encrypter.setKeyPlacement(KeyPlacement.INLINE);
Do you have any idea what i can do to use CXF and OpenSAML together?
ConfigurationService.get(EncryptionConfiguration.class) returns null when i
call it after CXF has been started.
Thanks,
Christofer Steingrefer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/dev/attachments/20160429/0cd904c3/attachment.html>
More information about the dev
mailing list