KeystoreConstants.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.keystore;

  21. import org.apache.wss4j.common.crypto.Merlin;

  22. /**
  23.  * KeystoreConstants
  24.  *
  25.  * @author Andrea Poli (apoli@link.it)
  26.  * @author $Author$
  27.  * @version $Rev$, $Date$
  28.  */
  29. public class KeystoreConstants {

  30.     private KeystoreConstants(){}
  31.    
  32.     // https://ws.apache.org/wss4j/config.html

  33.     // the property names ${PREFIX} below is "org.apache.wss4j.crypto".
  34.     // For Apache WSS4J 1.6.x, the property names ${PREFIX} below is "org.apache.ws.security.crypto".
  35.     // WSS4J 2.0.0 onwards will also accept the older ${PREFIX} value. The property values for the standard Merlin implementation are as follows:

  36.     public static final String PREFIX = "org.apache.wss4j.crypto.";
  37.     public static final String OLD_PREFIX = "org.apache.ws.security.crypto.";

  38.     // ${PREFIX}.provider - WSS4J specific provider used to create Crypto instances. Defaults to "org.apache.wss4j.common.crypto.Merlin".

  39.     public static final String PROPERTY_PROVIDER = OLD_PREFIX+"provider";
  40.     public static final String PROVIDER_DEFAULT = org.apache.wss4j.common.crypto.Merlin.class.getName();
  41.     public static final String OLD_PROVIDER_DEFAULT = "org.apache.ws.security.components.crypto.Merlin";
  42.     public static final String PROVIDER_GOVWAY = org.openspcoop2.security.keystore.MerlinProvider.class.getName();
  43.     public static final String OLD_PROVIDER_GOVWAY = "org.openspcoop2.security.keystore.Merlin";

  44.     // ${PREFIX}.merlin.x509crl.file - The location of an (X509) CRL file to use.

  45.     public static final String PROPERTY_CRL = Merlin.OLD_PREFIX+Merlin.X509_CRL_FILE;
  46.     public static final String PROPERTY_CRL_VALIDATE_ONLY_END_ENTITY = Merlin.OLD_PREFIX+MerlinProvider.X509_CRL_FILE_VALIDATE_ONLY_END_ENTITY;

  47.    
  48.     // Proprietà che permette di fornire la request info di govway

  49.     public static final String PROPERTY_REQUEST_INFO = "requestInfo";
  50.    
  51.    

  52.     // *** Merlin Keystore Properties ***

  53.     public static final String KEYSTORE = "keystore";

  54.     // ${PREFIX}.merlin.keystore.provider - The provider used to load keystores. Defaults to installed provider.

  55.     public static final String PROPERTY_KEYSTORE_PROVIDER = Merlin.OLD_PREFIX+Merlin.CRYPTO_KEYSTORE_PROVIDER;

  56.     //  ${PREFIX}.merlin.cert.provider - The provider used to load certificates. Defaults to keystore provider.

  57.     public static final String PROPERTY_CERT_PROVIDER = Merlin.OLD_PREFIX+Merlin.CRYPTO_CERT_PROVIDER;

  58.     //  ${PREFIX}.merlin.keystore.file - The location of the keystore

  59.     public static final String PROPERTY_KEYSTORE_PATH = Merlin.OLD_PREFIX+Merlin.OLD_KEYSTORE_FILE; // vecchio modalita' utilizzata in 1.6.x
  60.     public static final String PROPERTY_KEYSTORE_FILE = Merlin.OLD_PREFIX+Merlin.KEYSTORE_FILE;

  61.     //  ${PREFIX}.merlin.keystore.file.byok - The byok policy of the keystore

  62.     public static final String PROPERTY_KEYSTORE_PATH_BYOK = Merlin.OLD_PREFIX+Merlin.OLD_KEYSTORE_FILE+MerlinProvider.SUFFIX_BYOK; // vecchio modalita' utilizzata in 1.6.x
  63.     public static final String PROPERTY_KEYSTORE_FILE_BYOK = Merlin.OLD_PREFIX+Merlin.KEYSTORE_FILE+MerlinProvider.SUFFIX_BYOK;
  64.    
  65.     //  ${PREFIX}.merlin.keystore.password - The password used to load the keystore. Default value is "security".

  66.     public static final String PROPERTY_KEYSTORE_PASSWORD = Merlin.OLD_PREFIX+Merlin.KEYSTORE_PASSWORD;

  67.     //  ${PREFIX}.merlin.keystore.type - Type of keystore. Defaults to: java.security.KeyStore.getDefaultType())

  68.     public static final String PROPERTY_KEYSTORE_TYPE = Merlin.OLD_PREFIX+Merlin.KEYSTORE_TYPE;

  69.     //  ${PREFIX}.merlin.keystore.alias - The default keystore alias to use, if none is specified.

  70.     public static final String PROPERTY_KEYSTORE_ALIAS = Merlin.OLD_PREFIX+Merlin.KEYSTORE_ALIAS;

  71.     //  ${PREFIX}.merlin.keystore.private.password - The default password used to load the private key.

  72.     public static final String PROPERTY_KEYSTORE_PRIVATE_PASSWORD = Merlin.OLD_PREFIX+Merlin.KEYSTORE_PRIVATE_PASSWORD;

  73.     // Proprietà che permette di fornire direttamente un keystore utilizzando l'implementazione del PROPERTY_PROVIDER di govway

  74.     public static final String PROPERTY_KEYSTORE_ARCHIVE = Merlin.OLD_PREFIX+KEYSTORE;


  75.     // *** Merlin Truststore Properties ***

  76.     public static final String TRUSTSTORE = "truststore";

  77.     // ${PREFIX}.merlin.load.cacerts - Whether or not to load the CA certs in ${java.home}/lib/security/cacerts (default is false)

  78.     public static final String PROPERTY_LOAD_CA_CERTS = Merlin.OLD_PREFIX+Merlin.LOAD_CA_CERTS;

  79.     // ${PREFIX}.merlin.truststore.file - The location of the truststore
  80.    
  81.     public static final String PROPERTY_TRUSTSTORE_PATH = Merlin.OLD_PREFIX+Merlin.TRUSTSTORE_FILE;

  82.     // ${PREFIX}.merlin.truststore.password - The truststore password. Defaults to "changeit".
  83.    
  84.     public static final String PROPERTY_TRUSTSTORE_PASSWORD = Merlin.OLD_PREFIX+Merlin.TRUSTSTORE_PASSWORD;

  85.     // ${PREFIX}.merlin.truststore.type - The truststore type. Defaults to: java.security.KeyStore.getDefaultType().

  86.     public static final String PROPERTY_TRUSTSTORE_TYPE = Merlin.OLD_PREFIX+Merlin.TRUSTSTORE_TYPE;
  87.    
  88.     // ${PREFIX}.merlin.truststore.provider - WSS4J 2.1.5 The provider used to load truststores.
  89.     // By default it’s the same as the keystore provider. Set to an empty value to force use of the JRE’s default provider.

  90.     public static final String PROPERTY_TRUSTSTORE_PROVIDER = Merlin.OLD_PREFIX+Merlin.TRUSTSTORE_PROVIDER;

  91.     // Proprietà che permette di fornire direttamente un truststore utilizzando l'implementazione del PROPERTY_PROVIDER di govway
  92.        
  93.     public static final String PROPERTY_TRUSTSTORE_ARCHIVE = Merlin.OLD_PREFIX+TRUSTSTORE;

  94. }