PublicKeyEncryption Module

myPKEModule := STD.Crypto.PublicKeyEncryption(pkAlgorithm, publicKeyFile, privateKeyFile, passphrase);

myPKEModuleThe name of the Public Key Encryption module structure
pkAlgorithmThe algorithm to use, as returned by SupportedPublicKeyAlgorithms()
publicKeyLFN / publicKeyBuffThe File Specification of the PEM formatted Public Key file
privateKeyLFN / privateKeyBuffThe File Specification of the PEM formatted Private Key file
passphraseThe passphrase to use for encryption, decryption, signing, verifying

A Public Key Encryption module is defined in ECL. Subsequent function definitions use the options defined in the Public Key Encryption module to perform asymmetric encryption/decryption/digital signing/signature verification.

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) );