Пример #1
0
    } // reset()

    /*
    ****************************************************************************
    * fromDOM()
    ****************************************************************************
    */ /**
    *  This method populates the obj from DOM.  It does not keep a
    * copy of the DOM around.  Whitespace information is lost in this process.
    */
    public void fromDOM(Element oElem)
    {
        reset();

        for (
            Node oChild = DOMUtils.getFirstChildElement(oElem); oChild != null;
            oChild = DOMUtils.getNextSiblingElement(oChild))
        {
            if (oChild.getLocalName().equals(Tags.TAG_NAMEID))
            {
                // only accept the first XRIAuthority
                if (moNameID == null)
                {
                    moNameID = new NameID((Element) oChild);
                }
            }
        }

    } // fromDOM()
Пример #2
0
 /*
 ****************************************************************************
 * setIssuer()
 ****************************************************************************
 */
 /**
 * Sets the issuer element of the assertion
 */
 public void setIssuer(NameID oIssuer)
 {
     moIssuer = oIssuer;
 }
Пример #3
0
 /*
 ****************************************************************************
 * reset()
 ****************************************************************************
 */
 /**
 * Resets the internal state of this obj
 */
 public void reset()
 {
     msXmlID = "";
     msIssueInstant = "";
     moElem = null;
     moIssuer = null;
     moSignature = null;
     moSubject = null;
     moConditions = null;
     moAttrStatement = null;
 }
Пример #4
0
        /*
        ****************************************************************************
        * fromDOM()
        ****************************************************************************
        */
        /**
        *  This method populates the obj from DOM.  It does not keep a
        * copy of the DOM around.  Whitespace information is lost in this process.
        */
        public void fromDOM(XmlElement oElem)
        {
            reset();

            // get the id attribute
            if (oElem.hasAttributeNS(null, Tags.ATTR_ID_CAP))
            {
            msXmlID = oElem.getAttributeNS(null, Tags.ATTR_ID_CAP);
            }

            if (oElem.hasAttributeNS(null, Tags.ATTR_ISSUEINSTANT))
            {
            msIssueInstant = oElem.getAttributeNS(null, Tags.ATTR_ISSUEINSTANT);
            }

            for (
            XmlNode oChild = oElem.FirstChild; oChild != null;
            oChild = oChild.NextSibling)
            {
            if (oChild.LocalName.Equals(Tags.TAG_ISSUER))
            {
                // only accept the first XRIAuthority
                if (moIssuer == null)
                {
                    moIssuer = new NameID((XmlElement) oChild);
                }
            }
            else if (oChild.LocalName.Equals(Tags.TAG_SIGNATURE))
            {
                // only accept the first XRIAuthority
                if (moSignature == null)
                {
                    try
                    {
                        XmlDocument oDoc = new XmlDocument();
                        XmlElement oChildCopy =
                            (XmlElement) oDoc.ImportNode(oChild, true);
                        moSignature = new XMLSignature(oChildCopy, null);
                    }
                    catch (Exception oEx)
                    {
                        soLog.Warn(
                            "Caught exception while parsing Signature", oEx);
                    }
                }
            }
            else if (oChild.LocalName.Equals(Tags.TAG_SUBJECT))
            {
                // only accept the first XRIAuthority
                if (moSubject == null)
                {
                    moSubject = new Subject((XmlElement) oChild);
                }
            }
            else if (oChild.LocalName.Equals(Tags.TAG_CONDITIONS))
            {
                // only accept the first XRIAuthority
                if (moConditions == null)
                {
                    moConditions = new Conditions((XmlElement) oChild);
                }
            }
            else if (oChild.LocalName.Equals(Tags.TAG_ATTRIBUTESTATEMENT))
            {
                // only accept the first XRIAuthority
                if (moAttrStatement == null)
                {
                    moAttrStatement = new AttributeStatement((XmlElement) oChild);
                }
            }
            }
        }
Пример #5
0
 /*
 ****************************************************************************
 * setNameID()
 ****************************************************************************
 */
 /**
 * Sets the nameid element
 */
 public void setNameID(NameID oVal)
 {
     moNameID = oVal;
 }
Пример #6
0
 /*
 ****************************************************************************
 * reset()
 ****************************************************************************
 */
 /**
 * Resets the internal state of this obj
 */
 public void reset()
 {
     moNameID = null;
 }
Пример #7
0
        /*
        ****************************************************************************
        * fromDOM()
        ****************************************************************************
        */
        /**
        *  This method populates the obj from DOM.  It does not keep a
        * copy of the DOM around.  Whitespace information is lost in this process.
        */
        public void fromDOM(XmlElement oElem)
        {
            reset();

            for (
            XmlNode oChild = oElem.FirstChild; oChild != null;
            oChild = oChild.NextSibling)
            {
            if (oChild.LocalName.Equals(Tags.TAG_NAMEID))
            {
                // only accept the first XRIAuthority
                if (moNameID == null)
                {
                    moNameID = new NameID((XmlElement) oChild);
                }
            }
            }
        }