Class AssertionArtifact

  • Direct Known Subclasses:
    FSAssertionArtifact

    public class AssertionArtifact
    extends Object
    This class represents the AssertionArtifact element in SAML protocol schema. Current implementation supports TYPE 1 artifact only. Other type of artifact can be supported by extending this class.
    • Field Detail

      • artifact

        protected String artifact
        This value specifies the assertion artifact as a string.
      • assertionHandle

        protected String assertionHandle
      • sourceID

        protected String sourceID
      • typeCode

        protected byte[] typeCode
    • Constructor Detail

      • AssertionArtifact

        protected AssertionArtifact()
        This is the default constructor of assertion artifact.
      • AssertionArtifact

        public AssertionArtifact​(String theArtifact)
                          throws SAMLException
        This constructor is used to construct an assertion artifact.
        Parameters:
        theArtifact - is the string that is generated by a provider.
        Throws:
        SAMLException - if an error occurs.
      • AssertionArtifact

        public AssertionArtifact​(String id,
                                 String handle)
                          throws SAMLException
        This constructor will be used at the sender side to create a new AssertionArtifact.
        Parameters:
        id - A string that represents the sourceID.
        handle - A string that represents the assertionHandle.
        Throws:
        SAMLException - if wrong input or could not encode the artifact.
    • Method Detail

      • getAssertionArtifact

        public String getAssertionArtifact()
        Gets the artifact.
        Returns:
        the string format of the artifact. It's base64 encoded.
      • getSourceID

        public String getSourceID()
        Returns the SourceID of the artifact.
        Returns:
        The SourceID of the artifact.
      • getAssertionHandle

        public String getAssertionHandle()
        Gets the AssertionHandle of the artifact. The result will be decoded.
        Returns:
        The AssertionHandle of the artifact.
      • getTypeCode

        public byte[] getTypeCode()
        Gets the typeCode of the artifact.
        Returns:
        The byte array of the TypeCode for the artifact.
      • toString

        public String toString()
        Translates the AssertionArtifact to an XML document String based on the SAML schema.
        Overrides:
        toString in class Object
        Returns:
        An XML String representing the AssertionArtifact.
      • toString

        public String toString​(boolean includeNS,
                               boolean declareNS)
        Creates a String representation of the <samlp:AssertionArtifact> element.
        Parameters:
        includeNS - Determines whether or not the namespace qualifier is prepended to the Element when converted
        declareNS - Determines whether or not the namespace is declared within the Element.
        Returns:
        A string containing the valid XML for this element