In this recipe, you will learn how to secure and protect our password, still providing them to our WildFly configuration. The vault is a place where you store passwords, encrypted using a keystore. For our recipe, we will create a keystore and store a password used to connect to the MySQL database. MySQL installation is out of the scope of this book; if you need more information, refer to the MySQL documentation site at https://dev.mysql.com/doc/refman/5.5/en/installing.html.
To get started, let's first create an ad-hoc
folder to run our WildFly:
In a terminal window run the following commands:
$ cd $WILDFLY_HOME $ cp -a standalone sec-std-cfg-node-3
Now it's time to create our keystore.
Within the same terminal window, execute the following:
$ cd $WILDFLY_HOME $ cd sec-std-cfg-node-3/configuration $ mkdir vault $ cd vault $ keytool -v -genkey -alias wildfly.vault -keyalg RSA -keysize 2048 -sigalg SHA1withRSA -keystore wildfly.vault...