Studio Visual Editor
-
Create an global Encryption element, specifying a name for the element if you wish; keep the default value for the Default Encrypter:` JCE_ENCRYPTER`.
-
Set an Encryption message processor in the flow in which you wish to encrypt data in the message payload.
-
Configure the message processor according the table below.
Field Required Value Display Name
A unique name for your message processor.
Connector Configuration
x
Use the drop down to select the global Encryption element you created.
Operation
x
Encrypt
Input reference
Enter a Mule expression to define the part(s) of the message Mule should encrypt. If no value is entered, Mule encrypts the entire message payload.
Stream Name
Name of the decrypted payload in a PGP-encrypted file. If a file is encrypted using Mule, this setting helps you keep the original filename so that it is recovered when decrypting the resulting PGP file.
Select encrypter
x
JCE_ENCRYPTER
Reference or expression
If selected, in the JCE Encrypter Reference, use an expression to reference attributes you have defined elsewhere in the XML configuration of your applications, or to reference the configurations defined in a bean.
Define attributes
If selected, enter values in the following four fields.
Key †
x
The key (i.e. password) to decrypt the encrypted data. It must be 16 bytes long
Key Password †
If the key is stored in a keystore, enter the password to the keystore.
Algorithm
Select an algorithm to use to encrypt the data. Refer to Appendix below for list of available algorithms.
Encryption Mode
Select an encryption code for Mule to use to encrypt the data.
† mutually exclusive
XML Editor or Standalone
-
Create an global
encryption:config
element, set above all the flows in your config file. -
Configure the attributes of the element according to the table below.
<encryption:config name="Encryption" defaultEncrypter="JCE_ENCRYPTER" doc:name="Encryption"/>
Attribute Req’d Value name
x
A unique name for your global element.
defaultEncrypter
JCE_ENCRYPTER
doc:name
A display name for the element in Studio’s Visual Editor. Not applicable for Standalone.
-
Add an
encryption:encrypt
element to the flow in which you wish to encrypt data in the message payload. -
Configure the element’s attributes and child elements according to the tables below.
<encryption:encrypt config-ref="Encryption" doc:name="Encryption" using="JCE_ENCRYPTER" input-ref="#[message.payload]"> <encryption:jce-encrypter key="test" algorithm="Blowfish" encryptionMode="CFB"/> </encryption:encrypt>
Attribute Req’d Value config-ref
x
Use the name of the global Encryption element you created.
doc:name
A display name for the element in Studio’s Visual Editor. Not applicable for Standalone.
using
x
JCE_ENCRYPTER
input-ref
Enter a Mule expression to define the part(s) of the message Mule should encrypt. If no value is entered, Mule encrypts the entire message payload.
streamName
Name of the decrypted payload in a JCE-encrypted file. If a file is encrypted using Mule, this setting helps you keep the original filename so that it is recovered when decrypting the resulting JCE file.
Child Attribute Req’d encryption:jce-encrypter
x
Child Element Attributes Req’d Value key†
x
Specify the key (i.e. password) to decrypt the encrypted data.
algorithm
Specify the algorithm to use to encrypt the data. Refer to Appendix below for list of available algorithms.
encryption Mode
Specify an encryption code for Mule to use to encrypt the data.
keyPassword†
If the key is stored in a keystore, specify the password to the keystore.
†mutually exclusive