Add more error codes and message, reflow some doc comments.

This is a security measure to keep the decrypted key out of memory, please don't delete it.