Package com.sun.identity.saml.assertion
Class SubjectConfirmation
java.lang.Object
com.sun.identity.saml.assertion.SubjectConfirmation
The
SubjectConfirmation
element specifies a subject by specifying
data that authenticates the subject.-
Constructor Summary
ConstructorDescriptionSubjectConfirmation
(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
Modifier and TypeMethodDescriptionboolean
addConfirmationMethod
(String confirmationMethod) Adds aconfirmationMethod
to thisSubjectConfirmation
element.boolean
equals
(SubjectConfirmation subjectConfirmation) Checks for equality between this object and theSubjectConfirmation
passed down as parameter.Gets Confirmation Method(s)Returns the key info.Get Subject Confirmation Databoolean
setKeyInfo
(Element keyInfo) Sets the key info.boolean
setSubjectConfirmationData
(String scDataString) Sets theSubjectConfirmationData
.boolean
setSubjectConfirmationData
(Element subjectConfirmationData) Sets theSubjectConfirmationData
toString()
Returns a String representation of the elementtoString
(boolean includeNS, boolean declareNS) Returns a String representation of the<SubjectConfirmation>
element.
-
Constructor Details
-
SubjectConfirmation
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
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
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 Details
-
addConfirmationMethod
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
Gets Confirmation Method(s)- Returns:
- A
java.util.Set
of confirmation Methods. Each method contained within is aString
representing the confirmation method.
-
getSubjectConfirmationData
Get Subject Confirmation Data- Returns:
- A String representation of the subject confirmation data with the Subject Confirmation element
-
setSubjectConfirmationData
Sets theSubjectConfirmationData
- Parameters:
subjectConfirmationData
- A String representation of the subject confirmation data within thisSubjectConfirmation
element- Returns:
- true indicating success of the operation.
-
setSubjectConfirmationData
Sets theSubjectConfirmationData
.- Parameters:
scDataString
- A String representation of the subject confirmation data within thisSubjectConfirmation
element.- Returns:
- true if the operation succeed.
-
getKeyInfo
Returns the key info.- Returns:
- The key info.
-
setKeyInfo
Sets the key info.- Parameters:
keyInfo
-dsig.KeyInfo
.- Returns:
- true if operations succeeds.
-
equals
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
Returns a String representation of the element -
toString
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.
-