/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: SecurityAssertion.java,v 1.3 2009/10/01 18:42:07 mallas Exp $
*
*/
/**
* The <code>SecurityAssertion</code> class provides an extension to
* <code>Assertion</code> class to support <code>ID-WSF</code>
* <code>ResourceAccessStatement</code> and
* <code>SessionContextStatement</code>.
*
* @supported.all.api
*/
/**
* This constructor creates a <code>SecurityAssertion</code> object
* from a DOM Element.
*
* @param assertionElement A <code>org.w3c.dom.Element</code> representing
* DOM tree for <code>Assertion</code> object
* @throws SAMLException if it could not process the Element properly,
* implying that there is an error in the sender or in the
* element definition.
*/
throws SAMLException {
}
/**
* Constructs <code>SecurityAssertion</code> object with the
* <code>assertionID</code>, the issuer, time when assertion issued
* and a <code>Set</code> of <code>Statement</code>(s) in the assertion.
*
* @param assertionID <code>assertionID</code> attribute contained within
* this <code>Assertion</code> if null, an <code>assertionID</code>
* is generated internally.
* @param issuer String representing the issuer of this assertion.
* @param issueInstant time instant of the issue. It has type
* <code>dateTime</code> which is built in to the W3C XML Schema
* Types specification.if null, current time is used.
* @param statements Set of <code>Statement</code> objects within this
* <code>Assertion</code>. It could be of type
* <code>AuthenticationStatement</code>,
* <code>AuthorizationDecisionStatement</code> and
* <code>AttributeStatement</code>. Each Assertion can have multiple
* type of statements in it.
* @throws SAMLException issuer is null or the size of statements is 0.
*/
}
/**
* Constructs <code>SecurityAssertion</code> object with the
* <code>assertionID</code>, the issuer, time when assertion issued, the
* conditions when creating a new assertion and a <code>Set</code> of
* <code>Statement</code>(s) in the assertion.
*
* @param assertionID String representing <code>AssertionID</code>
* contained within this <code>Assertion</code> if null its generated
* internally.
* @param issuer String representing the issuer of this assertion.
* @param issueInstant time instant of the issue. It has type
* <code>dateTime</code> which is built in to the W3C XML
* Schema Types specification. if null current time is used.
* @param conditions <code>Conditions</code> under which the this
* <code>Assertion</code> is valid.
* @param statements Set of <code>Statement</code> objects within this
* <code>Assertion</code>. It could be of type
* <code>AuthenticationStatement</code>,
* <code>AuthorizationDecisionStatement</code> and
* <code>AttributeStatement</code>. Each Assertion can have multiple
* type of statements in it.
* @throws SAMLException issuer is null or the size of statements is 0.
*/
throws SAMLException {
}
/**
* Constructs <code>SecurityAssertion</code> object with the
* <code>assertionID</code>, the issuer, time when assertion issued,
* the conditions when creating a new assertion, <code>Advice</code>
* applicable to this <code>Assertion</code> and a <code>Set</code> of
* <code>Statement</code>(s) in the assertion.
*
* @param assertionID <code>AssertionID</code> object contained within this
* <code>Assertion</code> if null its generated internally.
* @param issuer String representing the issuer of this assertion.
* @param issueInstant time instant of the issue. It has type
* <code>dateTime</code> which is built in to the W3C XML Schema
* Types specification. if null current time is used.
* @param conditions <code>Conditions</code> under which the this
* <code>Assertion</code> is valid.
* @param advice <code>Advice</code> applicable for this
* <code>Assertion</code>.
* @param statements Set of <code>Statement</code> objects within this
* <code>Assertion</code>. It could be of type
* <code>AuthenticationStatement</code>,
* <code>AuthorizationDecisionStatement</code> and
* <code>AttributeStatement</code>. Each Assertion can have multiple
* type of statements in it.
* @throws SAMLException issuer is null or the size of statements is 0.
*/
advice, statements);
}
/**
* Sets the value of the certificate alias.
*
* @param certAlias the certificate alias.
*/
}
/**
* Return whether the signature is valid.
*
* @return true if the signature is valid.
*/
public boolean isSignatureValid() {
if (signed & ! validationDone) {
try {
} catch (Exception e) {
"SecurityAssertion.isSignatureValid: "+
" signature validation exception", e);
}
valid = false;
}
" valid = " + valid);
}
validationDone = true;
}
return valid;
}
/**
* Determines if the <code>SecurityAssertion</code> contains SAML Bearer
* confirmation method.
*
* @return true if the <code>SecurityAssertion</code> contains SAML Bearer
* confirmation.
*/
public boolean isBearer() {
return false;
}
if (!(statement instanceof SubjectStatement)) {
continue;
}
continue;
}
continue;
}
continue;
}
return true;
}
}
return false;
}
/**
* Determines if the <code>SecurityAssertion</code> contains SAML Bearer
* confirmation method. If it is, return its Subject. Otherwise, return
* null.
*
* @return Subject if the <code>SecurityAssertion</code> contains SAML
* Bearer confirmation.
*/
return null;
}
if (!(statement instanceof SubjectStatement)) {
continue;
}
continue;
}
continue;
}
continue;
}
return subject;
}
}
return null;
}
/**
* Create a String representation of the element.
* @return A string containing the valid XML for this element.
* By default name space name is prepended to the element name
* example <code><saml:Assertion></code>.
*
* @return the String representation of this element.
*/
// call toString() with includeNS true by default and declareNS false
return this.toString(true, false);
}
/**
* Creates a String representation of the <code><Assertion></code>
* element.
*
* @param includeNS if true prepends all elements by their Namespace
* name example <code><saml:Assertion></code>;
* @param declareNS if true includes the namespace within the generated
* XML.
* @return A string containing the valid XML for this element.
*/
return xmlString;
}
if (declareNS) {
}
if (includeNS) {
appendNS="saml:";
}
if (_issueInstant != null) {
}
if (_conditions != null) {
}
}
while (i.hasNext()) {
}
}
}
throws SAMLException {
if (super.processUnknownElement(element)) {
"SecurityAssertion.processUnknownElement: " +
"super returns true");
}
return true;
}
"SecurityAssertion.processUnknownElement: " +
"super returns false");
}
return true;
}
return true;
}
return false;
}
protected int getMinAssertionMinorVersion() {
return sc.ASSERTION_MINOR_VERSION;
}
protected int getMaxAssertionMinorVersion() {
return sc.ASSERTION_MINOR_VERSION;
}
/**
* Add the <code>Assertion</code> to the Document Element.
*
* @param headerE the element to be updated.
* @throws Exception if there is an error.
*/
}
}