Bugfixes in key management.  Added digital signature and hashing support, along with corresponding unit tests.