javax.xml.crypto.enc.dom
Class DOMEncryptContext
- java.lang.Object
-
- javax.xml.crypto.dom.DOMCryptoContext
-
- javax.xml.crypto.enc.dom.DOMEncryptContext
-
- All Implemented Interfaces:
- XMLEncryptContext, XMLCryptoContext
public class DOMEncryptContext extends DOMCryptoContext implements XMLEncryptContext
A DOM-specificXMLEncryptContext.
-
-
Field Summary
Fields Modifier and Type Field and Description private EncryptionMethodencMethodprivate javax.crypto.spec.IvParameterSpecivSpecprivate org.w3c.dom.NodenextSiblingprivate org.w3c.dom.Nodeparent
-
Constructor Summary
Constructors Constructor and Description DOMEncryptContext(java.security.Key key)Creates aDOMEncryptContextwith the specified encryption key.DOMEncryptContext(java.security.Key key, org.w3c.dom.Node parent)Creates aDOMEncryptContextwith the specified encryption key and parent node.DOMEncryptContext(java.security.Key key, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)Creates aDOMEncryptContextwith the specified key, parent and next sibling nodes.DOMEncryptContext(KeySelector ks)Creates aDOMEncryptContextwith the specified encryption key selector.DOMEncryptContext(KeySelector ks, org.w3c.dom.Node parent)Creates aDOMEncryptContextwith the specified encryption key selector and parent node.DOMEncryptContext(KeySelector ks, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)Creates aDOMEncryptContextwith the specified key selector, parent and next sibling nodes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description EncryptionMethodgetEncryptionMethod()Returns the EncryptionMethod for encryption if an EncryptionMethod will not be present in the EncryptedTypejavax.crypto.spec.IvParameterSpecgetIvParameterSpec()Returns the IvParameterSpec to be use for block encryption if an initialization vector is needed.org.w3c.dom.NodegetNextSibling()Returns the nextSibling node.org.w3c.dom.NodegetParent()Returns the parent node.voidsetEncryptionMethod(EncryptionMethod encMethod)Specifies the EncryptionMethod for encryption if an EncryptionMethod will not be present in the EncryptedTypevoidsetIvParameterSpec(javax.crypto.spec.IvParameterSpec ivSpec)Specifies the IvParameterSpec for block encryption if an initialization vector is needed.voidsetNextSibling(org.w3c.dom.Node nextSibling)Sets the next sibling node.voidsetParent(org.w3c.dom.Node parent)Sets the parent node.-
Methods inherited from class javax.xml.crypto.dom.DOMCryptoContext
get, getBaseURI, getDefaultNamespacePrefix, getElementById, getKeySelector, getNamespacePrefix, getProperty, getURIDereferencer, iterator, put, putNamespacePrefix, setBaseURI, setDefaultNamespacePrefix, setIdAttributeNS, setKeySelector, setProperty, setURIDereferencer
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.xml.crypto.XMLCryptoContext
get, getBaseURI, getDefaultNamespacePrefix, getKeySelector, getNamespacePrefix, getProperty, getURIDereferencer, put, putNamespacePrefix, setBaseURI, setDefaultNamespacePrefix, setKeySelector, setProperty, setURIDereferencer
-
-
-
-
Field Detail
-
parent
private org.w3c.dom.Node parent
-
nextSibling
private org.w3c.dom.Node nextSibling
-
encMethod
private EncryptionMethod encMethod
-
ivSpec
private javax.crypto.spec.IvParameterSpec ivSpec
-
-
Constructor Detail
-
DOMEncryptContext
public DOMEncryptContext(KeySelector ks)
Creates aDOMEncryptContextwith the specified encryption key selector.- Parameters:
ks- the key selector- Throws:
java.lang.NullPointerException- ifksisnull
-
DOMEncryptContext
public DOMEncryptContext(java.security.Key key)
Creates aDOMEncryptContextwith the specified encryption key.- Parameters:
key- the encryption key- Throws:
java.lang.NullPointerException- ifkeyisnull
-
DOMEncryptContext
public DOMEncryptContext(KeySelector ks, org.w3c.dom.Node parent)
Creates aDOMEncryptContextwith the specified encryption key selector and parent node. The marshalledEncryptedTypewill be added as the last child element of the specified parent node unless a next sibling node is specified by invoking thesetNextSiblingmethod.- Parameters:
ks- the key selectorparent- the parent node- Throws:
java.lang.NullPointerException- ifksorparentisnull
-
DOMEncryptContext
public DOMEncryptContext(java.security.Key key, org.w3c.dom.Node parent)Creates aDOMEncryptContextwith the specified encryption key and parent node. The marshalledEncryptedTypewill be added as the last child element of the specified parent node unless a next sibling node is specified by invoking thesetNextSiblingmethod.- Parameters:
key- the encryption keyparent- the parent node- Throws:
java.lang.NullPointerException- ifkeyorparentisnull
-
DOMEncryptContext
public DOMEncryptContext(KeySelector ks, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)
Creates aDOMEncryptContextwith the specified key selector, parent and next sibling nodes. The marshalledEncryptedTypewill be inserted as a child element of the specified parent node and immediately before the specified next sibling node.- Parameters:
ks- the key selectorparent- the parent nodenextSibling- the next sibling node- Throws:
java.lang.NullPointerException- ifks,parentornextSiblingisnull
-
DOMEncryptContext
public DOMEncryptContext(java.security.Key key, org.w3c.dom.Node parent, org.w3c.dom.Node nextSibling)Creates aDOMEncryptContextwith the specified key, parent and next sibling nodes. The marshalledEncryptedTypewill be inserted as a child element of the specified parent node and immediately before the specified next sibling node.- Parameters:
key- the encryption keyparent- the parent nodenextSibling- the next sibling node- Throws:
java.lang.NullPointerException- ifkey,parentornextSiblingisnull
-
-
Method Detail
-
getIvParameterSpec
public javax.crypto.spec.IvParameterSpec getIvParameterSpec()
Description copied from interface:XMLEncryptContextReturns the IvParameterSpec to be use for block encryption if an initialization vector is needed.- Specified by:
getIvParameterSpecin interfaceXMLEncryptContext- Returns:
- the IvParameterSpec to be used for block encryption
-
setIvParameterSpec
public void setIvParameterSpec(javax.crypto.spec.IvParameterSpec ivSpec)
Description copied from interface:XMLEncryptContextSpecifies the IvParameterSpec for block encryption if an initialization vector is needed. It is recommended to not to reuse the IvParameterSpec for different encryption instances.- Specified by:
setIvParameterSpecin interfaceXMLEncryptContext- Parameters:
ivSpec- the initialization vector for block encryption
-
getEncryptionMethod
public EncryptionMethod getEncryptionMethod()
Description copied from interface:XMLEncryptContextReturns the EncryptionMethod for encryption if an EncryptionMethod will not be present in the EncryptedType- Specified by:
getEncryptionMethodin interfaceXMLEncryptContext- Returns:
- the EncryptionMethod for encryption
-
setEncryptionMethod
public void setEncryptionMethod(EncryptionMethod encMethod)
Description copied from interface:XMLEncryptContextSpecifies the EncryptionMethod for encryption if an EncryptionMethod will not be present in the EncryptedType- Specified by:
setEncryptionMethodin interfaceXMLEncryptContext- Parameters:
encMethod- the EncryptionMethod for encryption
-
setParent
public void setParent(org.w3c.dom.Node parent)
Sets the parent node.- Parameters:
parent- the parent node. The marshalledEncryptedTypewill be added as a child element of this node.- Throws:
java.lang.NullPointerException- ifparentisnull- See Also:
getParent()
-
setNextSibling
public void setNextSibling(org.w3c.dom.Node nextSibling)
Sets the next sibling node.- Parameters:
nextSibling- the next sibling node. The marshalledEncryptedTypewill be inserted immediately before this node. Specifynullto remove the current setting.- See Also:
getNextSibling()
-
getParent
public org.w3c.dom.Node getParent()
Returns the parent node.- Returns:
- the parent node, or
nullif not specified - See Also:
setParent(Node)
-
getNextSibling
public org.w3c.dom.Node getNextSibling()
Returns the nextSibling node.- Returns:
- the nextSibling node, or
nullif not specified. - See Also:
setNextSibling(Node)
-
-