Add key base64 and substring validation