Class NameIDImpl
- java.lang.Object
-
- com.sun.identity.saml2.assertion.impl.NameIDTypeImpl
-
- com.sun.identity.saml2.assertion.impl.NameIDImpl
-
- All Implemented Interfaces:
NameID
,NameIDType
,Serializable
- Direct Known Subclasses:
NameIDImplWithoutSPNameQualifier
public class NameIDImpl extends NameIDTypeImpl implements NameID
TheNameID
is used in various SAML assertion constructs such asSubject
andSubjectConfirmation
elements, and in various protocol messages.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME_ID_ELEMENT
-
Fields inherited from class com.sun.identity.saml2.assertion.impl.NameIDTypeImpl
FORMAT_ATTR, NAME_ID_TYPE_ELEMENT, NAME_QUALIFIER_ATTR, SP_NAME_QUALIFIER_ATTR, SP_PROVIDED_ID_ATTR
-
-
Constructor Summary
Constructors Constructor Description NameIDImpl()
Default constructorNameIDImpl(String xml)
This constructor is used to buildNameID
object from a XML string.NameIDImpl(Element element)
This constructor is used to buildNameID
object from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EncryptedID
encrypt(Key recipientPublicKey, String dataEncAlgorithm, int dataEncStrength, String recipientEntityID)
Returns anEncryptedID
object.String
toXMLString()
Returns a String representationString
toXMLString(boolean includeNSPrefix, boolean declareNS)
Returns a String representation-
Methods inherited from class com.sun.identity.saml2.assertion.impl.NameIDTypeImpl
getFormat, getNameQualifier, getSPNameQualifier, getSPProvidedID, getValue, getValueAndAttributes, isMutable, makeImmutable, setFormat, setNameQualifier, setSPNameQualifier, setSPProvidedID, setValue
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.identity.saml2.assertion.NameIDType
getFormat, getNameQualifier, getSPNameQualifier, getSPProvidedID, getValue, isMutable, makeImmutable, setFormat, setNameQualifier, setSPNameQualifier, setSPProvidedID, setValue
-
-
-
-
Field Detail
-
NAME_ID_ELEMENT
public static final String NAME_ID_ELEMENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NameIDImpl
public NameIDImpl()
Default constructor
-
NameIDImpl
public NameIDImpl(String xml) throws SAML2Exception
This constructor is used to buildNameID
object from a XML string.- Parameters:
xml
- Ajava.lang.String
representing aNameID
object- Throws:
SAML2Exception
- if it could not process the XML string
-
NameIDImpl
public NameIDImpl(Element element) throws SAML2Exception
This constructor is used to buildNameID
object from a block of existing XML that has already been built into a DOM.- Parameters:
element
- Aorg.w3c.dom.Element
representing DOM tree forNameID
object- Throws:
SAML2Exception
- if it could not process the Element
-
-
Method Detail
-
encrypt
public EncryptedID encrypt(Key recipientPublicKey, String dataEncAlgorithm, int dataEncStrength, String recipientEntityID) throws SAML2Exception
Returns anEncryptedID
object.- Specified by:
encrypt
in interfaceNameID
- Parameters:
recipientPublicKey
- Public key used to encrypt the data encryption (secret) key, it is the public key of the recipient of the XML document to be encrypted.dataEncAlgorithm
- Data encryption algorithm.dataEncStrength
- Data encryption strength.recipientEntityID
- Unique identifier of the recipient, it is used as the index to the cached secret key so that the key can be reused for the same recipient; It can be null in which case the secret key will be generated every time and will not be cached and reused. Note that the generation of a secret key is a relatively expensive operation.- Returns:
EncryptedID
object- Throws:
SAML2Exception
- if error occurs during the encryption process.
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Returns a String representation- Specified by:
toXMLString
in interfaceNameIDType
- Specified by:
toXMLString
in classNameIDTypeImpl
- 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 String representation
- Throws:
SAML2Exception
- if something is wrong during conversion
-
toXMLString
public String toXMLString() throws SAML2Exception
Returns a String representation- Specified by:
toXMLString
in interfaceNameIDType
- Specified by:
toXMLString
in classNameIDTypeImpl
- Returns:
- A String representation
- Throws:
SAML2Exception
- if something is wrong during conversion
-
-