modified to generate priv/pub/sin if doesn't exist already, and load it in if it does