|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.xmlsec.enc.XEncUtils
public class XEncUtils
Simple API for encrypting and decrypting XML Key, Element or Element Content.
Method Summary | |
---|---|
static java.io.InputStream |
decryptBytes(XEEncryptedData ed, java.security.PrivateKey keyDecKey) Decrypt an EncrytedData, by at first searching for the EncrytedKey inside the KeyInfo of the EncrytedData, and then decrypting the EncryptedKey and then that decrypted key to decrypt the EncryptedData. |
static org.w3c.dom.Element |
decryptElement(org.w3c.dom.Element encryptedData, 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. |
static java.io.OutputStream |
encryptBytes(XEEncryptedData ed, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String dataEncKeyName, java.lang.String keyEncAlg, java.security.PublicKey keyEncKey, java.lang.String keyEncKeyName) Encrypt bytes into an EncryptedData element, and encrypt the key into and EncryptedKey element. |
static XEEncryptedData |
encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String dataEncKeyName) Encrypt XML data of type XML Element or XML Element Content with the given algorithm and key, where the key is identified by a key name. |
static XEEncryptedData |
encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String keyEncAlg, java.security.Key keyEncKey, java.lang.String keyEncKeyName) Encrypt XML data of type XML Element or XML Element Content with the given algorithm and key, where the data encryption key is encrypted with the given key encryption key. |
static XEEncryptedData |
encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, java.lang.String keyEncAlg, java.security.Key keyEncKey, java.lang.String keyEncKeyName, java.security.SecureRandom rbs) Encrypt XML data of type XML Element or XML Element Content with the given algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static XEEncryptedData encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String dataEncKeyName) throws XEException
The supported data encrytion algorithms are:
inputElement
- The input XML element to be encrypted.contentOnly
- If true
, only encrypt the content of the input element; else encrypt the whole element.dataEncAlg
- The URI identifying the data encryption algorithm.dataEncKey
- The data encryption key.dataEncKeyName
- The name identifying the data encryption key, optional.XEEncryptedData
which replaces the inputElement or its content in its owner document.XEException
- If an error occurs in encrypting the data.public static XEEncryptedData encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String keyEncAlg, java.security.Key keyEncKey, java.lang.String keyEncKeyName) throws XEException
The supported data encrytion algorithms are:
The supported key encrytion algorithms are:
For RSA-OAEP, the following parameters are used:
SHA-1
inputElement
- The input XML elemen to be encrypted.contentOnly
- If true
, only encrypt the content of the input element; else encrypt the whole element.dataEncAlg
- The URI identifying the data encryption algorithm.dataEncKey
- The data encryption key.keyEncAlg
- The URI identifying the key encryption algorithm.keyEncKey
- The key encryption key.keyEncKeyName
- The name identifying the key encryption key, optional.XEEncryptedData
which replaces the inputElement or its content in its owner document.XEException
- If an error occurs in encrypting the data.public static XEEncryptedData encryptElement(org.w3c.dom.Element inputElement, boolean contentOnly, java.lang.String dataEncAlg, java.lang.String keyEncAlg, java.security.Key keyEncKey, java.lang.String keyEncKeyName, java.security.SecureRandom rbs) throws XEException
The supported data encrytion algorithms are:
The supported key encrytion algorithms are:
For RSA-OAEP, the following parameters are used:
SHA-1
inputElement
- The input XML elemen to be encrypted.contentOnly
- If true
, only encrypt the content of the input element; else encrypt the whole element.dataEncAlg
- The URI identifying the data encryption algorithm.keyEncAlg
- The URI identifying the key encryption algorithm.keyEncKey
- The key encryption key.keyEncKeyName
- The name identifying the key encryption key, optional.rbs
- A PRNG to use for generating the data encryption key, optional. If rbs
is null
, the default PRNG will be used.XEEncryptedData
which replaces the inputElement or its content in its owner document.XEException
- If an error occurs in encrypting the data.public static org.w3c.dom.Element decryptElement(org.w3c.dom.Element encryptedData, java.security.Key key) throws XEException
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.
encryptedData
- The EncryptedData element to be decrypted.key
- Data- or key-decryption key, or a Diffie-Hellman private key.XEException
public static java.io.OutputStream encryptBytes(XEEncryptedData ed, java.lang.String dataEncAlg, javax.crypto.SecretKey dataEncKey, java.lang.String dataEncKeyName, java.lang.String keyEncAlg, java.security.PublicKey keyEncKey, java.lang.String keyEncKeyName) throws XEException, java.io.IOException
ed
- The EncryptedData elementdataEncAlg
- data encryption algorithmdataEncKey
- data encryption keydataEncKeyName
- data encryption key name (optional)keyEncAlg
- Key encryption algorithmkeyEncKey
- key encryption keykeyEncKeyName
- key encryption key nameXEException
java.io.IOException
public static java.io.InputStream decryptBytes(XEEncryptedData ed, java.security.PrivateKey keyDecKey) throws XEException
ed
- The EncryptedData element to decryptkeyDecKey
- The key decryption keyXEException
|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |