In this “How-to” guide, we will show you how to test MLE (Message Level Encryption) enabled APIs using Java.
The first step is to enable MLE for the API(s) you are interested in.
Login to your Visa Developer Dashboard and go to your project, you should see something like this:
Enable the APIs for which MLE needs to be active in VDP by toggling the API for which MLE needs to be enforced.
In this tutorial, we are going to enable MLE for Funds Transfer API And Query API:
On the left side navigation menu of your project, click on “Credentials”.
Next step we will create a Key-ID by clicking on the Generate Key-ID button.
Copy the Key-ID for your reference.
The Key-ID looks this: 41d9f2a1-xxxx-4xxx-b40c-a0480c2xxxxx
The next step is to add a CSR. Click on the link "Add CSR" .
You are prompt to submit a Certificate Signing Request.
We have the option to Generate a CSR for me (default) or submit your own. In this example, we will use the Generate a CSR for me (default) and click Confirm button.
After submitting the request, you will be prompt to download the Certificate/Copy Private Key.
After you have downloaded the private key, check the box "I confirm that I've downloaded my certificate key" and click continue. You will see the Status change to "Active".
Expand the Key-ID and you will see the Server Encryption Certificate and Client Encryption Certificate. Download both certificates.
To be able to make an API call with MLE, you need to have the following
You should be able to see Message Level Encryption Sample Code under the General Assets Section
Open the Java Class PushFundsAndQueryAPIWithMLE on your IDE and set the below parameters with your own credentials
KEYSTORE_PATH = "<YOUR KEYSTORE PATH>";
KEYSTORE_PASSWORD = "<YOUR KEYSTORE PASSWORD>";
USER_ID = "<YOUR USER ID>";
PASSWORD = "<YOUR PASSWORD>";
MLE_CLIENT_PRIVATE_KEY_PATH = "<YOUR MLE CLIENT PRIVATE KEY PATH>";
MLE_SERVER_PUBLIC_CERTIFICATE_PATH = "<YOUR MLE SERVER PUBLIC CERTIFICATE PATH>";
KEY_ID = "<YOUR KEY ID>";
Please refer to the article HelloWorld.java - How to run Java Sample Code using the Hello World API and Mutual SSL of how to create a Java KeyStore.
Want more? Join the Visa Developer Community to get alerts on the latest tutorials, guides, and new developer resources. Stay tuned for more in the series.
Hi @evgeny_t ,
Thank you for checking out the Java MLE How-To Guide.
Kindly download the download the Java Sample Code which is available by login to the developer portal
You should be able to see the Message Level Encryption Sample Code under the General Assets Section which contains the Java Sample Code (Maven Project) which you can import on your IDE.
Let me know how it goes and any feedback you may have.
I tried to download the "Message Level Encryption Sample Code" bundle on dashboard page, but when I clicked on it nothing happened (after the throbber finished). Same story with the "Hello World Sample Codes" bundle.
Hi @Szabolcs ,
I was able to download the "Message Level Encryption Sample Code" from the dashboard page. Would you mind trying with a different browser or check if file was blocked from the browser you are using.
thank you for your reply.
I checked in dev mode the requests and it turned out it was just a network restriction from my company side. I solved this problem and now I was able to download the required bundles.