When you use the
This module can either run to completion and terminate or it can define a set of functions and variables that
can subsequently be called and accessed from your Java enclave code.
The sample "hello world" enclave took us through a tutorial on how to write an
enclave that takes a string, reverses it and returns it via the host to the client. In this section we
Make sure you've already run through the tutorial and have a working sample application as a starting point.
following line to your enclave
1 2 3 4 5
Import the GraalVM SDK classes¶
the SDK is automatically added when you specify
supportLanguages = "js" so you just need to add the
following import statements to
1 2 3 4 5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
Remove the Java code that reverses the string and replace it with the following function. Note
static has been removed from the function declaration because it now accesses the
1 2 3 4 5 6 7 8 9 10
Finally, run the sample code as described in the tutorial. The result should be the same: the string passed as an argument to the client is reversed and returned to the client.