Este contenido no está disponible en el idioma seleccionado.
17.2. Configured Identity with Password Based Encryption (PBE)
org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule
is a login module for statically defining a data source using a password that has been encrypted by a JaasSecurityDomain. The base64 format of the data source password may be generated using PBEUtils:
Procedure 17.4. Encrypt password with PBEUtils - Platforms version 5.0 and 5.0.1
- Execute the command:
java -cp jboss-as/common/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \ salt count domain-password data-source-password
java -cp jboss-as/common/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \ salt count domain-password data-source-password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Result:The encrypted password is displayed
Procedure 17.5. Encrypt password with PBEUtils - Platform version 5.1
- Execute the command:
java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \ salt count domain-password data-source-password
java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.PBEUtils \ salt count domain-password data-source-password
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Result:The encrypted password is displayed
PBEUtils
are:
- salt
- The Salt attribute from the JaasSecurityDomain (Must only be eight characters long).
- count
- The IterationCount attribute from the JaasSecurity domain.
- domain-password
- The plain text password that maps to the KeyStorePass attribute from the JaasSecurityDomain.
- data-source-password
- The plain text password for the data source that should be encrypted with the JaasSecurityDomain password.
Example 17.3. PBEUtils command example
java -cp jbosssx.jar org.jboss.security.plugins.PBEUtils abcdefgh 13 master password Encoded password: 3zbEkBDfpQAASa3H39pIyP
java -cp jbosssx.jar org.jboss.security.plugins.PBEUtils abcdefgh 13 master password
Encoded password: 3zbEkBDfpQAASa3H39pIyP
$JBOSS_HOME/server/$PROFILE/conf/login-config.xml
file.
$JBOSS_HOME/docs/examples/jca/hsqldb-encrypted-ds.xml
illustrates that data source configuration along with the JaasSecurityDomain configuration for the keystore:
Example 17.4. FilePassword command example
.../conf/server.password
. You first need to run the following command, which will store the encryption details and obfuscated master password:
java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword salt count master_password password_file For example: java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword abcdefgh 13 master jboss-as/server/$PROFILE/conf/server.password
java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword salt count master_password password_file
For example: java -cp jboss-as/lib/jbosssx.jar org.jboss.security.plugins.FilePassword abcdefgh 13 master jboss-as/server/$PROFILE/conf/server.password
Warning
Note
java.security.InvalidAlgorithmParameterException: Parameters missing
is raised when the following MBean is not yet started as a service:
(jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword)
(jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword)
hsqldb-encrypted-ds.xml
code shown previously.
<depends>jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</depends>
<depends>jboss.security:service=JaasSecurityDomain,domain=ServerMasterPassword</depends>