git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SSLContextParameters value injection with a static method invocation


Hi,

I have sslContextParameters as below as an example.

    <camel:sslContextParameters
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="{{ssl.keymanager.pass}}">
      <camel:keyStore
          resource="C:\\Program
Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
          password="{{ssl.keystore.pass}}"/>
    </camel:keyManagers>
  </camel:sslContextParameters>

and i have the requirement that those {{ssl.keymanager.pass}} and
{{ssl.keystore.pass}} values which are stored in an encrypted format.
And i want to decrypt them and then inject their values to password
attributes in this xml definition.

I have a single method which i can find out the decrypted value, but not
sure how i can inject.
I think only properties components with {{ is supported whereas SPEL is not.

I tried like this;

<camel:sslContextParameters
      id="sslContextParameters">
    <camel:keyManagers
        keyPassword="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}">
      <camel:keyStore
          resource="C:\\Program
Files\\Java\\jdk1.8.0_161\\jre\\lib\\security\\cacerts"
          password="#{ T(MY_PACKAGE).decrypt('${ssl.keystore.pass}')}"/>
    </camel:keyManagers>
  </camel:sslContextParameters>

Is there any other way i can inject?

Thanks.