Blueprint Property Placeholder with Custom Encryption

Solution Verified - Updated -

Issue

  • We are trying to figure out a way to use property placeholders in blueprint xml where the property files are using a custom encryption method (not jasypt). We have read in various documentation ways to decrypt values for placeholders using jasypt like so:
  <ext:property-placeholder>
    <location>file:etc/ldap.properties</location>
  </ext:property-placeholder>

  <enc:property-placeholder>
    <enc:encryptor class="com.fuse.TestBundle.PropertyPlaceholder">
      <property name="config">
        <bean class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
          <property name="algorithm" value="PBEWithMD5AndDES" />
          <property name="passwordEnvName" value="JASYPT_ENCRYPTION_PASSWORD" />
        </bean>
      </property>
    </enc:encryptor>
  </enc:property-placeholder>
  • Is there a way to achieve the same thing but instead of using jasypt for decryption we can pass the encrypted values to a bean we define for decryption?

  • I did find another example which seems to be a similar solution and in fact states "You can add a custom placeholder resolver to support a specific need, such as custom encryption" which is what we want. The link is fuse_on_openshift_guide, Section 11.4.4.

  • The problem we have is while we are able to implement the code into our project, we're missing the part that allows us to "glue" in the piece into Blueprint. So that when Blueprint reads the property file and see something like "ENC()" it knows to call the apply method.
  • If you're able to provide an example of section 11.4.4 in a project so we can see how it's called, that would be helpful.

Environment

  • Red Hat Fuse on Karaf
    • 7.8

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content