SignatureReceiverProvider.java

  1. /*
  2.  * GovWay - A customizable API Gateway
  3.  * https://govway.org
  4.  *
  5.  * Copyright (c) 2005-2025 Link.it srl (https://link.it).
  6.  *
  7.  * This program is free software: you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License version 3, as published by
  9.  * the Free Software Foundation.
  10.  *
  11.  * This program is distributed in the hope that it will be useful,
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.  * GNU General Public License for more details.
  15.  *
  16.  * You should have received a copy of the GNU General Public License
  17.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  18.  *
  19.  */

  20. package org.openspcoop2.security.message.xml;

  21. import java.util.Map;
  22. import java.util.Properties;

  23. import org.apache.commons.lang.StringUtils;
  24. import org.openspcoop2.core.mvc.properties.provider.InputValidationUtils;
  25. import org.openspcoop2.core.mvc.properties.provider.ProviderException;
  26. import org.openspcoop2.core.mvc.properties.provider.ProviderValidationException;

  27. /**    
  28.  * SignatureReceiverProvider
  29.  *
  30.  * @author Poli Andrea (poli@link.it)
  31.  * @author $Author$
  32.  * @version $Rev$, $Date$
  33.  */
  34. public class SignatureReceiverProvider extends TrustStoreSecurityProvider {

  35.     public SignatureReceiverProvider() {
  36.         super();
  37.     }

  38.    
  39.     @Override
  40.     public void validate(Map<String, Properties> mapProperties) throws ProviderException, ProviderValidationException {
  41.         super.validate(mapProperties);
  42.        
  43.         //Properties defaultP = MultiPropertiesUtilities.getDefaultProperties(mapProperties);
  44.        
  45.         Properties p = mapProperties.get("signatureTrustStorePropRefId");
  46.         if(p!=null && p.size()>0) {
  47.             String file = p.getProperty("org.apache.ws.security.crypto.merlin.file");
  48.             if(file!=null && StringUtils.isNotEmpty(file)) {
  49.                 InputValidationUtils.validateTextAreaInput(file, "Verifier Signature - TrustStore - File");
  50.             }
  51.         }
  52.        
  53.     }
  54.    
  55. }