BaseSecurityBean.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.utils;

  21. import java.util.Properties;

  22. import org.openspcoop2.security.keystore.MultiKeystore;
  23. import org.openspcoop2.utils.certificate.JWKSet;
  24. import org.openspcoop2.utils.certificate.KeyStore;

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

  33.     private Properties properties;
  34.     private KeyStore keystore;
  35.     private KeyStore truststore;
  36.     private JWKSet jwkSet;
  37.     private String user;
  38.     private String password;
  39.    
  40.     private MultiKeystore multiKeystore; // per mantenere la configurazione multikeystpre
  41.    
  42.     public Properties getProperties() {
  43.         return this.properties;
  44.     }
  45.     public void setProperties(Properties properties) {
  46.         this.properties = properties;
  47.     }
  48.     public KeyStore getKeystore() {
  49.         return this.keystore;
  50.     }
  51.     public void setKeystore(KeyStore keystore) {
  52.         this.keystore = keystore;
  53.     }
  54.     public void setKeystore(java.security.KeyStore keystore) {
  55.         if(keystore!=null) {
  56.             this.keystore = new KeyStore(keystore);
  57.         }
  58.     }
  59.     public KeyStore getTruststore() {
  60.         return this.truststore;
  61.     }
  62.     public void setTruststore(KeyStore truststore) {
  63.         this.truststore = truststore;
  64.     }
  65.     public void setTruststore(java.security.KeyStore truststore) {
  66.         if(truststore!=null) {
  67.             this.truststore = new KeyStore(truststore);
  68.         }
  69.     }
  70.     public JWKSet getJwkSet() {
  71.         return this.jwkSet;
  72.     }
  73.     public void setJwkSet(JWKSet jwkSet) {
  74.         this.jwkSet = jwkSet;
  75.     }
  76.     public String getUser() {
  77.         return this.user;
  78.     }
  79.     public void setUser(String user) {
  80.         this.user = user;
  81.     }
  82.     public String getPassword() {
  83.         return this.password;
  84.     }
  85.     public void setPassword(String password) {
  86.         this.password = password;
  87.     }
  88.    
  89.     public MultiKeystore getMultiKeystore() {
  90.         return this.multiKeystore;
  91.     }
  92.     public void setMultiKeystore(MultiKeystore multiKeystore) {
  93.         this.multiKeystore = multiKeystore;
  94.     }
  95. }