Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

rsaEncryption

rsaEncryption

Asymmetric encryption is a cryptographic method that uses a public-private key pair and optionally a passphrase or password to encrypt and decrypt data. The
rsaEncryption
function encrypts data using the RSA algorithm and the provided public key.
You can encrypt data only in a process configured to run on a Secure Agent, and the key file must be available on the selected agent.
You can use the following types of keys for RSA encryption:
  • GPG keys
    . The keys must be in the ASCII format, and the private keys must be protected with a passphrase.
  • OpenSSL keys
    . The keys must be in the PKCS#8 format and be encoded as a PEM file for use in encryption and decryption. You can protect the private keys with a passphrase.
RSA limits the amount of data you can encrypted or decrypted based on the following key size:
  • With a1024-bit key, you can encrypt up to 128 bytes of data.
  • With a 2048-bit key, you can encrypt up to 256 bytes of data.
  • With a 4096-bit key, you can encrypt up to 512 bytes of data.

Syntax

util:rsaEncryption(keyType, key, dataToEncrypt)
The following table describes the arguments for this command:
Argument
Description
keyType
Specifies the type of RSA key used.
You can enter one of the following values:
  • GPG
  • OpenSSL
key
The absolute path of the public key file on the selected agent.
The Expression Editor accepts the file path of keys as input instead of the keys itself.
dataToEncrypt
The plain text data that you want to encrypt.

Return Value

The function returns a base64-encoded text as a result of the RSA encryption.

Examples

The following example returns encrypted values for the data based on the key passed as inputs in the function:
SAMPLE FUNCTION
OUTPUT
util:rsaEncryption("GPG", "/absolute/path/to/public_key.asc", "Hello, world!")
BmselDb3Z....QzE0XCyngU4JReww5Y=

0 COMMENTS

We’d like to hear from you!