|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.osesb.utilities.encryption.JCESymmetricEncryptionHelper
org.osesb.utilities.encryption.XMLSymmetricEncryptionHelper
public class XMLSymmetricEncryptionHelper
This class extends JCEEncryptionHelper, adding methods for encrypting org.w3c.dom.Element(s) and Attributes (org.w3c.dom.Attr) using symmetric keys with JCE.
Construct this Class with an EncryptionProviderConfiguration or use getXMLSymmetricEncryptionHelper() to get a XMLEncryptionHelper using a EncryptionProviderConfiguration file that has been configured for the framework.
| Field Summary |
|---|
| Fields inherited from class org.osesb.utilities.encryption.JCESymmetricEncryptionHelper |
|---|
DEFAULT_ENCRYPTION_PROVIDER_CONFIGFILE, ENCRYPTION_PROVIDER_CONFIGFILE_PROPERTY, encryptionKey, encryptionProviderConfiguration, log, thisClassName |
| Constructor Summary | |
|---|---|
XMLSymmetricEncryptionHelper(EncryptionProviderConfiguration encryptionProviderConfiguration)
Creates a new instance of XMLEncryptionHelper with the EncryptionProviderConfiguration. |
|
| Method Summary | |
|---|---|
void |
encryptAttributeValue(org.w3c.dom.Attr attribute)
Encrypts the value of a DOM Attribute. |
void |
encryptAttributeValue(org.w3c.dom.Attr attribute,
java.lang.String prefix)
Encrypts the value of a DOM Attribute and prepends a prefix to the encrypted value. |
void |
encryptElementValue(org.w3c.dom.Element element)
Encrypts the value of a DOM Element. |
void |
encryptElementValue(org.w3c.dom.Element element,
java.lang.String prefix)
Encrypts the value of a DOM Element and prepends a prefix to the encrypted value. |
void |
encryptElementValueAndAddAttribute(org.w3c.dom.Element element,
java.lang.String attributeName,
java.lang.String attributeValue)
Encrypts the value of a DOM Element and adds an Attribute to the Element with the specified name and value. |
void |
encryptNodeValue(org.w3c.dom.Node node)
Encrypts the value of a DOM Node (Element or Attribute). |
void |
encryptNodeValue(org.w3c.dom.Node node,
java.lang.String prefix)
Encrypts the value of a DOM Node and prepends a prefix to the encrypted value. |
static XMLSymmetricEncryptionHelper |
getXMLSymmetricEncryptionHelper()
Construct and return a new instance of XMLEncryptionHelper, using the following ordered lookup: 1. |
static void |
main(java.lang.String[] args)
main() for sandboxing and testing. |
| Methods inherited from class org.osesb.utilities.encryption.JCESymmetricEncryptionHelper |
|---|
decryptBase64String, decryptByteArray, encryptByteArray, encryptToBase64String, generateKey, getEncryptionKey, getJCESymmetricEncryptionHelper, getProvidersInfo, readKeyObjectFromFile, readKeyObjectFromPath, readKeyObjectFromResource, setEncryptionKey, writeKeyObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLSymmetricEncryptionHelper(EncryptionProviderConfiguration encryptionProviderConfiguration)
throws java.lang.Exception
encryptionProviderConfiguration - The EncryptionProviderConfiguration
object to use for this helper.
java.lang.Exception - if constructed with null EncryptionProviderConfiguration
or if there is a problem loading the encryption provider or reading the
encryption key.| Method Detail |
|---|
public static XMLSymmetricEncryptionHelper getXMLSymmetricEncryptionHelper()
throws java.lang.Exception
java.lang.Exception - if an instance of XMLEncryptionHelper cannot be returned.
public void encryptNodeValue(org.w3c.dom.Node node)
throws java.lang.Exception
node - The DOM Node to encrypt.
java.lang.Exception
public void encryptNodeValue(org.w3c.dom.Node node,
java.lang.String prefix)
throws java.lang.Exception
node - The DOM Node to encrypt.prefix - The prefix to prepend to the encrypted Node's value.
java.lang.Exception
public void encryptElementValue(org.w3c.dom.Element element)
throws java.lang.Exception
element - The DOM Element to encrypt.
java.lang.Exception
public void encryptElementValue(org.w3c.dom.Element element,
java.lang.String prefix)
throws java.lang.Exception
element - The DOM Element to encrypt.prefix - The prefix to prepend to the encrypted Element's value.
java.lang.Exception
public void encryptElementValueAndAddAttribute(org.w3c.dom.Element element,
java.lang.String attributeName,
java.lang.String attributeValue)
throws java.lang.Exception
element - The DOM Element to encrypt.attributeName - The name of the Attribute to add to the Element.attributeValue - The value of the Attribute to add to the Element.
java.lang.Exception
public void encryptAttributeValue(org.w3c.dom.Attr attribute)
throws java.lang.Exception
attribute - The DOM Attribute to encrypt.
java.lang.Exception
public void encryptAttributeValue(org.w3c.dom.Attr attribute,
java.lang.String prefix)
throws java.lang.Exception
attribute - The DOM Attribute to encrypt.prefix - The prefix to prepend to the encrypted Attribute's value.
java.lang.Exceptionpublic static void main(java.lang.String[] args)
args - commandline arguments
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||