/**
* 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: Assertion.java,v 1.3 2008/06/25 05:47:31 qcheng Exp $
*
*/
/**
*This object stands for <code>Assertion</code> element. An Assertion is a
*package of information that supplies one or more <code>Statement</code> made
*by an issuer. There are three kinds of assertionsL Authentication,
*AuthorizationDecision and Attribute assertion.
*@supported.all.api
*/
/**
* Returns whether the signature on the object is valid or not.
* @return true if the signature on the object is valid; false otherwise.
*/
public boolean isSignatureValid() {
if (signed & ! validationDone) {
validationDone = true;
}
return valid;
}
/**
* Signs the Assertion.
* @exception SAMLException If it could not sign the Assertion.
*/
"com.sun.identity.saml.xmlsig.certalias");
}
/**
* Signs the Assertion.
*
* @param certAlias certification Alias used to sign Assertion.
* @exception SAMLException if it could not sign the Assertion.
*/
if (signed) {
+ "already signed.");
}
throw new SAMLException(
}
+ "this site's cert alias.");
}
throw new SAMLResponderException(
}
// this block is used for later return of signature element by
// getSignature() method
} else {
// sign with SAML 1.1 spec & include cert in KeyInfo
}
signed = true;
}
/**
*Default constructor
*Declaring protected to enable extensibility
*/
protected Assertion() {
super();
}
/**
* Contructs <code>Assertion</code> object from a
* block of existing XML that has already been built into a DOM.
*
* @param assertionElement A <code>org.w3c.dom.Element</code> representing
* DOM tree for <code>Assertion</code> object
* @exception 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
{
}
throws SAMLException
{
}
}
("nullInput")) ;
}
}
}
}
throw new SAMLRequesterException(
} else {
}
if (signsSize == 1) {
// delay the signature validation till user call isSignatureValid()
signed = true;
validationDone = false;
} else if (signsSize != 0) {
+ " one Signature element.");
}
throw new SAMLRequesterException(
}
}
throw new SAMLRequesterException(
"MajorVersion");
}
else {
int ver = 0;
try {
} catch ( NumberFormatException ne ) {
"Assertion: invalid integer in MajorVersion", ne);
throw new SAMLRequesterException(
"MajorVersion");
}
"Assertion: MajorVersion too low");
}
throw new SAMLVersionMismatchException(
+ ":"+"MajorVersion");
"Assertion: MajorVersion too high");
}
throw new SAMLVersionMismatchException(
+":"+"MajorVersion");
}
}
}
throw new SAMLRequesterException(
+":"+"MinorVersion");
}
else {
int ver = 0;
try {
} catch ( NumberFormatException ne ) {
"Assertion: invalid integer in MinorVersion", ne);
throw new SAMLRequesterException(
+":"+"MinorVersion");
}
"minMinorVersion = " + getMinAssertionMinorVersion() +
", maxMinorVersion = " + getMaxAssertionMinorVersion());
}
if (ver < getMinAssertionMinorVersion()) {
}
throw new SAMLVersionMismatchException(
} else if (ver > getMaxAssertionMinorVersion()) {
}
throw new SAMLVersionMismatchException(
+":"+"MinorVersion");
} else {
}
}
throw new SAMLRequesterException(
+":"+"AssertionID");
}
else {
}
}
throw new SAMLRequesterException(
+":"+"IssueInstant");
} else {
try {
} catch (ParseException pe) {
"Assertion: could not parse IssueInstant", pe);
}
}
for (int n=0; n<length; n++) {
}
}
}
}
"Assertion: invalid element in Assertion");
}
throw new SAMLRequesterException("invalidElement");
}
}
if (_statements.isEmpty()) {
"Assertion: mandatory statement missing");
}
throw new SAMLRequesterException("missingStatement");
}
}
/**
* Contructs <code>Assertion</code> object and populate the data members:
* <code>assertionID</code>, the issuer, time when assertion issued and a
* set 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 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.
* @exception SAMLException if there is an error in processing input.
*/
{
}
/**
* Contructs <code>Assertion</code> object and populate the data members:
* the <code>assertionID</code>, the issuer, time when assertion issued,
* the conditions when creating a new assertion and a set of
* <code>Statement</code>(s) in the assertion.
*
* @param assertionID <code>AssertionID</code> contained within this
* <code>Assertion</code> if null its generated internally.
* @param issuer 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.
* @exception SAMLException if there is an error in processing input.
*/
throws SAMLException
{
}
/**
* Contructs <code>Assertion</code> object and populate the data members:
* the <code>ssertionID</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 set 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 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.
* @exception SAMLException if there is an error in processing input.
*/
{
}
/**
* Returns the advice of an assertion.
*
* @return <code>Advice</code> object containing advice information of the
* assertion.
*/
}
throws SAMLException {
return new Advice(adviceElement);
}
protected AuthorizationDecisionStatementBase
throws SAMLException {
return new AuthorizationDecisionStatement(authDecisionElement);
}
protected AuthenticationStatement
throws SAMLException {
return new AuthenticationStatement(authenticationElement);
}
protected AttributeStatement
throws SAMLException {
return new AttributeStatement(attributeElement);
}
protected AssertionIDReference
throws SAMLException {
return new AssertionIDReference(assertionIDRefElement);
}
protected AssertionIDReference
return new AssertionIDReference(assertionID);
}
protected Conditions
return new Conditions(conditionsElement);
}
throws SAMLException
{
}
return false;
}
protected int getMinAssertionMinorVersion() {
return sc.ASSERTION_MINOR_VERSION_ZERO;
}
protected int getMaxAssertionMinorVersion() {
return sc.ASSERTION_MINOR_VERSION_ONE;
}
}