Made some methods public in BasicKeyChain and clean deterministic key generation.

I think it makes more sense to return null or throw an exception here actually.