Package com.sun.identity.saml.assertion
Class SubjectConfirmation
- java.lang.Object
-
- com.sun.identity.saml.assertion.SubjectConfirmation
-
@SupportedAll public class SubjectConfirmation extends Object
TheSubjectConfirmation
element 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 anSubjectConfirmation
instance.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 boolean
addConfirmationMethod(String confirmationMethod)
Adds aconfirmationMethod
to thisSubjectConfirmation
element.boolean
equals(SubjectConfirmation subjectConfirmation)
Checks for equality between this object and theSubjectConfirmation
passed down as parameter.Set
getConfirmationMethod()
Gets Confirmation Method(s)Element
getKeyInfo()
Returns the key info.Element
getSubjectConfirmationData()
Get Subject Confirmation Databoolean
setKeyInfo(Element keyInfo)
Sets the key info.boolean
setSubjectConfirmationData(String scDataString)
Sets theSubjectConfirmationData
.boolean
setSubjectConfirmationData(Element subjectConfirmationData)
Sets theSubjectConfirmationData
String
toString()
Returns a String representation of the elementString
toString(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 theSubjectConfirmation
object.- Throws:
SAMLException
- If there was an error while constructing this object.
-
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-25
Section 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
- aSet
ofconfirmationMethods
- Throws:
SAMLException
- if theconfirmationMethods
is empty.
-
SubjectConfirmation
public SubjectConfirmation(Set confirmationMethods, Element subjectConfirmationData, Element keyInfo) throws SAMLException
Constructs anSubjectConfirmation
instance.- Parameters:
confirmationMethods
- A set ofconfirmationMethods
each of which is a URI (String) that identifies a protocol used to authenticate aSubject
. Please refer todraft-sstc-core-25
Section 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 nosubjectConfirmationData
for theSubjectConfirmation
object.keyInfo
- An XML signature element that specifies a cryptographic key held by theSubject
.- Throws:
SAMLException
- if the input data is invalid orconfirmationMethods
is empty.
-
-
Method Detail
-
addConfirmationMethod
public boolean addConfirmationMethod(String confirmationMethod)
Adds aconfirmationMethod
to thisSubjectConfirmation
element.- 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.Set
of confirmation Methods. Each method contained within is aString
representing 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 thisSubjectConfirmation
element- 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 thisSubjectConfirmation
element.- 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 theSubjectConfirmation
passed 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
-SubjectConfirmation
to 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.
-
-