Encrypt (PKE)

myPKEModule.Encrypt(inputData);

myPKEModuleThe name of the Public Key Encryption module structure
inputDataThe data to encrypt in DATA format
Return:Encrypted contents in DATA format

The Encrypt function encrypts the given inputData using the options specified in the Public Key Encryption module definition.

Example:

IMPORT STD;
privKeyFile := '/var/lib/HPCCSystems/myesp/test.key';
pubKeyFile :=  '/var/lib/HPCCSystems/myesp/test.key.pub';

//PKE Encryption module definition
myPKEModule := STD.Crypto.PublicKeyEncryption('RSA', pubKeyFile, privKeyFile,''); 

DATA encrypted := myPKEModule.Encrypt((DATA)'The quick brown fox jumps over the lazy dog');

OUTPUT( (STRING)myPKEModule.Decrypt(encrypted) );