Class NameIDImpl

    • Constructor Detail

      • NameIDImpl

        public NameIDImpl()
        Default constructor
      • NameIDImpl

        public NameIDImpl​(String xml)
                   throws SAML2Exception
        This constructor is used to build NameID object from a XML string.
        Parameters:
        xml - A java.lang.String representing a NameID object
        Throws:
        SAML2Exception - if it could not process the XML string
      • NameIDImpl

        public NameIDImpl​(Element element)
                   throws SAML2Exception
        This constructor is used to build NameID object from a block of existing XML that has already been built into a DOM.
        Parameters:
        element - A org.w3c.dom.Element representing DOM tree for NameID 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 an EncryptedID object.
        Specified by:
        encrypt in interface NameID
        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 interface NameIDType
        Specified by:
        toXMLString in class NameIDTypeImpl
        Parameters:
        includeNSPrefix - Determines whether or not the namespace qualifier is prepended to the Element when converted
        declareNS - Determines whether or not the namespace is declared within the Element.
        Returns:
        A String representation
        Throws:
        SAML2Exception - if something is wrong during conversion