Springboot Rest Api parameter encrypt by using apache camel

老子叫甜甜 提交于 2020-02-15 06:45:48

问题


I want to encrypt rest api path parameter in apache camel(springboot) spring dsl . I have tried different methods using crypto dataformat on camel but it was not working.

I have added camel crypto 2.14.0

I am new in this technology.i know the below code is wrong. I tried Below code

<route streamCache="true" trace="true" errorHandlerRef="globalErrorHandler">

    <from uri="direct:getCustomerPortfolio" />
    <to uri="direct-vm:routeProcessor" />
    <setHeader headerName="CamelHttpMethod"><constant></constant><constant>GET</constant></setHeader>
    <log message="ID: ${header.id}"/>
    <marshal>             
        <crypto shouldAppendHMAC="true" initVectorRef="init" inline="true" algorithm="DES/CBC/PKCS5Padding" keyRef="cryptoKey" />
    </marshal>
    <to uri="{{base.url}}{{customerPortfolio.url}}${header.id}?view=${header.view}" />
    <log message="body: ${body}"/>
    <unmarshal>              
        <crypto shouldAppendHMAC="true" initVectorRef="init" inline="true" algorithm="DES/CBC/PKCS5Padding" keyRef="cryptoKey" />
    </unmarshal>
    <toD uri="{{base.url}}{{customerPortfolio.url}}${header.id}.encrypted?view=${header.view}" />   
</route>

My main agenda is I need to encrypt ${header.id} only Id value which is coming in rest api

please help me to resolve this issue. Give me some idea also

Advance thanks for your help

来源:https://stackoverflow.com/questions/60192395/springboot-rest-api-parameter-encrypt-by-using-apache-camel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!