Skip navigation links

Oracle Fusion Middleware SAML 2.0 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10676-03


oracle.security.xmlsec.saml2.core
Class EncryptedElement

java.lang.Object
  extended by oracle.security.xmlsec.util.XMLNode
      extended by oracle.security.xmlsec.util.XMLElement
          extended by oracle.security.xmlsec.saml2.core.EncryptedElement

All Implemented Interfaces:
SAML2EncryptedType
Direct Known Subclasses:
EncryptedAssertion, EncryptedAttribute, EncryptedID, NewEncryptedID

public abstract class EncryptedElement
extends oracle.security.xmlsec.util.XMLElement
implements SAML2EncryptedType

Represents an abstract encrypted element.


Field Summary

 

Fields inherited from class oracle.security.xmlsec.util.XMLNode
node, systemId

 

Constructor Summary
protected EncryptedElement(org.w3c.dom.Document owner, java.lang.String nsURI, java.lang.String localName)
          Creates a new EncryptedElement instance.
  EncryptedElement(org.w3c.dom.Element element)
          Creates a new EncryptedElement instance from the given Element node.
  EncryptedElement(org.w3c.dom.Element element, java.lang.String systemId)
          Creates a new EncryptedElement instance from the given Element node.

 

Method Summary
 void addEncryptedKey(oracle.security.xmlsec.enc.XEEncryptedKey encKey)
          Add a wrapped key.
 org.w3c.dom.Element decryptElement(java.security.Key key)
          Decrypt the given EncryptedData element of data type XML Element or XML Content, and replaces the EncryptedData element with the result.
 oracle.security.xmlsec.enc.XEEncryptedData encryptElement(org.w3c.dom.Element element, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String dataEncKeyName)
          Encrypt the Element with the given algorithm and content encryption key, where the key is identified by a key name.
 oracle.security.xmlsec.enc.XEEncryptedData encryptElement(org.w3c.dom.Element element, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String keyEncAlg, java.security.Key keyEncKey, java.lang.String keyEncKeyName)
          Encrypt Element with the given algorithm and key, where the data encryption key is encrypted with the given key encryption key.
 oracle.security.xmlsec.enc.XEEncryptedData getEncryptedData()
          Return the encrypted EndpointType.
 java.util.List getEncryptedKeys()
          Returns the list of wrapped keys.
protected  void removeChildren(java.lang.String ns, java.lang.String tag)
           
 void setEncryptedData(oracle.security.xmlsec.enc.XEEncryptedData encData)
          Set the encrypted content.

 

Methods inherited from class oracle.security.xmlsec.util.XMLElement
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, getElement, getElementsByTagName, getElementsByTagNameNS, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setDefaultNSPrefix

 

Methods inherited from class oracle.security.xmlsec.util.XMLNode
appendChild, appendChild, appendTo, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSystemId, hasAttributes, hasChildNodes, insertBefore, insertBefore, isSupported, normalize, removeChild, removeChild, replaceChild, replaceChild, setNodeValue, setPrefix, setSystemId, toBytesXML, toStringXML

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

EncryptedElement

public EncryptedElement(org.w3c.dom.Element element)
                 throws org.w3c.dom.DOMException
Creates a new EncryptedElement instance from the given Element node.
Parameters:
element - A EncryptedElement element.
Throws:
org.w3c.dom.DOMException

EncryptedElement

public EncryptedElement(org.w3c.dom.Element element,
                        java.lang.String systemId)
                 throws org.w3c.dom.DOMException
Creates a new EncryptedElement instance from the given Element node.
Parameters:
element - A EncryptedElement element.
systemId - The URI string system ID for the EncryptedElement.
Throws:
org.w3c.dom.DOMException

EncryptedElement

protected EncryptedElement(org.w3c.dom.Document owner,
                           java.lang.String nsURI,
                           java.lang.String localName)
                    throws org.w3c.dom.DOMException
Creates a new EncryptedElement instance. This is for use in any sub-class for extension of this SAML 2.0 element.
Parameters:
owner - The owner document of the new EncryptedElement.
nsURI - The namespace URI in which the new EncryptedElement is to be created.
localName - The localName of the element represented by the class that extends this class.
Throws:
org.w3c.dom.DOMException

Method Detail

encryptElement

