Wednesday, May 20, 2020

How to Encrypt / Decrypt Files in OIC using PGP

How to Encrypt / Decrypt Files in OIC using PGP

Oracle Integration Cloud provides Pretty Good Privacy (PGP) mechanism to encrypt or decrypt the files which allow us to read/write files in a secure manner.

We need PGP public and private keys to achieve this,

  • PGP public key is used to encrypt the file
  • PGP private key is used to decrypt the file
I have used the below online tool to generate the PGP keys.

A public key is published and enables any sender to perform encryption and the private key is kept secret by the receiver and enables only him to perform correct decryption.

In below example, we would assume sender and receiver both are us(OIC).

How to Encrypt the File

Create FTP Connection with below details,


Choose one of the following security policies,
  • FTP Server Access Policy—This policy uses the user name and password for authentication.
  • FTP Public Key Authentication—This policy connects to the sFTP server using a key. This is used only for sFTP connections. 
  • FTP Multi Level Authentication—This policy uses multiple independent credentials to log in to the server. 

I have selected FTP Public Key Authentication. The simpler one is "FTP Server Access Policy" which just allows you to connect with plain username/password.

ASCII-Armor Encryption Format:

Select to format the encrypted message in ASCII armor. ASCII armor is a binary-to-textual encoding converter. ASCII armor formats encrypted messaging in ASCII. This enables messages to be sent in a standard messaging format. This selection impacts the visibility of message content. If not selected, the message is sent in binary format.

I have selected as "Yes", it depends on your requirement.

Cipher Algorithm : 

Select the symmetric cryptographic algorithm to use. Symmetric-key algorithms for cryptography use the same cryptographic keys for both encryption of plain text and decryption of cipher text.

  • CAST5
  • 3DES
  • AES128
  • AES192
  • AES256




Now let's create the integration and drag/drag the FTP connection created above.


Make sure to select "Perform PGP Encryption on the file to be sent to external FTP Server".



How to Decrypt the File

To Decrypt the file, you would need to use the private key. I will use the same FTP Connection created above, update the private key and its password(if applicable).


And Create a new integration to download the file and decrypt.


Select operation as "Download file".
And Make sure to select "Perform PGP Decryption on an encrypted file downloaded from external FTP Server".



Thursday, May 7, 2020

Data Stitch and Global Variables in OIC

Data Stitch and Global Variables in OIC

In this post, we will look at 2 new Integration features Data Stitch and Global Variables.  Data Stitch allows us to make assignments to complex type variables. Below is the use case,
  • Accept multiple country codes as input.
  • For loop
    • Retrieve the country details from an REST API.
    • Use Data Stitch to collate the response (in a temporary variable)
  • Assign the Response from temporary variable.
I'm going to use a REST API which is available online for creating a connection.
https://restcountries.eu/rest/v2/alpha/{code}

Prerequisite:
Enable following features:
  • oic.ics.console.integration.stitch-action
  • oic.ics.console.integration.complex-variables

The minimum Oracle Integration version required for the feature is 200113.1400.33493
Global Variables are visible anywhere in the integration, including fault handlers.

Creating REST Connection


Creating a SOAP Connection

 I have used a schema which will look like below for the above soap connection.
Create your own wsdl with below elements in request and response.

 Creating the App Driven Integration


Drag and Drop the SOAP Connection Created and configure the details.



Now drag and Drop the REST Connection to configure the details.
Please make sure to select the highlighted checkbox



You have to select JSON Sample and click on inline to enter the sample response.
You can take the RESPONSE EXAMPLE from this site. https://restcountries.eu/


 Now drag and drop the For Each activity right after the first task.


I have changed the Layout to Horizontal.
Reposition the Map and Rest Invoke inside the For each.
 Now lets create a Global variable,


Name the Variable as tempResponse and Type as "Object".
Select the response of this SOAP interface. This variable will be used along with data stitch.


Now lets map the request for REST API as below.


Drag and drop a new Map activity after the REST Invocation.
The response mapping will be something like below.
Note: The variable you see in the target is the actual response element of this interface, not the temp variable we created.



Now drag and drop the Data Stitch activity, right after the mapping(inside the for each).
Name the activity and click configure.

Now we have to copy/append the data from CountryDetails_Response (which was mapped in previous activity) into tempResponse variable.

You can use Data Stitch to Overwrite the values as well, it has 3 options

  1. Append (shown in this example)
  2. Assign (Overwrite values in a complex element)
  3. Remove (Delete an element from a complex element)



And in the Map activity after ForEach, we will take the data from tempResponse and map it to response element of this interface.

Now activate the interface and test it from SOAP Ui.


Monday, May 4, 2020

Iaas Vs Paas Vs Saas

Iaas Vs Paas Vs Saas

IaaS (Infrastructure as a Service):

Infrastructure as a service (IaaS) is an instant computing infrastructure, provisioned and managed over the internet. You get the InfraStructure & Pay accordingly. You have freedom to install any OS or Applications as required.

Example : Amazon Web Services (AWS), Google Cloud Platform (GCP), Oracle Cloud Infrastructure (OCI). Below are the few variations on Iaas,

  • Compute Cloud Services (Virtual Machines, EC2)
  • Network Cloud Services (DNS,Load Balancing)
  • Storage Cloud Services (File Storage)


PaaS (Platform as a Service):

PaaS or platform as a service model provides you computing platforms which typically includes an operating system, programming language execution environment, database, web server. Technically It is a layer on top of IaaS as the second thing you demand after Infrastructure.

PaaS delivers the infrastructure and middleware components that enable developers, IT administrators and end users to build, integrate, migrate, deploy, secure, and manage mobile and web applications.

Example : Google App Engine, SOA Cloud Service, Oracle Integration Cloud Service

SaaS (Software as a Service):

In a SaaS, you are provided access to application services installed at a server. You don’t have to worry about installation, maintenance or coding of that software. You can access and operate the software with just your browser. You don’t have to download or install any kind of setup or OS, the software is just available for you to access and operate. The software maintenance or setup or help will be provided by SaaS provider company and you will only have to pay for your usage.

Example: Oracle HCM Cloud, Oracle ERP, Microsoft office365, Salesforce.