@Override
public void handle(InputProcessorChain inputProcessorChain, EncryptedKeyType encryptedKeyType, XMLSecEvent responsibleXMLSecStartXMLEvent, XMLSecurityProperties securityProperties) throws XMLSecurityException {
checkBSPCompliance(inputProcessorChain, encryptedKeyType);
// Check encryption algorithm against the required algorithm, if defined
EncryptionMethodType encryptionMethodType = encryptedKeyType.getEncryptionMethod();
if (securityProperties.getEncryptionKeyTransportAlgorithm() != null
&& encryptionMethodType != null) {
String encryptionMethod = encryptionMethodType.getAlgorithm();
if (!securityProperties.getEncryptionKeyTransportAlgorithm().equals(encryptionMethod)) {
log.debug(
"The Key transport method does not match the requirement"
);
throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY);