Class AS4CryptoFactoryProperties

java.lang.Object
com.helger.phase4.crypto.AbstractAS4CryptoFactory
com.helger.phase4.crypto.AS4CryptoFactoryProperties
All Implemented Interfaces:
IAS4CryptoFactory

@Immutable @Deprecated(forRemoval=true, since="3.0.0") public class AS4CryptoFactoryProperties extends AbstractAS4CryptoFactory
Deprecated, for removal: This API element is subject to removal in a future version.
Use AS4CryptoFactoryConfiguration instead. This class will be removed in the next major release.
phase4 crypto factory settings based on AS4CryptoProperties
Since:
0.11.0
Author:
Philip Helger
  • Constructor Details

    • AS4CryptoFactoryProperties

      public AS4CryptoFactoryProperties(@Nonnull AS4CryptoProperties aCryptoProps)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This constructor takes the crypto properties directly. See the AbstractAS4Client for a usage example.
      Parameters:
      aCryptoProps - The properties to be used. May not be null. Note: the object is cloned internally to avoid outside modification.
  • Method Details

    • getDefaultInstance

      @Nonnull public static AS4CryptoFactoryProperties getDefaultInstance()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The default instance, created by reading the properties from the configuration sources.
      Since:
      0.11.0
    • cryptoProperties

      @Nonnull @ReturnsMutableObject public final AS4CryptoProperties cryptoProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The crypto properties as created in the constructor. Never null.
    • createCrypto

      @Nonnull public static org.apache.wss4j.common.crypto.Crypto createCrypto(@Nonnull AS4CryptoProperties aCryptoProps)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Helper method to create a WSS4J Crypto instance based on the provided crypto properties.
      Parameters:
      aCryptoProps - The crypto properties to use. May not be null.
      Returns:
      A new Crypto object.
      Throws:
      IllegalStateException - if creation failed
    • getCrypto

      @Nonnull public final org.apache.wss4j.common.crypto.Crypto getCrypto(@Nonnull ECryptoMode eCryptoMode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Lazily create a Crypto instance using the properties from cryptoProperties().
      Parameters:
      eCryptoMode - The crypto mode to use. Never null.
      Returns:
      A WSS4J Crypto instance and never null.
    • getKeyStore

      @Nullable public final KeyStore getKeyStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The underlying key store, or null if none is available (the reasons depend on the used implementation).
    • getKeyAlias

      @Nullable public final String getKeyAlias()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The keystore alias to resolve the private key entry. May be null.
    • getKeyPasswordPerAliasCharArray

      @Nullable public char[] getKeyPasswordPerAliasCharArray(@Nullable String sSearchKeyAlias)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: IAS4CryptoFactory
      Returns the password for the key represented by the provided alias.
      Parameters:
      sSearchKeyAlias - The alias of the key whose password is to be retrieved.
      Returns:
      The password for the key represented by the provided by the alias or null if the factory doesn't have a password for the key.
    • getTrustStore

      @Nullable public final KeyStore getTrustStore()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      The trust store to be used or null if none is configured.
    • readCryptoPropertiesFromFile

      @Nonnull public static AS4CryptoProperties readCryptoPropertiesFromFile(@Nullable String sCryptoPropertiesPath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Read crypto properties from the specified file path.
      Parameters:
      sCryptoPropertiesPath - The class path to read the properties file from. It is null or empty, than the default file "crypto.properties" is read.
      Returns:
      Never null.