001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: StatusResponse.java,v 1.2 2008/06/25 05:47:58 qcheng Exp $
026 *
027 */
028
029
030package com.sun.identity.saml2.protocol;
031
032import com.sun.identity.saml.xmlsig.XMLSignatureException;
033import com.sun.identity.saml2.assertion.Issuer;
034import com.sun.identity.saml2.common.SAML2Exception;
035import java.security.PublicKey;
036import java.security.Signature;
037import java.util.Date;
038import java.security.PrivateKey;
039import java.security.cert.X509Certificate;
040import com.sun.identity.saml2.xmlsig.SigManager;
041
042/**
043 * This class represents the <code>StatusResponseType</code> complex type in
044 * SAML protocol schema.
045 * All SAML responses are of types that are derived from the
046 * <code>StatusResponseType</code> complex type. This type defines common
047 * attributes and elements that are associated with all SAML responses.
048 *
049 * <pre>
050 * &lt;complexType name="StatusResponseType">
051 *   &lt;complexContent>
052 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
053 *       &lt;sequence>
054 *         &lt;element ref="{urn:oasis:names:tc:SAML:2.0:assertion}Issuer" minOccurs="0"/>
055 *         &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Signature" minOccurs="0"/>
056 *         &lt;element ref="{urn:oasis:names:tc:SAML:2.0:protocol}Extensions" minOccurs="0"/>
057 *         &lt;element ref="{urn:oasis:names:tc:SAML:2.0:protocol}Status"/>
058 *       &lt;/sequence>
059 *       &lt;attribute name="Consent" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
060 *       &lt;attribute name="Destination" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
061 *       &lt;attribute name="ID" use="required" type="{http://www.w3.org/2001/XMLSchema}ID" />
062 *       &lt;attribute name="InResponseTo" type="{http://www.w3.org/2001/XMLSchema}NCName" />
063 *       &lt;attribute name="IssueInstant" use="required" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
064 *       &lt;attribute name="Version" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
065 *     &lt;/restriction>
066 *   &lt;/complexContent>
067 * &lt;/complexType>
068 * </pre>
069 *
070 * @supported.all.api
071 */
072public interface StatusResponse {
073    
074    /**
075     * Returns the value of the version property.
076     *
077     * @return the value of the version property
078     * @see #setVersion(String)
079     */
080    public java.lang.String getVersion();
081    
082    /**
083     * Sets the value of the version property.
084     *
085     * @param value the value of the version property to be set
086     * @throws SAML2Exception if the object is immutable
087     * @see #getVersion
088     */
089    public void setVersion(java.lang.String value) throws SAML2Exception;
090    
091    /**
092     * Returns the value of the issueInstant property.
093     *
094     * @return the value of the issueInstant property
095     * @see #setIssueInstant(java.util.Date)
096     */
097    public java.util.Date getIssueInstant();
098    
099    /**
100     * Sets the value of the issueInstant property.
101     *
102     * @param value the value of the issueInstant property to be set
103     * @throws SAML2Exception if the object is immutable
104     * @see #getIssueInstant
105     */
106    public void setIssueInstant(java.util.Date value) throws SAML2Exception;
107    
108    /**
109     * Returns the value of the destination property.
110     *
111     * @return the value of the destination property
112     * @see #setDestination(String)
113     */
114    public java.lang.String getDestination();
115    
116    /**
117     * Sets the value of the destination property.
118     *
119     * @param value the value of the destination property to be set
120     * @throws SAML2Exception if the object is immutable
121     * @see #getDestination
122     */
123    public void setDestination(java.lang.String value) throws SAML2Exception;
124    
125    /**
126     * Returns the signature element, the <code>StatusResponse</code> contains
127     * as <code>String</code>.  A null value is returned if the 
128     * <code>StatusResponse</code> has no signature.
129     *
130     * @return <code>String</code> representation of the signature.
131     */
132    public String getSignature();
133    
134    /**
135     * Returns the value of the extensions property.
136     *
137     * @return the value of the extensions property
138     * @see #setExtensions(Extensions)
139     */
140    public com.sun.identity.saml2.protocol.Extensions getExtensions();
141    
142    /**
143     * Sets the value of the extensions property.
144     *
145     * @param value the value of the extensions property to be set
146     * @throws SAML2Exception if the object is immutable
147     * @see #getExtensions
148     */
149    public void setExtensions(com.sun.identity.saml2.protocol.Extensions value)
150    throws SAML2Exception;
151    
152    /**
153     * Returns the value of the consent property.
154     *
155     * @return the value of the consent property
156     * @see #setConsent(String)
157     */
158    public java.lang.String getConsent();
159    
160    /**
161     * Sets the value of the consent property.
162     *
163     * @param value the value of the consent property to be set
164     * @throws SAML2Exception if the object is immutable
165     * @see #getConsent
166     */
167    public void setConsent(java.lang.String value) throws SAML2Exception;
168    
169    /**
170     * Returns the value of the inResponseTo property.
171     *
172     * @return the value of the inResponseTo property
173     * @see #setInResponseTo(String)
174     */
175    public java.lang.String getInResponseTo();
176    
177    /**
178     * Sets the value of the inResponseTo property.
179     *
180     * @param value the value of the inResponseTo property to be set
181     * @throws SAML2Exception if the object is immutable
182     * @see #getInResponseTo
183     */
184    public void setInResponseTo(java.lang.String value) throws SAML2Exception;
185    
186    /**
187     * Returns the value of the status property.
188     *
189     * @return the value of the status property
190     * @see #setStatus(Status)
191     */
192    public com.sun.identity.saml2.protocol.Status getStatus();
193    
194    /**
195     * Sets the value of the status property.
196     *
197     * @param value the value of the status property to be set
198     * @throws SAML2Exception if the object is immutable
199     * @see #getStatus
200     */
201    public void setStatus(com.sun.identity.saml2.protocol.Status value)
202    throws SAML2Exception;
203    
204    /**
205     * Returns the value of the id property.
206     *
207     * @return the value of the id property
208     * @see #setID(String)
209     */
210    public java.lang.String getID();
211    
212    /**
213     * Sets the value of the id property.
214     *
215     * @param value the value of the id property to be set
216     * @throws SAML2Exception if the object is immutable
217     * @see #getID
218     */
219    public void setID(java.lang.String value) throws SAML2Exception;
220    
221    /**
222     * Returns the value of the issuer property.
223     *
224     * @return the value of the issuer property
225     * @see #setIssuer(Issuer)
226     */
227    public com.sun.identity.saml2.assertion.Issuer getIssuer();
228    
229    /**
230     * Sets the value of the issuer property.
231     *
232     * @param value the value of the issuer property to be set
233     * @throws SAML2Exception if the object is immutable
234     * @see #getIssuer
235     */
236    public void setIssuer(com.sun.identity.saml2.assertion.Issuer value)
237    throws SAML2Exception;
238    
239    /**
240     * Returns whether the <code>StatusResponse</code> is signed or not.
241     * @return true if the <code>StatusResponse</code> is signed
242     *         false otherwise.
243     */
244    public boolean isSigned();
245    
246    /**
247     * Returns whether the signature on the <code>StatusResponse</code>
248     * is valid or not.
249     *
250     * @param senderCert Certificate containing the public key
251     *             which may be used for  signature verification;
252     *             This certificate may also may be used to check
253     *             against the certificate included in the signature
254     * @return true if the signature is valid; false otherwise.
255     * @throws SAML2Exception if the signature could not be verified
256     */
257    public boolean isSignatureValid(X509Certificate senderCert)
258        throws SAML2Exception;
259    
260    /**
261     * Signs the <code>StatusResponse</code>.
262     *
263     * @param privateKey Signing key
264     * @param cert Certificate which contain the public key correlated to
265     *             the signing key; It if is not null, then the signature
266     *             will include the certificate; Otherwise, the signature
267     *             will not include any certificate.
268     * @throws SAML2Exception if it could not sign the StatusResponse.
269     */
270    public void sign(PrivateKey privateKey, X509Certificate cert)
271        throws SAML2Exception; 
272        
273    /**
274     * Returns the <code>StatusResponse</code> in an XML document String format
275     * based on the <code>StatusResponse</code> schema described above.
276     *
277     * @return An XML String representing the <code>StatusResponse</code>.
278     * @throws SAML2Exception if some error occurs during conversion to
279     *         <code>String</code>.
280     */
281    public String toXMLString() throws SAML2Exception;
282    
283    /**
284     * Returns the <code>StatusResponse</code> in an XML document String format
285     * based on the <code>StatusResponse</code> schema described above.
286     * @param includeNSPrefix Determines whether or not the namespace qualifier 
287     * is prepended to the Element when converted
288     *
289     * @param declareNS Determines whether or not the namespace is declared
290     *        within the Element.
291     * @return A XML String representing the <code>StatusResponse</code>.
292     * @throws SAML2Exception if some error occurs during conversion to
293     *         <code>String</code>.
294     */
295    public String toXMLString(boolean includeNSPrefix, boolean declareNS)
296    throws SAML2Exception;
297    
298    /**
299     * Makes the object immutable
300     */
301    public void makeImmutable();
302    
303    /**
304     * Returns true if the object is mutable false otherwise
305     *
306     * @return true if the object is mutable false otherwise
307     */
308    public boolean isMutable();
309}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.