Hello, Has anybody worked on PGP key generation a...
# general
r
Hello, Has anybody worked on PGP key generation and encrypting the file using PGP Key?
r
Thanks michoel for your help I have gone through the thread and tried using PGP libraries but didn’t get any success. While creating the script getting error as “SuiteScript 2.1 entry point scripts must implement one script type function.” When i tried to use script debugger its navigating to the Chrome Dev Tools and showing an alert message as shown in screenshot.
Can you please help me with these issues?
w
Which script are you trying to create?
r
Suitelet script if you have any working example, please provide it
define([‘N/log’, ‘N/runtime’, ‘N/file’, ‘N/search’, ‘N/record’, ‘/SuiteScripts/TVG Scripts/OpenPGP.js’], function(log, runtime, file, search, record, openpgp) { /** * Defines the Suitelet script trigger point. * @param {Object} scriptContext * @param {ServerRequest} scriptContext.request - Incoming request * @param {ServerResponse} scriptContext.response - Suitelet response * @since 2015.2 */ function onRequest(scriptContext) { log.audit(‘start script’); } return { onRequest: onRequest }; });
this is the sample we are trying it but we are getting an error while creating the script “SuiteScript 2.1 entry point scripts must implement one script type function.”
b
Expect to put in much more work than that
Openpgp expects browser or node globals to exist
You will have to fake those globals and create them yourself
A lot of the linked thread is about how to do that
s
Just saw this, I have worked with open PGP before, you'll need to find a node.js library then use shim to add it to your library in 2.1. It is possible, but I will not be able to share how it's done for free
w
@Sciuridae54696d Maybe just be quiet then?
👍 1
@raju You clearly didn't read through the thread that michoel posted as it shows you how to do it. The only code missing is the actual openpgp.js library that you can get from github.
s
@Watz I didn't see your work included in the like in the #C29HQS63G channel which you've provided as a solution and so I apologise, I was just trying to say it was possible, and in the most high level describe what must be done to get in working. And yes, the solution posted by you does work for sure. Apologies and thanks