Oracle Security Developer Tools XML Security Java API Reference
10g Release 2 (10.1.2.0.2)

B15571-01


oracle.security.xmlsec.enc
Class XEEncryptionMethod

java.lang.Object
  extended byoracle.security.xmlsec.util.XMLNode
      extended byoracle.security.xmlsec.util.XMLElement
          extended byoracle.security.xmlsec.dsig.XSAlgorithmIdentifier
              extended byoracle.security.xmlsec.enc.XEEncryptionMethod


public class XEEncryptionMethod
extends XSAlgorithmIdentifier

This class represents EncryptionMethod element which sets the algorithm and parameters to be used in encrypting the data or key. Standard encryption and key wrapping algorithm URI constants can be found in XMLURI, including:

See Also:
XEEncryptedObject

Field Summary

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

Constructor Summary
XEEncryptionMethod(org.w3c.dom.Element encMethod)
Create an XEEncryptionMethod instance with the given EncryptionMethod element.
XEEncryptionMethod(org.w3c.dom.Element encMethod, java.lang.String systemId)
Create an XEEncryptionMethod instance with the given EncryptionMethod element.

Method Summary
AlgorithmIdentifier getAlgID()
Returns the AlgorithmIdentifier for the encryption algorithm identified by the EncryptionMethod element.
XSAlgorithmIdentifier getDigestMethod()
Returns message digest algorithm URI.
AlgorithmIdentifier getKeyAlgID()
Returns the AlgorithmIdentifier of the key intended for the encryption algorithm identified by the algorithm URI.
int getKeySize()
Returns the key size provided in the KeySize child element.
byte[] getOAEPParams()
Returns the RSA-OAEP parameters.
int keySize()
Return the key size in bits either inherent in the algorithm URI or explicitly provided in the KeySize child element.
void setDigestMethod(java.lang.String digestMethod)
Set the DigestMethod child element for this EncryptionMethod element with the given message digest algorithm URI.This method should only be used for RSA-OAEP.
void setDigestMethod(XSAlgorithmIdentifier digestMethod)
Set the DigestMethod child element for this EncryptionMethod element with the given message digest algorithm.
void setKeySize(int keySize)
Sets the KeySize element with the given value.
void setOAEPParams(byte[] params)
Set the OAEPparams child element for this EncryptionMethod element with the given bytes.

Methods inherited from class oracle.security.xmlsec.dsig.XSAlgorithmIdentifier
addParameter, addParameter, getAlgorithm, getParameters, setAlgorithm

Methods inherited from class oracle.security.xmlsec.util.XMLElement
addNSPrefixAttr, addNSPrefixAttr, addNSPrefixAttrDefault, addNSPrefixAttrDefault, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getChildElementsByTagName, getChildElementsByTagName, getChildElementsByTagNameNS, getChildElementsByTagNameNS, getDefaultNSPrefix, 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

XEEncryptionMethod

public XEEncryptionMethod(org.w3c.dom.Element encMethod)
                   throws org.w3c.dom.DOMException
Create an XEEncryptionMethod instance with the given EncryptionMethod element.
Parameters:
encMethod - An EncryptionMethod element.

XEEncryptionMethod

public XEEncryptionMethod(org.w3c.dom.Element encMethod,
                          java.lang.String systemId)
                   throws org.w3c.dom.DOMException
Create an XEEncryptionMethod instance with the given EncryptionMethod element.
Parameters:
encMethod - An EncryptionMethod element.
systemId - The URI string system ID for this element.
Since:
2.0
See Also:
XMLNode.setSystemId(java.lang.String)

Method Detail

setKeySize

public void setKeySize(int keySize)
                throws org.w3c.dom.DOMException
Sets the KeySize element with the given value. The key size must be consistent with the encryption algorithm specified by the algorithm URI.
Parameters:
keySize - The integer value for the key size.
Throws:
org.w3c.dom.DOMException

getKeySize

public int getKeySize()
Returns the key size provided in the KeySize child element.
Returns:
The integer value for the key size, or 0 if the KeySize child element is not set.

setDigestMethod

public void setDigestMethod(java.lang.String digestMethod)
                     throws org.w3c.dom.DOMException
Set the DigestMethod child element for this EncryptionMethod element with the given message digest algorithm URI.This method should only be used for RSA-OAEP.
Parameters:
digestMethod - The algorithm URI for the digest algorithm to be used in key transport with RSA-OAEP.
Throws:
org.w3c.dom.DOMException
See Also:
XMLURI

setDigestMethod

public void setDigestMethod(XSAlgorithmIdentifier digestMethod)
                     throws org.w3c.dom.DOMException
Set the DigestMethod child element for this EncryptionMethod element with the given message digest algorithm. This method should only be used for RSA-OAEP.
Parameters:
digestMethod - The XSAlgorithmIdentifier for the digest algorithm to be used in key transport with RSA-OAEP.
Throws:
org.w3c.dom.DOMException

getDigestMethod

public XSAlgorithmIdentifier getDigestMethod()
Returns message digest algorithm URI.
Returns:
The algorithm URI for the digest algorithm to be used in key transport with RSA-OAEP.

setOAEPParams

public void setOAEPParams(byte[] params)
                   throws org.w3c.dom.DOMException
Set the OAEPparams child element for this EncryptionMethod element with the given bytes. This method should only be used for RSA-OAEP.
Parameters:
params - The parameters for use with RSA-OAEP.
Throws:
org.w3c.dom.DOMException

getOAEPParams

public byte[] getOAEPParams()
Returns the RSA-OAEP parameters.
Returns:
The parameters for use with RSA-OAEP, or null if not specified.

getAlgID

public AlgorithmIdentifier getAlgID()
                             throws XESchemaException,
                                    XECipherException
Returns the AlgorithmIdentifier for the encryption algorithm identified by the EncryptionMethod element.
Throws:
XESchemaException
XECipherException

getKeyAlgID

public AlgorithmIdentifier getKeyAlgID()
                                throws XESchemaException,
                                       XECipherException
Returns the AlgorithmIdentifier of the key intended for the encryption algorithm identified by the algorithm URI.
Throws:
XESchemaException
XECipherException

keySize

public int keySize()
            throws XESchemaException,
                   XECipherException
Return the key size in bits either inherent in the algorithm URI or explicitly provided in the KeySize child element.
Throws:
XESchemaException
XECipherException

Oracle Security Developer Tools XML Security Java API Reference
10g Release 2 (10.1.2.0.2)

B15571-01


Copyright © 2005 , Oracle. All rights reserved.