Generating a data digest

Generate a base64-encoded hash of the data to be signed, and set this value as an environment variable. For example, to hash the contents of a data.txt file:

$ export DIGEST_TBS=$(openssl sha256 -binary ./data.txt | base64)
$ echo $DIGEST_TBS
X/D/4z204pWnLaE+7F2x0aJEWPmisoYNEQLYdqFqh7E=