Package com.sun.identity.saml.assertion
Class SubjectConfirmation
- java.lang.Object
-
- com.sun.identity.saml.assertion.SubjectConfirmation
-
public class SubjectConfirmation extends Object
TheSubjectConfirmationelement specifies a subject by specifying data that authenticates the subject.
-
-
Constructor Summary
Constructors Constructor Description SubjectConfirmation(String confirmationMethod)Constructor with a single confirmation method.SubjectConfirmation(Set confirmationMethods)Constructor for multiple confirmation methodsSubjectConfirmation(Set confirmationMethods, Element subjectConfirmationData, Element keyInfo)Constructs anSubjectConfirmationinstance.SubjectConfirmation(Element subjectConfirmationElement)Constructs a subject confirmation element from an existing XML block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddConfirmationMethod(String confirmationMethod)Adds aconfirmationMethodto thisSubjectConfirmationelement.booleanequals(SubjectConfirmation subjectConfirmation)Checks for equality between this object and theSubjectConfirmationpassed down as parameter.SetgetConfirmationMethod()Gets Confirmation Method(s)ElementgetKeyInfo()Returns the key info.ElementgetSubjectConfirmationData()Get Subject Confirmation DatabooleansetKeyInfo(Element keyInfo)Sets the key info.booleansetSubjectConfirmationData(String scDataString)Sets theSubjectConfirmationData.booleansetSubjectConfirmationData(Element subjectConfirmationData)Sets theSubjectConfirmationDataStringtoString()Returns a String representation of the elementStringtoString(boolean includeNS, boolean declareNS)Returns a String representation of the<SubjectConfirmation>element.
-
-
-
Constructor Detail
-
SubjectConfirmation
public SubjectConfirmation(Element subjectConfirmationElement) throws SAMLException
Constructs a subject confirmation element from an existing XML block.- Parameters:
subjectConfirmationElement- a DOM Element representing theSubjectConfirmationobject.- Throws:
SAMLException
-
SubjectConfirmation
public SubjectConfirmation(String confirmationMethod) throws SAMLException
Constructor with a single confirmation method.- Parameters:
confirmationMethod- A URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.- Throws:
SAMLException- if the input data is null.
-
SubjectConfirmation
public SubjectConfirmation(Set confirmationMethods) throws SAMLException
Constructor for multiple confirmation methods- Parameters:
confirmationMethods- aSetofconfirmationMethods- Throws:
SAMLException- if theconfirmationMethodsis empty.
-
SubjectConfirmation
public SubjectConfirmation(Set confirmationMethods, Element subjectConfirmationData, Element keyInfo) throws SAMLException
Constructs anSubjectConfirmationinstance.- Parameters:
confirmationMethods- A set ofconfirmationMethodseach of which is a URI (String) that identifies a protocol used to authenticate aSubject. Please refer todraft-sstc-core-25Section 7 for a list of URIs identifying common authentication protocols.subjectConfirmationData- Additional authentication information to be used by a specific authentication protocol. Can be passed as null if there is nosubjectConfirmationDatafor theSubjectConfirmationobject.keyInfo- An XML signature element that specifies a cryptographic key held by theSubject.- Throws:
SAMLException- if the input data is invalid orconfirmationMethodsis empty.
-
-
Method Detail
-
addConfirmationMethod
public boolean addConfirmationMethod(String confirmationMethod)
Adds aconfirmationMethodto thisSubjectConfirmationelement.- Parameters:
confirmationMethod- a String which is a URI (String) that identifies a protocol used to authenticate aSubject.- Returns:
- true indicating success of the operation.
-
getConfirmationMethod
public Set getConfirmationMethod()
Gets Confirmation Method(s)- Returns:
- A
java.util.Setof confirmation Methods. Each method contained within is aStringrepresenting the confirmation method.
-
getSubjectConfirmationData
public Element getSubjectConfirmationData()
Get Subject Confirmation Data- Returns:
- A String representation of the subject confirmation data with the Subject Confirmation element
-
setSubjectConfirmationData
public boolean setSubjectConfirmationData(Element subjectConfirmationData)
Sets theSubjectConfirmationData- Parameters:
subjectConfirmationData- A String representation of the subject confirmation data within thisSubjectConfirmationelement- Returns:
- true indicating success of the operation.
-
setSubjectConfirmationData
public boolean setSubjectConfirmationData(String scDataString)
Sets theSubjectConfirmationData.- Parameters:
scDataString- A String representation of the subject confirmation data within thisSubjectConfirmationelement.- Returns:
- true if the operation succeed.
-
getKeyInfo
public Element getKeyInfo()
Returns the key info.- Returns:
- The key info.
-
setKeyInfo
public boolean setKeyInfo(Element keyInfo)
Sets the key info.- Parameters:
keyInfo-dsig.KeyInfo.- Returns:
- true if operations succeeds.
-
equals
public boolean equals(SubjectConfirmation subjectConfirmation)
Checks for equality between this object and theSubjectConfirmationpassed down as parameter. Checks to see that each have confirmations method present in the other one (does not care about sequence) Also does an exact match onSubjectConfirmationData. Note: no check is done forKeyInfo.- Parameters:
subjectConfirmation-SubjectConfirmationto be checked.- Returns:
- true if the two are EXACTLY equal.
-
toString
public String toString()
Returns a String representation of the element
-
toString
public String toString(boolean includeNS, boolean declareNS)
Returns a String representation of the<SubjectConfirmation>element.- Parameters:
includeNS- 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 string containing the valid XML for this element.
-
-