public oracle.security.xmlsec.enc.XEEncryptedData encryptElement(org.w3c.dom.Element element,
                                                                 java.lang.String dataEncAlg,
                                                                 javax.crypto.SecretKey dataEncKey,
                                                                 java.lang.String dataEncKeyName)
                                                          throws oracle.security.xmlsec.enc.XEException
Encrypt the Element with the given algorithm and content encryption key, where the key is identified by a key name.

The supported data encrytion algorithms are:

Parameters:
element - The element to encrypt.
dataEncAlg - The URI identifying the data encryption algorithm.
dataEncKey - The data encryption key. If null, a encryption key will be randomly generated.
dataEncKeyName - The name identifying the data encryption key, optional.
Returns:
A new XEEncryptedData which replaces the nameID element.
Throws:
oracle.security.xmlsec.enc.XEException - If an error occurs in encrypting the data.

encryptElement

public oracle.security.xmlsec.enc.XEEncryptedData encryptElement(org.w3c.dom.Element element,
                                                                 java.lang.String dataEncAlg,
                                                                 javax.crypto.SecretKey dataEncKey,
                                                                 java.lang.String keyEncAlg,
                                                                 java.security.Key keyEncKey,
                                                                 java.lang.String keyEncKeyName)
                                                          throws oracle.security.xmlsec.enc.XEException
Encrypt Element with the given algorithm and key, where the data encryption key is encrypted with the given key encryption key.

The supported data encrytion algorithms are:

The supported key encrytion algorithms are:

For RSA-OAEP, the following parameters are used:

Parameters:
element - The element to encrypt.
dataEncAlg - The URI identifying the data encryption algorithm.
dataEncKey - The data encryption key. If null, a encryption key will be randomly generated.
keyEncAlg - The URI identifying the key encryption algorithm.
keyEncKey - The key encryption key.
keyEncKeyName - The name identifying the key encryption key, optional.
Returns:
A new XEEncryptedData which replaces the nameID element.
Throws:
oracle.security.xmlsec.enc.XEException - If an error occurs in encrypting the data.

decryptElement

public org.w3c.dom.Element decryptElement(java.security.Key key)
                                   throws oracle.security.xmlsec.enc.XEException
Decrypt the given EncryptedData element of data type XML Element or XML Content, and replaces the EncryptedData element with the result.

If the data encryption key is encrypted, the key decryption key will be obtained from the EncryptedData's KeyInfo element. This may be a recursive step, as the key-encryption key may itself be encrypted. The decryption key for the bottom EncryptedKey element (or the EncryptedData element itself if the data encryption key is not encrypted) is either provided by the user, or can be derived by the Diffe-Hellman key agreement method. In the latter case the Diffie-Hellamn private key must be provided by the user.

Parameters:
key - Data- or key-decryption key, or a Diffie-Hellman private key.
Returns:
The decrypted XML Element.
Throws:
oracle.security.xmlsec.enc.XEException

removeChildren

protected void removeChildren(java.lang.String ns,
                              java.lang.String tag)

setEncryptedData

public void setEncryptedData(oracle.security.xmlsec.enc.XEEncryptedData encData)
Set the encrypted content.
Specified by:
setEncryptedData in interface SAML2EncryptedType
Parameters:
encData - The XEEncryptedData object containing the encrypted EndpointType.

getEncryptedData

public oracle.security.xmlsec.enc.XEEncryptedData getEncryptedData()
Return the encrypted EndpointType.
Specified by:
getEncryptedData in interface SAML2EncryptedType
Returns:
The List of XEEncryptedData object or null if empty.

addEncryptedKey

public void addEncryptedKey(oracle.security.xmlsec.enc.XEEncryptedKey encKey)
Add a wrapped key.
Specified by:
addEncryptedKey in interface SAML2EncryptedType
Parameters:
encKey - The XEEncryptedKey to add.

getEncryptedKeys

public java.util.List getEncryptedKeys()
Returns the list of wrapped keys.
Specified by:
getEncryptedKeys in interface SAML2EncryptedType
Returns:
The List of XEEncryptedKey objects or null if empty.

Skip navigation links

Oracle Fusion Middleware SAML 2.0 Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10676-03


Copyright © 2005, 2011 , Oracle. All rights reserved.