Creating a Keystore Containing a User Name and Password

You can create a keystore that contains a username and password by editing data and build files and running an Ant script.

Procedure

  1. Go to the CONFIG_HOME/admin/enterpriseName/samples/ directory.
  2. Open the keystore_data.xml data file and edit the following attributes of the CredentialEntry element:
    Attribute Description
    alias Alias identifying the keystore entry
    protectionParam Password that protects the keystore entry
    username Username
    secret Password
  3. Open the keystore_build.xml build file and edit the following attributes of the AMXKeyStoreTask element in the addCredential target:
    Attribute Description
    adminKeyStorelocation The name of the file to contain the keystore.
    adminKeyStorePassword The password protecting the keystore.
  4. Run ant -f keystore_build.xml addCredential.

Example

<?xml version="1.0" encoding="UTF-8"?>
<amxdata_base:Enterprise
	xmlns:amxdata="http://tibco.com/amxadministrator/command/line/types"
	xmlns:amxdata_base="http://tibco.com/amxadministrator/command/line/types_base"
	xmlns:amxdata_reference="http://tibco.com/amxadministrator/command/line/types_reference"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://tibco.com/amxadministrator/command/line/types_base ../schemas/amxdata_base.xsd http://tibco.com/amxadministrator/command/line/types ../schemas/amxdata.xsd">

	<AMXKeyStore xsi:type="amxdata:AMXKeyStore">
		<CredentialEntry alias="myDatabase" protectionParam="databaseKeyAliasPassword" username="scott" secret="tiger" />
		<CredentialEntry alias="myLDAP" protectionParam="ldapKeyAliasPassword" username="cn=Manager,dc=example,dc=com" secret="password" />
	</AMXKeyStore>
	
</amxdata_base:Enterprise>

<target name="addCredential">
     <AMXKeyStoreTask
         dataFile="keystore_data.xml"
         adminKeyStorelocation = "my_keystore.jceks" 
         adminKeyStorePassword = "password" 
         action="add"/>
</target>
>ant -f keystore_build.xml addCredential
Buildfile: C:\amx330data\admin\amxadmin\samples\keystore_build.xml

addCredential:
[AMXKeyStoreTask]  INFO - Keystore file C:\amx330data\admin\amxadmin\samples\my_keystore.jceks does not exist; creat
ing a new keystore file
[AMXKeyStoreTask] Adding entry for alias 'myDatabase'...
[AMXKeyStoreTask] Adding entry for alias 'myLDAP'...
[AMXKeyStoreTask] Saving to keystore file C:\amx330data\admin\amxadmin\samples\my_keystore.jceks

BUILD SUCCESSFUL
Total time: 12 seconds