OCSPValidatorBuilderImpl.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.utils.certificate.ocsp;

  21. import org.openspcoop2.utils.LoggerBuffer;
  22. import org.openspcoop2.utils.UtilsException;
  23. import org.openspcoop2.utils.transport.http.IOCSPValidator;
  24. import org.openspcoop2.utils.transport.http.IOCSPValidatorBuilder;
  25. import org.slf4j.Logger;

  26. /**
  27.  * OCSPValidatorBuilderImpl
  28.  *
  29.  * @author Poli Andrea (apoli@link.it)
  30.  * @author $Author$
  31.  * @version $Rev$, $Date$
  32.  */
  33. public class OCSPValidatorBuilderImpl implements IOCSPValidatorBuilder {

  34.     public OCSPValidatorBuilderImpl() {
  35.         // usato in org.openspcoop2.utils.transport.http.HttpUtilities tramite reflections
  36.     }
  37.    
  38.     @Override
  39.     public IOCSPValidator newInstance(Logger log, java.security.KeyStore truststore, String crlPath, String ocspPolicy) throws UtilsException{
  40.         return newInstance(log, new org.openspcoop2.utils.certificate.KeyStore(truststore), crlPath, ocspPolicy);
  41.     }
  42.     @Override
  43.     public IOCSPValidator newInstance(Logger log, org.openspcoop2.utils.certificate.KeyStore truststore, String crlPath, String ocspPolicy) throws UtilsException {
  44.         LoggerBuffer lb = new LoggerBuffer();
  45.         lb.setLogDebug(log);
  46.         lb.setLogError(log);
  47.         IOCSPResourceReader ocspResourceReader = new OCSPResourceReader();
  48.         return new OCSPValidatorImpl(lb, truststore, crlPath, ocspPolicy, ocspResourceReader);
  49.     }

  50.    
  51. }