Updated to allow explicit pub and priv keys to be passed