Red Hat AMQ 6
As of February 2025, Red Hat is no longer supporting Red Hat AMQ 6. If you are using AMQ 6, please upgrade: Migrating to AMQ 7.Este contenido no está disponible en el idioma seleccionado.
6.3. Using Encrypted Property Placeholders
Overview Copiar enlaceEnlace copiado en el portapapeles!
- Create a properties file with encrypted values.
- Add the proper namespaces to your blueprint file.
- Import the properties using the Aries property placeholder extension.
- Configure the Jasypt encryption algorithm.
- Use the placeholders in your blueprint file.
- Ensure that the Jasypt features are installed into the Red Hat JBoss A-MQ container.
Encrypted properties Copiar enlaceEnlace copiado en el portapapeles!
ENC() function as shown in Example 6.8, “Property File with an Encrypted Property”.
Example 6.8. Property File with an Encrypted Property
#ldap.properties ldap.password=ENC(amIsvdqno9iSwnd7kAlLYQ==) ldap.url=ldap://192.168.1.74:10389
#ldap.properties
ldap.password=ENC(amIsvdqno9iSwnd7kAlLYQ==)
ldap.url=ldap://192.168.1.74:10389
Namespaces Copiar enlaceEnlace copiado en el portapapeles!
- Aries extensions—
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0 - Apache Karaf Jasypt—
http://karaf.apache.org/xmlns/jasypt/v1.0.0
Example 6.9. Encrypted Property Namespaces
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0" xmlns:enc="http://karaf.apache.org/xmlns/jasypt/v1.0.0"> ... </blueprint>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xmlns:enc="http://karaf.apache.org/xmlns/jasypt/v1.0.0">
...
</blueprint>
Placeholder extension Copiar enlaceEnlace copiado en el portapapeles!
property-paceholder element to you blueprint file. As shown in Example 6.10, “Aries Placeholder Extension”, it must come before the Jasypt configuration or the use of placeholders.
Example 6.10. Aries Placeholder Extension
property-paceholder element's location child specifies the location of the property file that contains the properties to use for the configuration. You can specify multiple files by using multiple location children.
Jasypt configuration Copiar enlaceEnlace copiado en el portapapeles!
property-placeholder element. It has one child, encoder, that contains the actual Jasypt configuration.
encoder element's mandatory class attribute specifies the fully qualified classname of the Jasypt encryptor to use for decrypting the properties. The encoder element can take a property child that defines a Jasypt PBEConfig bean for configuring the encryptor.
Example 6.11. Jasypt Blueprint Configuration
Placeholders Copiar enlaceEnlace copiado en el portapapeles!
${prop.name}.
Example 6.12. Jasypt Blueprint Configuration
${ldap.password} placeholder will be replaced with the decrypted value of the ldap.password property from the properties file.
Installing the Jasypt features Copiar enlaceEnlace copiado en el portapapeles!
jasypt-encryption feature using the features:install command as shown in Example 6.13, “Installing the Jasypt Feature”.
Example 6.13. Installing the Jasypt Feature
karaf@root> features:install jasypt-encryption
karaf@root> features:install jasypt-encryption