Class DSSSecurityProvider

java.lang.Object
eu.europa.esig.dss.spi.DSSSecurityProvider

public final class DSSSecurityProvider extends Object
The default security provider.

In order to initialize the providers within the system, please call the #initSystemProviders method. NOTE: once #initSystemProviders method called, all the primary and alternative security providers will be added within the system's Security providers list. They won't be removed automatically, if the security providers configuration is changed within the class.

  • Method Details

    • getSecurityProvider

      public static Provider getSecurityProvider()
      Gets the provider
      Returns:
      Provider
    • getSecurityProviderName

      public static String getSecurityProviderName()
      Gets the security provider name
      Returns:
      String
    • setSecurityProvider

      public static void setSecurityProvider(Provider provider)
      Sets the security provider
      Parameters:
      provider - Provider
    • setSecurityProvider

      public static void setSecurityProvider(String providerName) throws SecurityException
      Sets the security provider by the given Provider name
      Parameters:
      providerName - String
      Throws:
      SecurityException - if unable to instantiate the Provider by the given name
    • getAlternativeSecurityProviders

      public static Provider[] getAlternativeSecurityProviders()
      Gets an array of alternative security providers
      Returns:
      an array of Providers
    • getAlternativeSecurityProviderNames

      public static String[] getAlternativeSecurityProviderNames()
      Gets an array of alternative security provider names
      Returns:
      an array of Strings
    • setAlternativeSecurityProviders

      public static void setAlternativeSecurityProviders(Provider... alternativeSecurityProviders)
      Sets alternative security providers. In case the primary security providers fails on operation, DSS will load the alternative security providers in provided order, until the first provider succeeding the operation
      Parameters:
      alternativeSecurityProviders - array of Providers
    • setAlternativeSecurityProviders

      public static void setAlternativeSecurityProviders(String... alternativeSecurityProviderNames) throws SecurityException
      Sets alternative security providers by their names. In case the primary security providers fails on operation, DSS will load the alternative security providers in provided order, until the first provider succeeding the operation
      Parameters:
      alternativeSecurityProviderNames - array of Strings
      Throws:
      SecurityException - if unable to instantiate the Provider by the given name
    • initSystemProviders

      public static void initSystemProviders()
      This method adds the configured within the java.security.Security providers' list. This method shall be called before the use of the security providers is required by the code. NOTE: once called, all the primary and alternative security providers will be added within the system's Security providers list. They won't be removed automatically, if the security providers configuration is changed within the class.