use of org.apache.wss4j.common.crypto.JasyptPasswordEncryptor in project cxf by apache.
the class AbstractWSS4JStaxInterceptor method getPasswordEncryptor.
protected PasswordEncryptor getPasswordEncryptor(SoapMessage soapMessage, WSSSecurityProperties securityProperties) {
PasswordEncryptor passwordEncryptor = (PasswordEncryptor) soapMessage.getContextualProperty(SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE);
if (passwordEncryptor != null) {
return passwordEncryptor;
}
CallbackHandler callbackHandler = securityProperties.getCallbackHandler();
if (callbackHandler == null) {
callbackHandler = (CallbackHandler) getProperties().get(ConfigurationConstants.PW_CALLBACK_REF);
}
if (callbackHandler != null) {
return new JasyptPasswordEncryptor(callbackHandler);
}
return null;
}
use of org.apache.wss4j.common.crypto.JasyptPasswordEncryptor in project cxf by apache.
the class WSS4JUtils method getPasswordEncryptor.
public static PasswordEncryptor getPasswordEncryptor(Message message) {
if (message == null) {
return null;
}
PasswordEncryptor passwordEncryptor = (PasswordEncryptor) message.getContextualProperty(SecurityConstants.PASSWORD_ENCRYPTOR_INSTANCE);
if (passwordEncryptor != null) {
return passwordEncryptor;
}
Object o = SecurityUtils.getSecurityPropertyValue(SecurityConstants.CALLBACK_HANDLER, message);
try {
CallbackHandler callbackHandler = SecurityUtils.getCallbackHandler(o);
if (callbackHandler != null) {
return new JasyptPasswordEncryptor(callbackHandler);
}
} catch (Exception ex) {
return null;
}
return null;
}
Aggregations