This is a not a shell script, run these commands manually. Tested working with ReadyNAS OS 6.10.4 Hotfix 1.
ls /dev/md
First, place your keyfile in the nominal location and set permissions (you will need to scp this over).
cp <your_keyfile> /run/systemd/cryptsetup/<your_keyfile>
chmod 0600 /run/systemd/cryptsetup/<your_keyfile>
/lib/systemd/systemd-cryptsetup attach '<your_volume_name>' '/dev/md/<your_volume_name>' '/run/systemd/cryptsetup/<your_keyfile>' ''
rm /run/systemd/cryptsetup/<your_keyfile>
systemctl restart readynasd
logout