openpgp.js is not working in Outsystems reactive web application.

We got the requirement to encrypt and decrypt the text using openpgp.js JavaScript library.

It is working fine with plain HTML page just by referring  .Js file in the header  section as mentioned below.



<script src="openpgp.js"></script>

But when tried to achieve the same in outsystems reactive web application I am getting the following error. When I try to run the reactive webpage which is using openpgp.js.

I followed the following  steps to incorporate the openpgp.js with outsystems.

  1. Initially I have added openpgp.js file under scripts folder.
  2. Added the Script reference in the to the webpage.
  3. When I try to load the webpage I am getting the following error.
  4. To resolve the above issue I called the openpgp.js  file on initialization as mentioned below .

      5.Now I can able  to load the openpgp.js file and I can see the reference in sources of webpage.

6.The problem which I am facing is I am not able to call any functions like encrtpt(), Decrypt() from openpgp.js file.

7. When I try to call the encrypt() function from openpgp.js as shown in the above screenshot, I am getting the following error ( openpgp is not defined ).