Working script. Private data key field optional.