Class SettingsBuilder

java.lang.Object
org.codelibs.saml2.core.settings.SettingsBuilder

public class SettingsBuilder extends Object
SettingsBuilder class of Java Toolkit. A class that implements the settings builder
  • Field Details

  • Constructor Details

    • SettingsBuilder

      public SettingsBuilder()
  • Method Details

    • fromFile

      public SettingsBuilder fromFile(String propFileName)
      Load settings from the file
      Parameters:
      propFileName - OneLogin_Saml2_Settings
      Returns:
      the SettingsBuilder object with the settings loaded from the file
    • fromFile

      public SettingsBuilder fromFile(String propFileName, KeyStoreSettings keyStoreSetting)
      Load settings from the file
      Parameters:
      propFileName - OneLogin_Saml2_Settings
      keyStoreSetting - KeyStore which have the Private/Public keys
      Returns:
      the SettingsBuilder object with the settings loaded from the file
    • fromProperties

      public SettingsBuilder fromProperties(Properties prop)
      Loads the settings from a properties object
      Parameters:
      prop - contains the properties
      Returns:
      the SettingsBuilder object with the settings loaded from the prop object
    • fromValues

      public SettingsBuilder fromValues(Map<String,Object> samlData)
      Loads the settings from mapped values.
      Parameters:
      samlData - Mapped values.
      Returns:
      the SettingsBuilder object with the settings loaded from the prop object
    • fromValues

      public SettingsBuilder fromValues(Map<String,Object> samlData, KeyStoreSettings keyStoreSetting)
      Loads the settings from mapped values and KeyStore settings.
      Parameters:
      samlData - Mapped values.
      keyStoreSetting - KeyStore model
      Returns:
      the SettingsBuilder object with the settings loaded from the prop object
    • build

      public Saml2Settings build()
      Builds the Saml2Settings object. Read the Properties object and set all the SAML settings
      Returns:
      the Saml2Settings object with all the SAML settings loaded
    • build

      public Saml2Settings build(Saml2Settings saml2Setting)
      Builds the Saml2Settings object. Read the Properties object and set all the SAML settings
      Parameters:
      saml2Setting - an existing Saml2Settings
      Returns:
      the Saml2Settings object with all the SAML settings loaded
    • getPrivateKeyFromKeyStore

      protected PrivateKey getPrivateKeyFromKeyStore(KeyStore keyStore, String alias, String password)
    • getCertificateFromKeyStore

      protected X509Certificate getCertificateFromKeyStore(KeyStore keyStore, String alias, String password)
    • loadCertificateFromProp

      protected X509Certificate loadCertificateFromProp(Object propValue)
      Loads a property of the type X509Certificate from the property value
      Parameters:
      propValue - the property value
      Returns:
      the X509Certificate object
    • loadCertificateFromProp

      protected X509Certificate loadCertificateFromProp(String propertyKey)
      Loads a property of the type X509Certificate from the Properties object
      Parameters:
      propertyKey - the property name
      Returns:
      the X509Certificate object
    • loadPrivateKeyFromProp

      protected PrivateKey loadPrivateKeyFromProp(String propertyKey)
      Loads a property of the type PrivateKey from the Properties object
      Parameters:
      propertyKey - the property name
      Returns:
      the PrivateKey object