Support for keys on external device

This patch adds support for storing encryption keys on external devices. It's fairly trivial and seems to work for me, but I haven't done extensive testing.