Some key store fixes

- Making key store header files public.
- Adding functionality to auto-generate a key if it doesn't exist.