Add const, remove some copying of private key.