Made the constructor take a keystore.