|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.security.xmlsec.util.XMLNode
oracle.security.xmlsec.util.XMLElement
oracle.security.xmlsec.enc.XEEncryptedObject
oracle.security.xmlsec.enc.XEEncryptedKey
public class XEEncryptedKey
This class represents an XML-ENC EncryptedKey element. The following algorithms for encrypting keys for the block encryption algorithms Triple-DES, AES-128, AES-196, AES-256, are supported:
XEEncryptionMethod
, XEEncryptedObject
, XEEncryptedData
, XEKeyInfo
Field Summary |
---|
Fields inherited from class oracle.security.xmlsec.util.XMLNode |
---|
node, systemId |
Constructor Summary | |
---|---|
XEEncryptedKey(org.w3c.dom.Document doc) Create a new XEEncryptedKey instance with the given XML Document context. |
|
XEEncryptedKey(org.w3c.dom.Document doc, java.lang.String id) Create a new XEEncryptedKey instance with the given XML Document context and the id. |
|
XEEncryptedKey(org.w3c.dom.Element encKey) Create a XEEncryptedKey instance from the given EncryptedKey element. |
|
XEEncryptedKey(org.w3c.dom.Element encKey, java.lang.String systemId) Create a XEEncryptedKey instance from the given EncryptedKey element. |
Method Summary | |
---|---|
void |
addReference(XEReference ref) Add an XEReference instance for an EncryptedData or EncryptedKey element encrypted using the key being encrypted in this structure. |
byte[] |
decrypt(XEEncryptionMethod ceEncMethod) Decrypt the cipher value specified in the CipherData child element in this EncryptedKey element. |
byte[] |
decrypt(XEEncryptionMethod ceEncMethod, java.security.Key keyDecKey) Decrypt the cipher value specified in the CipherData child element in this EncryptedKey element, with the given decryption key. |
byte[] |
encrypt(byte[] contentKeyBytes) Encrypt the content encryption key bytes with the given key encryption key. |
byte[] |
encrypt(byte[] contentKeyBytes, java.security.Key keyEncKey) Encrypt the content encryption key bytes with the given key encryption key. |
byte[] |
encrypt(javax.crypto.SecretKey contentKey) Encrypt the content encryption key with the given key encryption key. |
byte[] |
encrypt(javax.crypto.SecretKey contentKey, java.security.Key keyEncKey) Encrypt the content encryption key with the given key encryption key. |
void |
encryptKey(javax.crypto.SecretKey contentKey, java.security.Key keyEncKey, java.lang.String keyEncKeyName) Encrypt the content encryption key with the given key encryption key, and store the encrypted key inside this EncryptedKey element. |
java.lang.String |
getCarriedKeyName() Return the key name identifying the key being encrypted. |
java.util.Vector |
getDataReferences() Get XEDataReference objects refer EncryptedData elements encrypted using the key being encrypted in this structure. |
javax.crypto.SecretKey |
getKey(XEEncryptionMethod ceEncMethod) Get the content encryption key being encrypted in this EncryptedKey element. |
javax.crypto.SecretKey |
getKey(XEEncryptionMethod ceEncMethod, java.security.Key keyDecKey) Get the content encryption key being encrypted in this EncryptedKey element. |
java.util.Vector |
getKeyReferences() Get the XEKeyReference objects for EncryptedKey elements that were encrypted using the key being encrypted in this structure. |
java.lang.String |
getRecipient() Returns the value of the Recipient attribute, which indicates the recipient of this encrypted key value. |
java.lang.String |
getType() Returns the type URI for an EncryptedKey element. |
static XEEncryptedKey |
newInstance() Creates a new XEEncryptedKey instance in a new owner document, and makes it the root element of the document. |
static XEEncryptedKey |
newInstance(org.w3c.dom.Document doc) Creates a new XEEncryptedKey instance in the given owner document, but does not append it to any element. |
static XEEncryptedKey |
newInstance(org.w3c.dom.Document doc, java.lang.String id) Creates a new XEEncryptedKey instance in the given owner document, but does not append it to any element. |
static XEEncryptedKey |
newInstance(java.lang.String id) Creates a new XEEncryptedKey instance in a new owner document, and makes it the root element of the document. |
void |
setCarriedKeyName(java.lang.String keyName) Set the CarriedKeyName child element for this EncryptedKey element. |
void |
setRecipient(java.lang.String recipient) Sets the Recipient attribute, which indicates the recipient of this encrypted key value. |
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 |
---|
public XEEncryptedKey(org.w3c.dom.Element encKey)
XEEncryptedKey
instance from the given EncryptedKey element.
encKey
- An EncryptedKey element.public XEEncryptedKey(org.w3c.dom.Element encKey, java.lang.String systemId)
XEEncryptedKey
instance from the given EncryptedKey element.
encKey
- An EncryptedKey element.systemId
- The URI string system ID for the XEEncryptedKey
.public XEEncryptedKey(org.w3c.dom.Document doc)
XEEncryptedKey
instance with the given XML Document context.
doc
- An XML Document to be used as the owner document of this element.public XEEncryptedKey(org.w3c.dom.Document doc, java.lang.String id)
XEEncryptedKey
instance with the given XML Document context and the id.
doc
- An XML Document to be used as the owner document of this element.id
- An optional Id string for this EncryptedKey element.Method Detail |
---|
public static XEEncryptedKey newInstance() throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public static XEEncryptedKey newInstance(java.lang.String id) throws org.w3c.dom.DOMException
id
- An optional Id string for this EncryptedKey element.org.w3c.dom.DOMException
public static XEEncryptedKey newInstance(org.w3c.dom.Document doc) throws org.w3c.dom.DOMException
doc
- An XML Document to be used as the owner document of this EncryptedKey element.org.w3c.dom.DOMException
public static XEEncryptedKey newInstance(org.w3c.dom.Document doc, java.lang.String id) throws org.w3c.dom.DOMException
doc
- An XML Document to be used as the owner document of this EncryptedKey element.id
- An optional Id string for this EncryptedKey element.org.w3c.dom.DOMException
public void setCarriedKeyName(java.lang.String keyName) throws org.w3c.dom.DOMException
keyName
- The name identifying the key to be encrypted.org.w3c.dom.DOMException
public java.lang.String getCarriedKeyName()
null
if not specifiedpublic void setRecipient(java.lang.String recipient) throws org.w3c.dom.DOMException
recipient
- The string name of this encrypted key's recipient.org.w3c.dom.DOMException
public java.lang.String getRecipient()
null
if the attribute is not set.public void addReference(XEReference ref) throws org.w3c.dom.DOMException
ref
- An XEReference instance.org.w3c.dom.DOMException
public java.util.Vector getDataReferences()
Vector
of XEDataReference
objects.public java.util.Vector getKeyReferences()
Vector
of XEKeyReference
objects.public java.lang.String getType()
getType
in interface KeyInfoData
XMLURI.obj_EncryptedKey
.public byte[] encrypt(byte[] contentKeyBytes, java.security.Key keyEncKey) throws XESchemaException, XECipherException
contentKeyBytes
- The key bytes of the content encryption key to be encrypted.keyEncKey
- The key to be used in encrypting the content encryption key bytes.XESchemaException
XECipherException
public byte[] encrypt(byte[] contentKeyBytes) throws XEException
The KeyInfo is used to locate the encryption key using the KeyRetriever
facility. If no KeyInfo is present, or if the encryption key cannot be retrieved, a XECipherException
is thrown. This method should NOT be used if the encryption key is identified by an EncryptedKey element.
contentKeyBytes
- The key bytes of the content encryption key to be encrypted.XEException
public byte[] encrypt(javax.crypto.SecretKey contentKey, java.security.Key keyEncKey) throws XESchemaException, XECipherException
contentKey
- The content encryption key to be encrypted.keyEncKey
- The key to be used in encrypting the content encryption key.XESchemaException
XECipherException
public void encryptKey(javax.crypto.SecretKey contentKey, java.security.Key keyEncKey, java.lang.String keyEncKeyName) throws XESchemaException, XECipherException
contentKey
- The content encryption key to be encrypted.keyEncKey
- The key to be used in encrypting the content encryption key.keyEncKeyName
- If non null, a KeyInfo with a KeyName will be created for this elementXESchemaException
XECipherException
public byte[] encrypt(javax.crypto.SecretKey contentKey) throws XEException
The KeyInfo is used to locate the encryption key using the KeyRetriever
facility. If no KeyInfo is present, or if the encryption key cannot be retrieved, a XECipherException
is thrown. This method should NOT be used if the encryption key is identified by an EncryptedKey element.
contentKey
- The content encryption key to be encrypted.XEException
public byte[] decrypt(XEEncryptionMethod ceEncMethod, java.security.Key keyDecKey) throws XESchemaException, XECipherException
ceEncMethod
- An XEEncryptionMethod
object identifying the content encryption algorithm for which the key encrypted in this structure is used.keyDecKey
- The key decryption key.XESchemaException
XECipherException
public byte[] decrypt(XEEncryptionMethod ceEncMethod) throws XEException
KeyRetriever
facility.ceEncMethod
- The EncryptionMethod for the content. NOT the EncryptionMethod for the encryption key. This is required, because just by looking at the EncryptedKey it is possible to decrypt into a sequence of bytes, but not possible to determine the encryption algorithm that those bytes should be used for.XEException
public javax.crypto.SecretKey getKey(XEEncryptionMethod ceEncMethod, java.security.Key keyDecKey) throws org.w3c.dom.DOMException, XEException
ceEncMethod
- The EncryptionMethod for the content. NOT the EncryptionMethod for the encryption key. This is required, because just by looking at the EncryptedKey it is possible to decrypt into a sequence of bytes, but not possible to determine the encryption algorithm that those bytes should be used for.keyDecKey
- The key used to decrypt the encrypted content key.org.w3c.dom.DOMException
XEException
public javax.crypto.SecretKey getKey(XEEncryptionMethod ceEncMethod) throws org.w3c.dom.DOMException, XEException
KeyRetriever
.ceEncMethod
- An XEEncryptionMethod
object identifying the content encryption algorithm for which the key encrypted in this structure is used.org.w3c.dom.DOMException
XEException
|
Oracle Fusion Middleware XML Security Java API Reference for Oracle Security Developer Tools 11g Release 1 (11.1.1) E10680-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |