Allow hash_algorithm to be configurable

We may want to set hash_algorithm to be 'sha2', so we
should allow hash_algorithm to be configurable.

Change-Id: I9be1afb1df9705f5d96c5c3c1caf4f5e4b563042
Closes-Bug: #1370825