Class WSSec

java.lang.Object
org.apache.wss4j.stax.setup.WSSec

public class WSSec extends Object
This is the central class of the streaming webservice-security framework.
Instances of the inbound and outbound security streams can be retrieved with this class.
  • Constructor Details

    • WSSec

      public WSSec()
  • Method Details

    • init

      public static void init()
    • getOutboundWSSec

      public static OutboundWSSec getOutboundWSSec(WSSSecurityProperties securityProperties) throws WSSecurityException
      Creates and configures an outbound streaming security engine
      Parameters:
      securityProperties - The user-defined security configuration
      Returns:
      A new OutboundWSSec
      Throws:
      WSSecurityException - if the initialisation failed
      WSSConfigurationException - if the configuration is invalid
    • getInboundWSSec

      public static InboundWSSec getInboundWSSec(WSSSecurityProperties securityProperties) throws WSSecurityException
      Creates and configures an inbound streaming security engine
      Parameters:
      securityProperties - The user-defined security configuration
      Returns:
      A new InboundWSSec
      Throws:
      WSSecurityException - if the initialisation failed
      WSSConfigurationException - if the configuration is invalid
    • getInboundWSSec

      public static InboundWSSec getInboundWSSec(WSSSecurityProperties securityProperties, boolean initiator) throws WSSecurityException
      Creates and configures an inbound streaming security engine
      Parameters:
      securityProperties - The user-defined security configuration
      initiator - Whether we are the message initiator or not
      Returns:
      A new InboundWSSec
      Throws:
      WSSecurityException - if the initialisation failed
      WSSConfigurationException - if the configuration is invalid
    • getInboundWSSec

      public static InboundWSSec getInboundWSSec(WSSSecurityProperties securityProperties, boolean initiator, boolean returnSecurityError) throws WSSecurityException
      Creates and configures an inbound streaming security engine
      Parameters:
      securityProperties - The user-defined security configuration
      initiator - Whether we are the message initiator or not
      returnSecurityError - Whether to return the underlying security error or not
      Returns:
      A new InboundWSSec
      Throws:
      WSSecurityException - if the initialisation failed
      WSSConfigurationException - if the configuration is invalid
    • validateAndApplyDefaultsToOutboundSecurityProperties

      public static WSSSecurityProperties validateAndApplyDefaultsToOutboundSecurityProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException
      Validates the user supplied configuration and applies default values as apropriate for the outbound security engine
      Parameters:
      securityProperties - The configuration to validate
      Returns:
      The validated configuration
      Throws:
      WSSConfigurationException - if the configuration is invalid
    • validateAndApplyDefaultsToInboundSecurityProperties

      public static WSSSecurityProperties validateAndApplyDefaultsToInboundSecurityProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException
      Validates the user supplied configuration and applies default values as apropriate for the inbound security engine
      Parameters:
      securityProperties - The configuration to validate
      Returns:
      The validated configuration
      Throws:
      WSSConfigurationException - if the configuration is invalid
    • loadWSSecuritySchemas

      public static Schema loadWSSecuritySchemas() throws SAXException
      Throws:
      SAXException