Class SignServiceIntegrationServiceInitializer

java.lang.Object
se.idsec.signservice.integration.SignServiceIntegrationServiceInitializer

public class SignServiceIntegrationServiceInitializer extends Object
The SignService Integration library uses Apache xmlsec and OpenSAML. These libraries need to be initialized before they can be used. This class provides the initialize() and initialize(SecurityConfiguration) methods for initializing of these libraries.

Note: Make sure to initialize the library the first thing you do in your application. Below an example of how a Spring Boot application best initializes the library is presented:

 @Component
 @Order(Ordered.HIGHEST_PRECEDENCE)
 public class SignServiceIntegrationInitComponent {

   public SignServiceIntegrationInitComponent() throws Exception {
     SignServiceIntegrationServiceInitializer.initialize(
         new SwedishEidSecurityConfiguration());
   }
 }
 
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Initializes Apache xmlsec and OpenSAML with default algorithm settings.
    static void
    initialize(se.swedenconnect.opensaml.xmlsec.config.SecurityConfiguration securityConfiguration)
    Initializes Apache and OpenSAML with the algorithm settings provided by the supplied OpenSAML security settings.
    static boolean
    Predicate that tells if the SignService Integration library has been initialized.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • initialize

      public static void initialize() throws Exception
      Initializes Apache xmlsec and OpenSAML with default algorithm settings.
      Throws:
      Exception - for initialization errors
    • initialize

      public static void initialize(se.swedenconnect.opensaml.xmlsec.config.SecurityConfiguration securityConfiguration) throws Exception
      Initializes Apache and OpenSAML with the algorithm settings provided by the supplied OpenSAML security settings. Possible security settings consists of:
      • DefaultSecurityConfiguration - OpenSAML's default configuration.
      • SAML2IntSecurityConfiguration - Security defaults according to Kantara's SAML2Int specification.
      • SwedishEidSecurityConfiguration - Security defaults according to the Swedish eID Framework, see https://docs.swedenconnect.se.
      Parameters:
      securityConfiguration - the OpenSAML security configuration to apply
      Throws:
      Exception - for initialization errors
    • isInitialized

      public static boolean isInitialized()
      Predicate that tells if the SignService Integration library has been initialized.
      Returns:
      true if the library has been initialized, and false otherwise