Encryption
The following settings within the paybylink.properties
file needs to be encrypted.
-
adyen.paybylink.apikey
If using a terminal (customer present functionality), the following properties also need to be encrypted:
-
adyen.paybylink.cp.key.identifier
-
adyen.paybylink.cp.key.passphrase
-
adyen.paybylink.cp.key.version
To achieve this, the following steps must be followed:
To encrypt a value: Open a terminal window and change directory to where the script file resides.
For Windows: Type encrypt-paybylink.bat –e <keystore
name> <properties file> <value>
.
For example, encrypt-paybylink.bat –e
*For Linux: Type sudo ./encrypt—paybylink.sh –e [<keystore name> <properties file> <value>]
.
For example, sudo ./encrypt-paybylink.sh –e
The user will be presented with prompts to provide the value(s) which are to be encrypted. Once entered the corresponding properties keys will be automatically updated with the encrypted values.
Note:
If the keystore name, properties file and unencrypted text
is included as arguments then the encrypted value and initialization
vector will be outputted to the console which must be copied and pasted
to relevant property key in paybylink.properties
. This process then needs to be repeated for every value that is
required to be encrypted.
To re-encrypt; Open a terminal window and change directory to where the script file resides.
For Windows: Type encrypt-paybylink.bat –r [<keystore
name> <properties file> <keygen type> <cipher type> <key
size> <iterations>]
.
For example, encrypt-paybylink.bat –r
*For Linux: Type sudo ./encrypt-paybylink.sh –r [<keystore name> <properties file> <keygen type> <cipher type> <key size> <iterations>]
.
For example, sudo ./encrypt-paybylink.sh -r
The key values to be re-encrypted will be taken from the properties file, re-encrypted and the properties file will be automatically updated.
* You may be required to give script file(s) execution rights for
example, chmod +x <PathToFile>
Note:
When using AES algorithm with a keysize that is greater than 128, you may get java.security.InvalidKeyException: Illegal key size or default parameters. If so, Additional Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files will need to be downloaded and extracted to %JAVA_HOME%/jre/lib/security/.