Class StatusResponseImpl
- java.lang.Object
-
- com.sun.identity.saml2.protocol.impl.StatusResponseImpl
-
- All Implemented Interfaces:
StatusResponse
- Direct Known Subclasses:
ArtifactResponseImpl,LogoutResponseImpl,ManageNameIDResponseImpl,NameIDMappingResponseImpl,ResponseImpl
public abstract class StatusResponseImpl extends Object implements StatusResponse
This class defines methods for setting and retrieving attributes and elements associated with a SAML response message used in SAML protocols. This class is the base class for all SAML Responses.
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringconsentprotected Stringdestinationprotected Extensionsextensionsprotected StringinResponseToprotected booleanisMutableprotected BooleanisSignatureValidprotected booleanisSignedprotected DateissueInstantprotected Issuerissuerprotected PublicKeypublicKeyprotected StringresponseIdprotected StringsignatureStringprotected StringsignedXMLStringprotected Statusstatusprotected Stringversion
-
Constructor Summary
Constructors Constructor Description StatusResponseImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetConsent()Returns the value of the consent property.StringgetDestination()Returns the value of the destination property.ExtensionsgetExtensions()Returns the value of the extensions property.StringgetID()Returns the value of the id property.StringgetInResponseTo()Returns the value of the inResponseTo property.DategetIssueInstant()Returns the value of the issueInstant property.IssuergetIssuer()Returns the value of the issuer property.StringgetSignature()Returns the signature element, theStatusResponsecontains asString.StatusgetStatus()Returns the value of the status property.StringgetVersion()Returns the value of the version property.booleanisMutable()Returns true if object is mutable.booleanisSignatureValid(Set<X509Certificate> verificationCerts)Returns whether the signature on theStatusResponseis valid or not.booleanisSigned()Returns whether theStatusResponseis signed or not.voidmakeImmutable()Makes this object immutable.voidsetConsent(String value)Sets the value of the consent property.voidsetDestination(String value)Sets the value of the destination property.voidsetExtensions(Extensions value)Sets the value of the extensions property.voidsetID(String value)Sets the value of the id property.voidsetInResponseTo(String value)Sets the value of the inResponseTo property.voidsetIssueInstant(Date value)Sets the value of the issueInstant property.voidsetIssuer(Issuer value)Sets the value of the issuer property.voidsetStatus(Status value)Sets the value of the status property.voidsetVersion(String value)Sets the value of the version property.voidsign(PrivateKey privateKey, X509Certificate cert)Signs the StatusResponseStringtoXMLString()Returns theStatusResponsein an XML document String format based on theStatusResponseschema described above.StringtoXMLString(boolean includeNSPrefix, boolean declareNS)Returns theStatusResponsein an XML document String format based on theStatusResponseschema described above.protected voidvalidateData()protected voidvalidateID(String responseId)protected voidvalidateIssueInstant(String issueInstantStr)protected voidvalidateStatus()protected voidvalidateVersion(String version)
-
-
-
Field Detail
-
version
protected String version
-
issueInstant
protected Date issueInstant
-
destination
protected String destination
-
signatureString
protected String signatureString
-
extensions
protected Extensions extensions
-
consent
protected String consent
-
inResponseTo
protected String inResponseTo
-
status
protected Status status
-
responseId
protected String responseId
-
issuer
protected Issuer issuer
-
isSigned
protected boolean isSigned
-
isSignatureValid
protected Boolean isSignatureValid
-
isMutable
protected boolean isMutable
-
publicKey
protected PublicKey publicKey
-
signedXMLString
protected String signedXMLString
-
-
Method Detail
-
getVersion
public String getVersion()
Returns the value of the version property.- Specified by:
getVersionin interfaceStatusResponse- Returns:
- the value of the version property
- See Also:
setVersion(String)
-
setVersion
public void setVersion(String value) throws SAML2Exception
Sets the value of the version property.- Specified by:
setVersionin interfaceStatusResponse- Parameters:
value- the value of the version property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getVersion()
-
getIssueInstant
public Date getIssueInstant()
Returns the value of the issueInstant property.- Specified by:
getIssueInstantin interfaceStatusResponse- Returns:
- the value of the issueInstant property
- See Also:
setIssueInstant(java.util.Date)
-
setIssueInstant
public void setIssueInstant(Date value) throws SAML2Exception
Sets the value of the issueInstant property.- Specified by:
setIssueInstantin interfaceStatusResponse- Parameters:
value- the value of the issueInstant property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getIssueInstant()
-
getDestination
public String getDestination()
Returns the value of the destination property.- Specified by:
getDestinationin interfaceStatusResponse- Returns:
- the value of the destination property
- See Also:
setDestination(String)
-
setDestination
public void setDestination(String value) throws SAML2Exception
Sets the value of the destination property.- Specified by:
setDestinationin interfaceStatusResponse- Parameters:
value- the value of the destination property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getDestination()
-
getSignature
public String getSignature()
Returns the signature element, theStatusResponsecontains asString. It returns null if theStatusResponsehas no signature.- Specified by:
getSignaturein interfaceStatusResponse- Returns:
Stringrepresentation of the signature.
-
sign
public void sign(PrivateKey privateKey, X509Certificate cert) throws SAML2Exception
Signs the StatusResponse- Specified by:
signin interfaceStatusResponse- Parameters:
privateKey- Signing keycert- Certificate which contain the public key correlated to the signing key; It if is not null, then the signature will include the certificate; Otherwise, the signature will not include any certificate.- Throws:
SAML2Exception- if it could not sign the Request.
-
getExtensions
public Extensions getExtensions()
Returns the value of the extensions property.- Specified by:
getExtensionsin interfaceStatusResponse- Returns:
- the value of the extensions property
- See Also:
setExtensions(Extensions)
-
setExtensions
public void setExtensions(Extensions value) throws SAML2Exception
Sets the value of the extensions property.- Specified by:
setExtensionsin interfaceStatusResponse- Parameters:
value- the value of the extensions property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getExtensions()
-
getConsent
public String getConsent()
Returns the value of the consent property.- Specified by:
getConsentin interfaceStatusResponse- Returns:
- the value of the consent property
- See Also:
setConsent(String)
-
setConsent
public void setConsent(String value) throws SAML2Exception
Sets the value of the consent property.- Specified by:
setConsentin interfaceStatusResponse- Parameters:
value- the value of the consent property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getConsent()
-
getInResponseTo
public String getInResponseTo()
Returns the value of the inResponseTo property.- Specified by:
getInResponseToin interfaceStatusResponse- Returns:
- the value of the inResponseTo property
- See Also:
setInResponseTo(String)
-
setInResponseTo
public void setInResponseTo(String value) throws SAML2Exception
Sets the value of the inResponseTo property.- Specified by:
setInResponseToin interfaceStatusResponse- Parameters:
value- the value of the inResponseTo property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getInResponseTo()
-
getStatus
public Status getStatus()
Returns the value of the status property.- Specified by:
getStatusin interfaceStatusResponse- Returns:
- the value of the status property
- See Also:
setStatus(Status)
-
setStatus
public void setStatus(Status value) throws SAML2Exception
Sets the value of the status property.- Specified by:
setStatusin interfaceStatusResponse- Parameters:
value- the value of the status property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getStatus()
-
getID
public String getID()
Returns the value of the id property.- Specified by:
getIDin interfaceStatusResponse- Returns:
- the value of the id property
- See Also:
setID(String)
-
setID
public void setID(String value) throws SAML2Exception
Sets the value of the id property.- Specified by:
setIDin interfaceStatusResponse- Parameters:
value- the value of the id property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getID()
-
getIssuer
public Issuer getIssuer()
Returns the value of the issuer property.- Specified by:
getIssuerin interfaceStatusResponse- Returns:
- the value of the issuer property
- See Also:
setIssuer(Issuer)
-
setIssuer
public void setIssuer(Issuer value) throws SAML2Exception
Sets the value of the issuer property.- Specified by:
setIssuerin interfaceStatusResponse- Parameters:
value- the value of the issuer property to be set- Throws:
SAML2Exception- if the object is immutable- See Also:
getIssuer()
-
isSigned
public boolean isSigned()
Returns whether theStatusResponseis signed or not.- Specified by:
isSignedin interfaceStatusResponse- Returns:
- true if the
StatusResponseis signed.
-
isSignatureValid
public boolean isSignatureValid(Set<X509Certificate> verificationCerts) throws SAML2Exception
Description copied from interface:StatusResponseReturns whether the signature on theStatusResponseis valid or not.- Specified by:
isSignatureValidin interfaceStatusResponse- Parameters:
verificationCerts- Certificates containing the public keys which may be used for signature verification; This certificate may also may be used to check against the certificate included in the signature.- Returns:
- true if the signature is valid; false otherwise.
- Throws:
SAML2Exception- if the signature could not be verified
-
toXMLString
public String toXMLString() throws SAML2Exception
Returns theStatusResponsein an XML document String format based on theStatusResponseschema described above.- Specified by:
toXMLStringin interfaceStatusResponse- Returns:
- An XML String representing the
StatusResponse. - Throws:
SAML2Exception- if some error occurs during conversion toString.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Returns theStatusResponsein an XML document String format based on theStatusResponseschema described above.- Specified by:
toXMLStringin interfaceStatusResponse- Parameters:
includeNSPrefix- Determines whether or not the namespace qualifier is prepended to the Element when converteddeclareNS- Determines whether or not the namespace is declared within the Element.- Returns:
- A XML String representing the
StatusResponse. - Throws:
SAML2Exception- if some error occurs during conversion toString.
-
makeImmutable
public void makeImmutable()
Makes this object immutable.- Specified by:
makeImmutablein interfaceStatusResponse
-
isMutable
public boolean isMutable()
Returns true if object is mutable.- Specified by:
isMutablein interfaceStatusResponse- Returns:
- true if object is mutable.
-
validateID
protected void validateID(String responseId) throws SAML2Exception
- Throws:
SAML2Exception
-
validateVersion
protected void validateVersion(String version) throws SAML2Exception
- Throws:
SAML2Exception
-
validateIssueInstant
protected void validateIssueInstant(String issueInstantStr) throws SAML2Exception
- Throws:
SAML2Exception
-
validateStatus
protected void validateStatus() throws SAML2Exception- Throws:
SAML2Exception
-
validateData
protected void validateData() throws SAML2Exception- Throws:
SAML2Exception
-
-