Securing Communication by Creating TLS Communication Keys
Important: When EFTLink and Xstore are running separate JREs, it is strongly recommended that you update both JREs to their latest versions to avoid issues with TLS Communications.
Although TLS communication Keys are generated by default. You may wish to regenerate your keys. A batch file, CreateKeys.bat, and a Linux script, CreateKeys.sh is included in the EFTLink project to facilitate creation of encryption keys.
-
Locate the
CreateKeys.bat / CreateKeys.sh
file in the EFTLink folder. -
From a terminal, run the CreateKeys script file with an appropriate set of parameters to create encryption keys.
CreateKeys.bat -e <algorithm> <bitlength> <signAlgorithm> <daysValidity> [-dname]
CreateKeys.sh -e <algorithm> <bitlength> <signAlgorithm> <daysValidity> [-dname]
For example,
CreateKeys.bat-e RSA 4096 SHA256withRSA 750
For example,
CreateKeys.bat-e RSA 4096 SHA256withRSA 750 -dname
Table 2-5 SelfSigned Certificate Parameters
Switch Parameter Description Supported Value -e
<algorithm>
Algorithm used for TLS keys encryption.
EC,DSA,RSA
<bitlength>
Number of bits - higher values equate to a higher level of encryption.
256 (when using EC),
1024,2048 (when using DSA),
1024,2048,3072,4096,7680,8192,15360 (when using RSA)
<signAlgorithm>
Signature Algorithm used.
SHA256withECDSA, SHA384withECDSA, SHA512withECDSA (when using EC), SHA256withDSA (when using DSA), SHA256withRSA, SHA384withRSA, SHA512withRSA (when using RSA)
<daysValidity>
Number of days after creation that the certificate will remain valid.
100 to 750 days
[-dname]
Prompt for POS and Eftlink keystores certificate Distinguished Name information.
-
Once encryption keys are created, five files will be present on the system in the keys subfolder of EFTLink:
pos.private.jks
to be MOVED to the POS clientpos.public.jks
- to remain on the EFTLink Servereftlink.private.jks
- to remain on the EFTLink Servereftlink.public.jks
- to be MOVED to the POS clientcomms.keystore.properties
- required to be held on both POS and EFTLink Server -
The following files should be REMOVED from the EFTLink system and placed on the POS in the folder [xstore root]\keys, where xstore root is the main POS client folder. For example,
C:\xstoredata\xstore\keys,
or prior to version 22 of Xstore inC:\xstore\keys)
.pos.private.jks
eftlink.public.jks
-
The following file should be COPIED from the EFTLink system and placed on the POS in the folder [xstore root]\keys, where xstore root is the main POS client folder. For example,
C:\xstoredata\xstore\keys,
or prior to version 22 of Xstore inC:\xstore\keys)
:comms.keystore.properties
-
This will leave the following three files on the EFTLink server in the folder [eftlink root]\keys:
eftlink.private.jks
pos.public.jks
comms.keystore.properties
-
The removal of the appropriate files from the EFTLink server is to limit the availability of TLS keys only to where they are required, and in order to reduce the possibility of the keys being obtained and used to monitor traffic between POS and EFTLink server.
These instructions are repeated by the CreateKeys script file when keys are generated.
Note:
From V20 onwards, expiry of TLS certificates is enforced by default. Self-signed certificates will be valid for a maximum of 750 days.
-
Clear warnings will be placed in log files when certificates are due to expire. Expired certificates will not result in loss of communication between POS and EFTLink.
CA Certificates
Optionally, the EFTLink application TLS encryption keys for secure communication between POS client and EFTLink server may be signed by a CA. A batch file, CreateKeys.bat, and a Linux script, CreateKeys.sh is included in the EFTLink project to facilitate creation of encryption keys, generation of signing request and import of the signed certificates.
-
Locate the
CreateKeys.bat / CreateKeys.sh
file in the EFTLink folder. -
From a terminal, run the CreateKeys script file with an appropriate set of parameters to create encryption keys. The parameters are like those when used to generate self-signed certificates but specify the first parameter as -s.
CreateKeys.bat -s <algorithm> <bitlength> <signAlgorithm> <daysValidity> [-dname]
CreateKeys.sh -s <algorithm> <bitlength> <signAlgorithm> <daysValidity> [-dname]
For example,
CreateKeys.bat-s RSA 4096 SHA256withRSA 750
CreateKeys.bat-s RSA 4096 SHA256withRSA 750 -dname
Table 2-6 CA Certificate Parameters
Switch Parameter Description Supported Value -s
<algorithm>
Algorithm used for TLS keys encryption.
EC,DSA,RSA
<bitlength>
Number of bits - higher values equate to a higher level of encryption.
256 (when using EC),
1024,2048 (when using DSA),
1024,2048,3072,4096,7680,8192,15360 (when using RSA)
<signAlgorithm>
Signature Algorithm used.
SHA256withECDSA, SHA384withECDSA, SHA512withECDSA (when using EC), SHA256withDSA (when using DSA), SHA256withRSA, SHA384withRSA, SHA512withRSA (when using RSA)
<daysValidity>
Number of days after creation that the certificate will remain valid.
100 to 750 days
[-dname]
Prompt for POS and Eftlink keystores certificate Distinguished Name information.
-
Once encryption keys are created, a sub-folder based on the current date/time is created containing the encryption keys along with signing requests:
For example,
Folder name: keys20200710115046
Eftlink.private.jks
- selfsigned filePos.private.jks
- selfsigned fileEftlink.private.csr
- certificate signing requestPos.private.csr
- certificate signing requestEftlink.private.jks
- backup of selfsigned filePos.private.jks
- backup of selfsigned filecomms.keystore.properties
- keystore encryption data fileThe backup files are required for the situation where a subsequent import is attempted but does not give the required results - further attempts may be made at importing the signed certificates received from the CA.
For this reason, do not remove the backup files.
File are held in this temporary folder rather than the keys folder as the signing process may take some time, and several sets of signed keys can be handled.
-
Deliver to your CA the following files:
Eftlink.private.csr
Pos.private.csr
In reply, you should receive the following files (filenames may vary):
Eftlink.private.cer.der
- signing of EFTLink.private.csrPos.private.cer.der
- signing of POS.private.csrRoot.cer
- root certificate used to signOptional Intermediate.cer
- one or more intermediate certificates -
Import the signed certificates into the keystores, by placing the signed files and root certificate (plus optional intermediate certificates) in the temporary signing keys folder keys[date] then running the following command.
Createkeys -I <foldername> <root cert> <eftlink signed file> <pos signed file> <(optional) intermediate certificate 1><(optional) intermediate certificate 2>
Table 2-7 Signed Files, Root Certificates and Intermediate Certificates
Switch Parameter Description Supported -e
<foldername>
Temporary keys Subfolder name. Do not provide the full path, just the foldername.
18 character folder name
<root cert>
The root certificate provided by the CA
Security certificate
<eftlink signed file>
Signed file returned by CA
Security certificate
<pos signed file>
Signed file returned by CA
Security certificate
<intermediate certificate 1>
CA Intermediate certificate
Optional Security certificate
<intermediate certificate 2>
CA Intermediate certificate
Optional Security certificate
For example,
createkeys -i keys20200101010101 ca_root.cer eftlink.private.der.cer pos.private.der.cer ca_intermediate1.cer ca_intermediate2.cer
-
Archive the temporary keys[date] folder to a safe location as this contains sensitive information.
-
The following files should be REMOVED from the EFTLink system and placed on the POS in the folder [xstore root]\keys, where xstore root is the main POS client folder. For example,
C:\xstoredata\xstore\keys,
or prior to version 22 of Xstore inC:\xstore\keys)
:pos.private.jks
eftlink.public.jks
-
The following file should be COPIED from the EFTLink system and placed on the POS in the folder [xstore root]\keys, where xstore root is the main POS client folder. For example,
C:\xstoredata\xstore\keys,
or prior to version 22 of Xstore inC:\xstore\keys)
:comms.keystore.properties
-
This will leave the following three files on the EFTLink server in the folder [eftlink root]\keys:
eftlink.private.jks
pos.public.jks
comms.keystore.properties
-
The removal of the appropriate files from the EFTLink server is to limit the availability of TLS keys only to where they are required, and to reduce the possibility of the keys being obtained and used to monitor traffic between POS and EFTLink server. These instructions are repeated by the CreateKeys script file when keys are generated.
Note:
From version 20 onwards, expiry of TLS certificates is enforced by default. Self-signed certificates will be valid for a maximum of 750 days.
-
Clear warnings will be placed in log files when certificates are due to expire. Expired certificates will not result in loss of communication between POS and EFTLink.