Ejemplo n.º 1
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;
 }
Ejemplo n.º 2
0
 /*
 ****************************************************************************
 * setAttrStatement()
 ****************************************************************************
 */
 /**
 * Sets the attribute statement element of the assertion.  Only one
 * attribute statement is supported per assertion.
 */
 public void setAttrStatement(AttributeStatement oVal)
 {
     moAttrStatement = oVal;
 }
Ejemplo n.º 3
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);
                }
            }
            }
        }