org.osesb.configuration
Class EncryptionProviderConfiguration

java.lang.Object
  extended by org.osesb.configuration.XMLConfiguration
      extended by org.osesb.configuration.EncryptionProviderConfiguration

public class EncryptionProviderConfiguration
extends XMLConfiguration

Parses a encryption configuration content model in a XML configuration file and sets configurationProperties. Contains convenience methods for accessing encryption properties.

A EncryptionProviderConfiguration content model looks like:

<encryption-provider-configuration>
      <providerClassName>com.sun.crypto.provider.SunJCE</providerClassName>
      <encryptionAlgorithm>DES</encryptionAlgorithm>
      <keyFilePath>org/osesb/utilities/encryption/test/testdata/jce.des.encryption.test.key</keyFilePath>
  </encryption-provider-configuration>
 

Since:
Version .9

Field Summary
 
Fields inherited from class org.osesb.configuration.XMLConfiguration
configFilePath, configurationProperties, constructedFromConfigFile, contentModelElement, ftpClientConfiguration, jaxrpcClientConfiguration, jdbcConfiguration, jmsClientConfiguration, log, rootConfigurationAttributes, smtpClientConfiguration, systemProperties, thisClassName
 
Constructor Summary
EncryptionProviderConfiguration(org.w3c.dom.Element contentModelElement)
          Creates a new instance of EncryptionProviderConfiguration given the content model Element.
EncryptionProviderConfiguration(java.util.Properties configurationProperties)
          Creates a new instance of EncryptionProviderConfiguration given the configuration Properties.
EncryptionProviderConfiguration(java.lang.String configFile)
          Creates a new instance of EncryptionProviderConfiguration given a XML configuration file.
EncryptionProviderConfiguration(java.lang.String configFile, java.lang.String xpathExpression)
          Creates a new instance of EncryptionProviderConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration.
 
Method Summary
 java.lang.String getEncryptionAlgorithmName()
          Returns the name of the encryptionAlgorithm of the encryptionProviderConfiguration.
 java.lang.String getEncryptionProviderClassName()
          Returns the providerClassName of the encryptionProviderConfiguration.
 java.lang.String getKeyFilePath()
          Returns the path to the encryption key file.
 
Methods inherited from class org.osesb.configuration.XMLConfiguration
checkXMLConfigurationClass, clear, doEncryptionInstructions, getBooleanConfigurationProperty, getBooleanRootConfigurationAttribute, getConfigFilePath, getConfigurationAttribute, getConfigurationAttributes, getConfigurationElement, getConfigurationElements, getConfigurationProperties, getConfigurationProperty, getConfigurationProperty, getContentModelElement, getDebugFlag, getDocument, getEncryptionInstructions, getFTPClientConfiguration, getIntConfigurationProperty, getIntRootConfigurationAttribute, getJAXRPCClientConfiguration, getJDBCConfiguration, getJMSClientConfiguration, getLongConfigurationProperty, getLongRootConfigurationAttribute, getName, getRootConfigurationAttribute, getRootConfigurationAttributes, getSMTPClientConfiguration, getSystemProperties, getSystemProperty, isConfigurationElementEmpty, loadConfiguration, loadExternalConfiguration, loadFTPClientConfiguration, loadJAXRPCClientConfiguration, loadJDBCConfiguration, loadJMSClientConfiguration, loadPropertiesFromContentModel, loadSMTPClientConfiguration, loadSystemProperties, main, mergeConfigurationProperties, setConfigFilePath, setConfigurationProperty, setDebugFlag, setFTPClientConfiguration, setJAXRPCClientConfiguration, setJDBCConfiguration, setJMSClientConfiguration, setName, setRootConfigurationAttribute, setSMTPClientConfiguration, setSystemProperties, setSystemProperty, toString, writeConfigurationFile, writeConfigurationFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EncryptionProviderConfiguration

public EncryptionProviderConfiguration(java.lang.String configFile)
                                throws java.lang.Exception
Creates a new instance of EncryptionProviderConfiguration given a XML configuration file. The root element of the XML configuration file is the starting element for the configuration.

Parameters:
configFile - The path to the XML configuration file, which is specified as a resource path or as a file system path that is relative to the path specified by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY System Property.
Throws:
java.lang.Exception - if there is a problem reading or parsing the configuration file.

EncryptionProviderConfiguration

public EncryptionProviderConfiguration(java.lang.String configFile,
                                       java.lang.String xpathExpression)
                                throws java.lang.Exception
Creates a new instance of EncryptionProviderConfiguration given a XML configuration file and a XPath expression that evaluates to the element that marks the beginning of the configuration.

An empty xpathExpression implies that the root element of the XML configuration file is the starting element for the configuration.

Parameters:
configFile - The path to the XML configuration file, which is specified as a resource path or as a file system path that is relative to the path specified by the ConfigurationConstants.CONFIG_PATH_SYSTEMPROPERTY System Property.
xpathExpression - A XPath expression that evaluates to the element that marks the beginning of the configuration. If following the framework convention for EncryptionProviderConfiguration(s), xpathExpression should have 'encryption-provider-configuration' as the last Element in the path.
Throws:
java.lang.Exception - if there is a problem reading or parsing the configuration file.

EncryptionProviderConfiguration

public EncryptionProviderConfiguration(org.w3c.dom.Element contentModelElement)
                                throws java.lang.Exception
Creates a new instance of EncryptionProviderConfiguration given the content model Element.

Parameters:
contentModelElement - The top level Element for the for the configuration.
Throws:
java.lang.Exception - if there is a fatal error transversing the configuration content model enclosed by contentModelElement.

EncryptionProviderConfiguration

public EncryptionProviderConfiguration(java.util.Properties configurationProperties)
Creates a new instance of EncryptionProviderConfiguration given the configuration Properties.

Parameters:
configurationProperties - Configuration name / value pairs as Properties.
Method Detail

getEncryptionProviderClassName

public java.lang.String getEncryptionProviderClassName()
Returns the providerClassName of the encryptionProviderConfiguration. Example: com.sun.crypto.provider.SunJCE.

Returns:
the providerClassName of the encryptionProviderConfiguration.

getEncryptionAlgorithmName

public java.lang.String getEncryptionAlgorithmName()
Returns the name of the encryptionAlgorithm of the encryptionProviderConfiguration. Example: 'DES'.

Returns:
the name of the encryptionAlgorithm of the encryptionProviderConfiguration.

getKeyFilePath

public java.lang.String getKeyFilePath()
Returns the path to the encryption key file.

Returns:
the path to the encryption key file.