Class SAMLAuthContext

java.lang.Object
se.swedenconnect.cert.extensions.data.saci.AbstractDomData
se.swedenconnect.cert.extensions.data.saci.SAMLAuthContext

public class SAMLAuthContext extends AbstractDomData
DOM based implementation of SAMLAuthContext for the AuhtnContext extension RFC 7773
  • Constructor Details

    • SAMLAuthContext

      public SAMLAuthContext(boolean strictMode)
      Creates a new empty SAMLAuthContext object
      Parameters:
      strictMode - true to strictly enforce content requirement rules
    • SAMLAuthContext

      public SAMLAuthContext(Document document, boolean strictMode) throws CertificateException
      Creates a SAMLAuthContext object from an XML document
      Parameters:
      document - document holding SAMLAuthContext data
      strictMode - true to strictly enforce content requirement rules
      Throws:
      CertificateException - content validation errors
    • SAMLAuthContext

      public SAMLAuthContext(String xml, boolean strictMode) throws IOException, ParserConfigurationException, SAXException, CertificateException
      Creates a SAMLAuthContext object from XML text
      Parameters:
      xml - xml text source
      strictMode - true to strictly enforce content requirement rules
      Throws:
      IOException - errors parsing xml content
      ParserConfigurationException - errors parsing xml content
      SAXException - errors parsing xml content
      CertificateException - content validation errors
  • Method Details

    • validate

      protected void validate() throws CertificateException
      Validates the data fields of this object to assert that it meets basic content requirements
      Specified by:
      validate in class AbstractDomData
      Throws:
      CertificateException - validation errors
    • getDocument

      public Document getDocument()
      Builds a new document for SAMLAuthContext
      Returns:
      SAMLAuthContext XML document
    • getElement

      protected Element getElement(Document owner)
      Gets a DOM element from the element data fields
      Specified by:
      getElement in class AbstractDomData
      Parameters:
      owner - the document this element shall belong to
      Returns:
      DOM element populated with the field data of this object
    • setValuesFromElement

      protected void setValuesFromElement(Element element) throws CertificateException
      Creates an instance of this elements data from a DOM element
      Specified by:
      setValuesFromElement in class AbstractDomData
      Parameters:
      element - xml element providing content data
      Throws:
      CertificateException - content validation error