<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Client Side Encryption in SAP PI in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903203#M4470286</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For this you need to have the following (you have to be good with java). &lt;/P&gt;&lt;P&gt;1. JavaScript in one file&lt;/P&gt;&lt;P&gt;2. Read the javascript file inside a java code.. ( my choice is to use UDF as it is only one field and apply udf on that field)..&lt;/P&gt;&lt;P&gt;3. writing UDF to read an external file can be tedious job, so you can go for entire java code&lt;/P&gt;&lt;P&gt;import javax.script.*; &lt;/P&gt;&lt;P&gt;public class InvokeScript&lt;/P&gt;&lt;P&gt; { &lt;/P&gt;&lt;P&gt;public static void main(String[] args) throws Exception &lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;        ScriptEngineManager manager = new ScriptEngineManager(); &lt;/P&gt;&lt;P&gt;        ScriptEngine engine = manager.getEngineByName("JavaScript");&lt;/P&gt;&lt;P&gt;             engine.eval(Files.newBufferedReader(Paths.get("usr/sap/home/myjavascriptfile.js"),StandardCharsets.UTF_8));&lt;/P&gt;&lt;P&gt;Invocable inv = (Invocable) engine;&lt;/P&gt;&lt;P&gt;Object obj = inv.invokeFunction("functioninJavaSript", "fieldValue to encrypt");&lt;/P&gt;&lt;P&gt;return obj.toString()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2019 10:20:28 GMT</pubDate>
    <dc:creator>vicky20691</dc:creator>
    <dc:date>2019-05-13T10:20:28Z</dc:date>
    <item>
      <title>Client Side Encryption in SAP PI</title>
      <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaq-p/11903199</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;
  &lt;P&gt;My requirement is to send a SOAP request with encrypted card data (card number, expiry year, expiry month, holder name and cvc) to the payment card site.&lt;/P&gt;
  &lt;P&gt;Before sending the SOAP request to payment card site, the card data needs to be encrypted as per the client side encryption. To encrypt it, they have provided a java script which will encrypt the card data along with the public key configured in our account provided by payment card site.&lt;/P&gt;
  &lt;P&gt;The javascript will provide the key string which needs to be included in the SOAP request.&lt;/P&gt;
  &lt;P&gt;&lt;U&gt;Sample SOAP request,&lt;/U&gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;SOAP_request&amp;gt;&lt;/P&gt;
  &lt;P&gt; &lt;STRONG&gt;&amp;lt;encrypted_carddata&amp;gt; Key string generated using javascript &amp;lt;/encrypted_carddata&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;paymentAmount&amp;gt;500 &amp;lt;/paymentAmount&amp;gt;&lt;/P&gt;
  &lt;P&gt; &amp;lt;currency&amp;gt;EUR&amp;lt;/currency&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;/SOAP_request&amp;gt;&lt;/P&gt;
  &lt;P&gt;In the above SOAP request, the Java script needs to be executed separately with card data and it will provide the Key string which needs to be included in the main SOAP request.&lt;/P&gt;
  &lt;P&gt;Kindly provide your expert help on how to execute the java script for card encrytion in the main SOAP request.&lt;/P&gt;
  &lt;P&gt;Many Thanks&lt;/P&gt;
  &lt;P&gt;Melchior&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 13:29:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaq-p/11903199</guid>
      <dc:creator>melchior_periyanayagam</dc:creator>
      <dc:date>2019-05-09T13:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Client Side Encryption in SAP PI</title>
      <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903200#M4470283</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is already answered in below thread&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/questions/11907760/index.html"&gt;https://answers.sap.com/questions/11907760/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2012/12/14/pgp-encrypting-part-of-an-xml-message/"&gt;https://blogs.sap.com/2012/12/14/pgp-encrypting-part-of-an-xml-message/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Vikas&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2019 03:32:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903200#M4470283</guid>
      <dc:creator>vicky20691</dc:creator>
      <dc:date>2019-05-10T03:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Client Side Encryption in SAP PI</title>
      <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903201#M4470284</link>
      <description>&lt;P&gt;Thanks for your reply Vikas.&lt;/P&gt;&lt;P&gt;As per the compliance, we can't use the PGP encryption.&lt;/P&gt;&lt;P&gt;Our payment site has provided a javascript to encrypt the card data using the key defined for our account. My requirment is to encrypt the card data by executing the java script and key provided by them and the output key string needs to be included in the main SOAP request to the payment site.&lt;/P&gt;&lt;P&gt;Kindly provide your suggestion on how to run the javascript in SAP PI/PO for data encryption&lt;/P&gt;&lt;P&gt;Many Thanks&lt;/P&gt;&lt;P&gt;MP&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 07:24:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903201#M4470284</guid>
      <dc:creator>melchior_periyanayagam</dc:creator>
      <dc:date>2019-05-13T07:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: Client Side Encryption in SAP PI</title>
      <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903202#M4470285</link>
      <description>&lt;P&gt;may be you can try using java mapping to achieve this. please check if you are able to call java script from java program. You can google to check on how to call javascript from java code. &lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/22856279/call-external-javascript-functions-from-java-code"&gt;https://stackoverflow.com/questions/22856279/call-external-javascript-functions-from-java-code&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 10:06:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903202#M4470285</guid>
      <dc:creator>Muniyappan</dc:creator>
      <dc:date>2019-05-13T10:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Client Side Encryption in SAP PI</title>
      <link>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903203#M4470286</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;For this you need to have the following (you have to be good with java). &lt;/P&gt;&lt;P&gt;1. JavaScript in one file&lt;/P&gt;&lt;P&gt;2. Read the javascript file inside a java code.. ( my choice is to use UDF as it is only one field and apply udf on that field)..&lt;/P&gt;&lt;P&gt;3. writing UDF to read an external file can be tedious job, so you can go for entire java code&lt;/P&gt;&lt;P&gt;import javax.script.*; &lt;/P&gt;&lt;P&gt;public class InvokeScript&lt;/P&gt;&lt;P&gt; { &lt;/P&gt;&lt;P&gt;public static void main(String[] args) throws Exception &lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;        ScriptEngineManager manager = new ScriptEngineManager(); &lt;/P&gt;&lt;P&gt;        ScriptEngine engine = manager.getEngineByName("JavaScript");&lt;/P&gt;&lt;P&gt;             engine.eval(Files.newBufferedReader(Paths.get("usr/sap/home/myjavascriptfile.js"),StandardCharsets.UTF_8));&lt;/P&gt;&lt;P&gt;Invocable inv = (Invocable) engine;&lt;/P&gt;&lt;P&gt;Object obj = inv.invokeFunction("functioninJavaSript", "fieldValue to encrypt");&lt;/P&gt;&lt;P&gt;return obj.toString()&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2019 10:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/client-side-encryption-in-sap-pi/qaa-p/11903203#M4470286</guid>
      <dc:creator>vicky20691</dc:creator>
      <dc:date>2019-05-13T10:20:28Z</dc:date>
    </item>
  </channel>
</rss>

